Jump to content

  • Log In with Google      Sign In   
  • Create Account


frustum generation Question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 uglybdavis   Members   -  Reputation: 894

Like
0Likes
Like

Posted 31 January 2014 - 02:36 PM

I'm trying to auto generate a camera frustum for shadow mapping. I have 4 points in world space (The corners of the viewing cameras frustum). I want to build an orthographic frustum that encompases these 4 points as tight as possible, but is aligned with my directional lights direction vector.

 

I have no idea what to google for, does anyone know what this is called?



Sponsor:

#2 uglybdavis   Members   -  Reputation: 894

Like
0Likes
Like

Posted 31 January 2014 - 03:49 PM

Breaking it down a bit, i think this becomes a much simpler problem than i made it out to be.

 

Find the directional light's "position", which is going to be some distance in the negative direction of the lights direction from the viewing cameras centroid.

The exact distance will probably be based on the bounds of the current scene being rendered.

Add all frustum corners to a list of vertices. Also add the light position to this set. (All points in world space)

Generate a tight fitting OBB based on the above list. Bring the obb from world space to the lights local space.

Convert the light local OBB to an AABB, this AABB is the orthographic frustum.

 

Does this sound about right?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS