Sign in to follow this  

Move shadow map with viewer

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

This topic is 4249 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.

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

Sign in to follow this