Sign in to follow this  
angelmu88

Should I use slope-based depth bias?

Recommended Posts

Hi guys!
I'm having some troubles finishing my outdoor shadow casting algorithm. I've implemented Paralell split shadow maps (it's very similar to cascaded shadow map).
The problem is that shadows are perfect when casted over a flat surface, but when the surface has a very steep slope, artifacts appear. Here you can see some of these artifacts:
[url="http://img818.imageshack.us/img818/495/depthbiasslope.jpg"]http://img818.imageshack.us/img818/495/depthbiasslope.jpg[/url]
It's driving me crazy, I've checked near and far plane, and as usual I've modified the epsilon that I use when comparing to the depth stored in the shadow map:

float shadowCoeff = (tex2D(ShadowMapS, In.projTex.xy).r + EPSILON < depth) ? 0.0f : 1.0f;

But nothing happens. After two whole days of tweaking I've come across with something called sloped-based z bias or depth bias. Do you know if this could come in handy? (because artifacts only appear over steep slopes) If so, could yo please explain to me, how can I add sloped based depth bias to my shaders and DirectX 9.0c based engine?
Thanks!

Share this post


Link to post
Share on other sites
Hi!

Well, slope-scaled depth bias is one way to get rid of the artifacts. Another approach would be the screen space shadow correction as shown in the [url="http://www.mpi-inf.mpg.de/~ritschel/Papers/SSDO.pdf"]Screen-Spaced Directional Occlusion[/url] (SSDO) Paper of Tobias Ritschel (in section 5).

As for slope-scaled depth bias, there are two approaches. I outlined them [url="http://www.gamedev.net/topic/616869-understanding-shadow-bias/page__view__findpost__p__4894044"]here[/url] a few months back and added some links to presentations, explaining them in more detail.

Cheers! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites
[quote name='Tsus' timestamp='1335779930' post='4936029']
Hi!

Well, slope-scaled depth bias is one way to get rid of the artifacts. Another approach would be the screen space shadow correction as shown in the [url="http://www.mpi-inf.mpg.de/~ritschel/Papers/SSDO.pdf"]Screen-Spaced Directional Occlusion[/url] (SSDO) Paper of Tobias Ritschel (in section 5).

As for slope-scaled depth bias, there are two approaches. I outlined them [url="http://www.gamedev.net/topic/616869-understanding-shadow-bias/page__view__findpost__p__4894044"]here[/url] a few months back and added some links to presentations, explaining them in more detail.

Cheers! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]
Thanks!

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