Move shadow map with viewer

Started by
1 comment, last by gulgi 17 years, 11 months ago
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,
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.
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!

This topic is closed to new replies.

Advertisement