I am developing a Direct3D 9 application and currently using an ATI Radeon HD 4550 video card. This card is supposed to enable PCF filtering when the surface of a texture(created with the depth/stencil usage and format D16) is bound as the depth/stencil surface.
I have bound the surface of the depth/stencil texture but PCF does not occur...Here is shader code:
float4 SampleShadowMap(float2 uv)
{
return tex2D(g_SamplerShadowMap, uv);
}
float4 PS(float2 ShadowMapUV : TEXCOORD0, float depth : TEXCOORD1) : COLOR0
{
float4 results = SampleShadowMap(ShadowMapUV);
// the 'depth' value comes from vertex shader where the triangle's
// position vector is transformed by the shadow casting light's
// view-projection transform.
return dot(depth < results, float4(0.25, 0.25, 0.25, 0.25));
}
I have read about PCF on ATI cards from here and here.
How do I get the card to perform PCF?
Aucun commentaire:
Enregistrer un commentaire