Skip to main content
gamedev.net
🔒 Locked

Should I use slope-based depth bias?

Started by angelmu88 Apr 29, 2012 at 9:11 PM 1 replies 5.9k views
Original Post
angelmu88
angelmu88
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!
My 3D graphic engine: http://graphicprogramming.wordpress.com/rebirthengine/
My blog: http://graphicprogramming.wordpress.com/
Tsus
Tsus
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
angelmu88
angelmu88

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!
My 3D graphic engine: http://graphicprogramming.wordpress.com/rebirthengine/
My blog: http://graphicprogramming.wordpress.com/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.