Jump to content
  • Advertisement

OpenGL Shadow Mapping RTS-Game - Directional Light

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 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!