Sign in to follow this  
Emanuele Russo

Shadow Map Projection aliasing?

Recommended Posts

Hello, I'm trying to implement Lispsm for shadow mapping. It seems to solve perspective aliasing but, at certain angles of light and triangles, appears something strange that I don't understand. What kind of error could be? As you see on the face of the small parallelepiped there is a jagged edge of shadow. http://images3.fotoalbum.alice.it/v/www1-3//247/24783/261420/error-or.jpg Here we have a window of 1024*768 and a shadow map of 1024*1024 in 16 bit integer. If you need some more information please ask me, any idea is well accepted, please answer to this post. Thanks in advance Emanuele

Share this post


Link to post
Share on other sites
This is a common issue with shadow maps. You need to use a bias value (ie mulitply one of the values in the shadow comparison by a like 1.001)... also use a higher precision render target... most shadow map implementations use floating point textures, not integers.

Share this post


Link to post
Share on other sites
perspective shadow map approaches increase the depth aliasing errors. You want to use an orthographic projection and use cascaded shadow maps or any other multi-frustum approach.
The amount of depth aliasing errors and the very view dependent quality of perspective shadow maps make them unusable in games with a time of day feature where you need full-screenshadows.

Share this post


Link to post
Share on other sites
Yes, I suppose you're right, my experiments demonstrate it clearly.
I will probably try to use cascaded shadow maps, but I did not understand exactly how they work, please correct me if I miss something:

first of all: do I have to divide the depth by the homogeneous coordinate? always? with lispsm too?

now about the cascaded shadow:

1. you divide the frustum in some slices ( e.g. 4 )
2. calculate the light space bounding box of each frustum;
3. calculate 4 view projection matrices for the 4 frusta; the projection is orthographic
4. now you should draw 4 shadow maps, correct? can't you draw a single shadow map writing the slice depth in the color channels? e.g. the first depth in red, the second slice in green etc... ?
5. reuse the 4 shadow maps to estimate the shadowing coefficient... but how? what is the depth to be compared with? here is my confusion...

Thanks
Emanuele

Share this post


Link to post
Share on other sites
there is a nice example implementation available for Parallel-Split shadow maps ... those are cascaded shadow maps with an algorithm that picks the split distance. Search for this term on Google. They have a OpenGL and a D3D implementation.

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