I’ve got some problems implementing the perspective shadow mapping algorithm described by stamminger et al.
Currently I’m trying to render the shadow map correctly if a directional light is in front of the viewer. The light position in post projective space is calculated as described on http://www9.informatik.uni-erlangen.de/Persons/Stamminger/Research/Research/psm
The problem is that the scene becomes very small in the shadow map as the light moves from a position above the viewer to a position in front of the viewer. This leads to results that are worse than via standard shadow mapping.
As far as I understand the situation is like that: The z-coordinate of the light is fixed at the infinity plane at (zFar+zNear)/(zFar-zNear). The y-coordinate is zero for a light directly in front of the viewer and grows towards infinity as the light position approaches a position above the viewer. I’m trying to find the smallest angle for a projection matrix P such that the unit cube is completely visible from the position of the light in post projective space. For a light above the viewer this angle is very small (e.g. 3.4 degrees) and becomes bigger as the light moves to the front of the viewer (angle for projection e.g. 80 degrees). I think this is what causes the scene to be so small.
My algorithm would even do much worse if the zFar plane would be farther away, as the distance between the infinity plane and the far plane would decrease in post projective space.
Any help? How are you calculating the projection matrix? I’m thankful for any hint getting me closer to a working solution!
[This message has been edited by stefan (edited 11-12-2003).]