Sign in to follow this  

How to eliminate shadow map flickering?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Crysis, CoD4 and many more games use PSSM for rendering shadows over a large terrain. The shadow map splits are used for near and distant objects separately. So these games probably focus on particular part of the camera viewing frustum. I try doing something similar. I have a shadow map which I center at the camera position to make the objects near the camera cast and receive shadows. But what annoys me is this nasty flickering of shadows when the camera moves (and my shadow map projection also "moves" to keep tracking the camera). The aformentioned games do not suffer this problem. The shadows are robust and only their resolution changes (depending on the camera position). How to achieve such effect?

Share this post


Link to post
Share on other sites
This is a sub-texel accuracy problem here. What you want to do is round up the camera movement delta to the next texel center. This is described in an article by Michal Valient in ShaderX6. I believe there are also other examples online somewhere.

Share this post


Link to post
Share on other sites
Hi, I'm getting some flickering on poly faces with shadow acne. It looks like maybe the z-values are flickering. Does this sound correct and does the article cover that as well?

Share this post


Link to post
Share on other sites
I've just found http://www.gamedev.net/community/forums/topic.asp?topic_id=497259 and tried the code. Everything seemed to be ok until I looked at the scene at grazing angle. All the shadows started to "wave" and it was very noticeable. Any idea how to correct this?

// EDIT: ok - solved. I totally forgot I used mipmapping for shadow map (I was modyfying my VSM sample)

// EDIT2: another problem came out - translation solved but about scaling which is also handy when focusing shadow map? Is it described in aformentioned article?


[Edited by - Maxest on December 6, 2008 8:00:17 AM]

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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