Jump to content
  • Advertisement
Sign in to follow this  
dnaxx

Move shadow map with viewer

This topic is 4465 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

Hello! I know that there are several approaches out there like LisPSM, PSM, TSM... But what I want to do at the moment is, to just move the shadowmap with the viewer. The center of the shadow map should be the viewer. Now my main problem is, to change the light-rendering-position in a way, that the shadows stay in the right perspective. Do you have ideas, on how to move the light-view with the viewer? thank you,

Share this post


Link to post
Share on other sites
Advertisement
I don't fully understand what are you asking for: if you want a spot on the stage effect, then you may use gluLookAt that points toward the viewer. If you really want that the lightsources moves with the viewer, then you can apply to the light the same transformations you apply to the viewer.

Share this post


Link to post
Share on other sites
Hi.

If you are talking about a directional light, which I hope you are, just move the "assumed" position of it, ei: lightPos = cameraPos - lightDir*distance;

What you really want is to enclose your camera:s frutum with your lights frustum.. not to hard math.

Good luck!

Share this post


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

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