Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

JohnnyCode

Member Since 10 Mar 2008
Offline Last Active May 06 2013 02:11 AM
*----

Posts I've Made

In Topic: max coord values and fp precision

28 March 2013 - 03:47 AM

now, what abut loss of precision when converting to camera relative? just have to make sure you have enough decimal places in your fixed point eh? and your integer parts don't get too big?

 

another issue: true range checks (pythagorean) require squaring dx and dz (and dy for 3d range). that could lead to overflow with signed int and values on the order of 50 million. 50 meg ^2 = 250 trillion (?).  time for long long, eh?

 

do not check distance like this. If you want to find out wheather object falls into interactive scene, just examine its X value with global scene position value, then Y value with scene value, or also Z if you are not CPU overheaded and have also up down complexity, (like an universe fly game). The best scale for me, since I needed fingers on hands moving , or even better details, was adopted from 3ds MAX, 1 float is 1 meter. Heavenly precision leaving me to bunch of meters


In Topic: pixel perfect local rotations and quats vs mats

28 March 2013 - 03:39 AM

you can compute double on CPU but shaders need float . I do not see why float matricies in shaders would not result in pixel precise rotations. What do you mean by pixel precise rotation and why you think you are not having it?


In Topic: Whats the shader data a Material class holds?

28 March 2013 - 03:33 AM

I was very messed on this issue in my renderer and still could not come up with tidy solution.

Material is somehow much connected to the geometry.

I have a CShader class, it contains informations:

1- vertex declaration

2- compiled shader

then CMesh class that contains:

1-Vertex/Index Buffers

2- texture information

3- Cshader to use with the mesh (precisely 1)

 

Then in rendering, draw method of the CMesh looks up the vertex declaration of CShader instance and bounds vertex buffers streams accordingly, you have to assure CMesh has all of the streams vertex declaration asks though. Then textures are bound according to material ids. Then Scene Node info is passed to uniform data... and I draw. I also wrote more Render methods for CMesh if I needed to display it with another material, like RenderShadowVolume, or RenderDefferedLight(CLight) - this one is used only on screen aligned quad to render lightning after front passes.... and so on. I think that rendering instructions are so volatile that any "think for me" leads to no help.


In Topic: frustrum culling methods

28 March 2013 - 03:17 AM

The most sparing solution I came up with was:

1- first check wheather the AABS center is enough behind the near plane

2 - if it is not, check wheather it is behind left plane

3- if it is still not, check right plane

4-  if still not, check for bottom and top plane unless you are CPU bound,

5- fall in render queue


In Topic: Picking Intersection Vertices

27 March 2013 - 10:58 PM

you should not get just the triangle, but also the point in the triangle. From there, just inspect the verticies of the triangle and find the closest of the triple.


PARTNERS