Jump to content

  • Log In with Google      Sign In   
  • Create Account


Tispe

Member Since 02 Oct 2010
Offline Last Active Jul 01 2014 07:14 AM

Posts I've Made

In Topic: Getting perspective Frustum in world coordinates

23 June 2014 - 09:11 AM

The algorithm handles all cases, including self-shadowing.
If you have a special way of storing terrain such that it is not in any object lists you have the responsibility of handling that case.


L. Spiro

 

So the algorithm assumes that the terrain is partitioned into smaller objects which you can add to the drawing list if they pass culling?


In Topic: Getting perspective Frustum in world coordinates

23 June 2014 - 01:40 AM


Your plan always creates the absolute most inefficient shadow map possible.  Using corner points should not be used to determine the directional light’s shadow size, it should only be used as an optional limiter. It’s the maximum size there can be, and thus a smaller bound should always be used if possible.

 

If I understand you correctly, you want to gather all Objects in the scene and all Objects that cast shadows into the scene, and from this list of Objects take the bounding box/spheres to determine the size of the shadow map frustum?

 

But how would you account for self-shadowing terrain which is not in the object list? It might just be that in the far depth of the viewing frustum there might be some self-shadowing cravases, or a mountain range casting shadows on the valley below.


In Topic: Getting perspective Frustum in world coordinates

21 June 2014 - 01:53 PM

By wrapping the perspective (scene view volume) frustum inside the lights orthogonal frustum (canonical view volume), everything that can cast a shadow into scene view volume will be rendered to the shadow map, using std::numeric_limits<float>::max() and std::numeric_limits<float>::min() for +z and -z.

 

It is then only a matter of culling based on the shadow map frustum.

 

I plan on using RTW shadow mapping, possibly cascading the shadow map frustum further if the RTW quality does not hold up.


In Topic: Getting perspective Frustum in world coordinates

21 June 2014 - 06:53 AM

I am not frustum culling, I am wrapping my shadow map frustum to cover the scene frustum. So I need to find the max and min X and Y values of the scene frustum vertices as seen from the light.

 


You're almost there: You take these eight points and transform them with the inverse view-projection. This is done in homogenous space, so the points are (-1,1,0,1), (1,1,0,1), etc. After that, you divide the results by w.
 
It doesn't matter what transformations you use (inverse or not), the change from homogenous to cartesian is always a divide by w - after the transformation.

 

So I transform the 8 vertices (-1, -1, 0 ,1) (1, -1, 0, 1) (1,1,0, 1) (-1, 1 ,0, 1), (-1, -1, 1, 1) (1, -1, 1, 1) (1,1,1, 1) (-1, 1 ,1, 1) using the inverse view-transform? Then forward into light shadow map camera space, then divide by w?


In Topic: Getting perspective Frustum in world coordinates

20 June 2014 - 08:08 AM

Well I could, but then I would have to calculate 8 intersecting points of those planes. I want to know if perhaps I can get the clip space cube frustum transformed into world space.


PARTNERS