• Advertisement
Sign in to follow this  

Should I use slope-based depth bias?

This topic is 2123 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

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:
http://img818.imageshack.us/img818/495/depthbiasslope.jpg
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
Advertisement
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 Screen-Spaced Directional Occlusion (SSDO) Paper of Tobias Ritschel (in section 5).

As for slope-scaled depth bias, there are two approaches. I outlined them here a few months back and added some links to presentations, explaining them in more detail.

Cheers! smile.png

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 Screen-Spaced Directional Occlusion (SSDO) Paper of Tobias Ritschel (in section 5).

As for slope-scaled depth bias, there are two approaches. I outlined them here a few months back and added some links to presentations, explaining them in more detail.

Cheers! smile.png

Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement