Advertisement Jump to content
Sign in to follow this  

frustum generation Question

This topic is 1812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post

Link to post
Share on other sites

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?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!