View Full Version : CSM + Slope based Bias + PCF

06-24-2011, 03:24 PM
Hi everyone !

I've recently a implemented cascaded shadow map technique but I have some trouble with it when I enable PCF.

My implementation is really basic:
I set the view frustum so that the far plane is tighten to the scene. I compute my split based on a "magic" function I render shadow maps into an array of depth texture I determine the visibility of each pixel based on the shadow map.
In order to avoid aliasing I add a small constant bias and a slope based bias. The slope based bias is computed using the technique presented here (http://msdn.microsoft.com/enus/library/ee416307(v=vs.85).aspx).

Apparently it works fine, as shown on the screenshot:


Full resolution image available here (http://artis.imag.fr/Members/Charles.De%20Rousiers/pub/WithoutAperture.png)

When I enable PCF, shadows are OK but I get halos around objects, as shown on the screenshot:

Full resolution image available here (http://artis.imag.fr/Members/Charles.De%20Rousiers/pub/WithAperture.png)

I suspect derivatives used for computing the slope based bias to be wrong. But I'm not sure. Does anyone of you as encounter such a trouble ?

Thank you in advance !

BTW, it's implemented into a deferred pipeline.

06-25-2011, 12:33 AM
The link to your technique does not work.
Maybe unrelated but even in your first screenshot there are pixels of lights in shadows ?

06-26-2011, 12:27 PM
Sorry about the link : here is the correct link (http://msdn.microsoft.com/en-us/library/ee416307(v=vs.85).aspx)

What do you mean ?
Pixels in shadow are not totally black ? It's because I take in account sky's irradiance with a SH probe. Small sparse pixels with bright intensity in shadow ? I don't know where they come from =/