Jump to content

  • Log In with Google      Sign In   
  • Create Account

Should I use slope-based depth bias?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 angelmu88   Members   -  Reputation: 228

Like
0Likes
Like

Posted 29 April 2012 - 03:11 PM

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!

Sponsor:

#2 Tsus   Members   -  Reputation: 1061

Like
1Likes
Like

Posted 30 April 2012 - 03:58 AM

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! Posted Image

#3 angelmu88   Members   -  Reputation: 228

Like
0Likes
Like

Posted 30 April 2012 - 07:12 AM

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! Posted Image

Thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS