VSM & LiSPSM

This topic is 4543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hello, I am trying to combine my implementation of VSM and LiSPSM. Both of them seem to work fine seperatly, but I get a strange result when I try to combine both techniques. The problem is the storing of the distance to the light position in view space in the shadow map itself (moments.x). The position from where the LiSPSM is created is not really in the direction of the light (Sundir for me) anymore. In theorie I would think that the position from where you store your distances wouldn't make a difference for VSM, but somehow my position can be inversed by LiSPSM I think, because it stores negative distances to the light. Points in shadow seam closer to the light when I look into the sun direction. When the sun is behind me, the correct distances are stored. Any idea what the reason could be for this? When I use the view matrix and light position from my normal shadow mapping camera the results are correct (I still use a LiSPSM view proj matrix to transform my vertices in the vertex shader). The problem is here of course that my quality is not so good, because I can't take full use of my LiSPSM matrices. Regards, Kenzo

Share on other sites
I'm not particularly familiar with LiSPSM, but I assume that it has to maintain the invariant that the post-projection "z" values are correctly ordered with respect to the light source. Therefore worst case, you can simply use them as your depth metric. However since they are usually quite nonlinear (unless LiSPSM messes with that?), they may not produce adequate precision throughout. That said, it's something to try.

I'm assuming from your post that LiSPSM modifies both the view and projection matrices when rendering the shadow map. Thus another potential depth metric to try is the distance to the center of projection... something like:

position_light_space = LiSPSM_view_matrix * position_world;distance = length(position_light_space);position_homogenious = LiSPSM_projection_matrix * position_light_space;

...and something similar when doing the shadow map comparison. Note that this involves storing TWO matrices instead of one (the composite view/projection), but it may produce better results than the above.

Anyways, first try using the post-homogenious-divide "z" value. If that doesn't work well, try the length of the position vector in the SHADOW's "view" space.

Share on other sites
I am trying the shadow effect in dynamic scene too,and I have used the shadow map, PSM, Light space PSM.
But I found that--when I rendered the model with color, the shadow was right; when I used one texture mapping onto the model in the scene, the shadow disappeard. I have got some demos, but none of them used more than one texture in the program--there was only one texture(depth map texture). Why? I have no idea.

1. 1
2. 2
3. 3
Rutin
22
4. 4
frob
17
5. 5

• 33
• 13
• 12
• 10
• 12
• Forum Statistics

• Total Topics
632573
• Total Posts
3007140

×