Original Post
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!
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!