Jump to content
  • Advertisement

OpenGL Shadow Mapping RTS-Game - Directional Light

This topic is 393 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 am trying to optimize shadow mapping for an rts-view (nearly top down) with directional light.

My approach so far is to intersect the camera view frustum with the plane of the terrain on which all the units are moving and
fit a box around the four intersection points:

Then I use the center of the box and the light direction to construct a view matrix.
To construct the orthographic projection matrix I use the corners of my box. 

With that I somehow do not get the wanted results (no shadows) /shadow map is not correctly created for the view of the camera.

I think I am maybe missing some translation/rotation?

Is there a better way for rts-views with a single shadow map ?

Thanks for your help beforehand!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!