Sign in to follow this  
dnaxx

Move shadow map with viewer

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

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