Hi,

I’ve got Variance Shadow Maps working in GLSL based on the code in GPUGems3. For example, my code for calculating the moments when generating the shadow map is:

vec2 ComputeMoments(float depth)

{

vec2 moments;

moments.x = depth;

moments.y = depth * depth;

float dx = dFdx(depth);

float dy = dFdy(depth);

moments.y += 0.25 * (dx * dx + dy * dy);

return moments;

}

It works great on my nVidia card but the shader does not compile on ATI cards (Radeon HD 3670 and 3870) with the latest drivers returning the errors:

“error(#202) No matching overloaded function found dFdx”

“error(#202) No matching overloaded function found dFdy”

Can I get this to compile on these cards (maybe by enabling an extension) or are the derivative functions just not available on older ATI cards? Or is there a way to calculate the derivatives manually?

Thanks,

Chris.