Hi,
I use a sampler2DRectShadow and the shadow2DRect lookup function to implement hardware shadow map in a rectangular floating point texture pipeline. All works well, but actually I found the shadow2DRect function by myself according the orher function and sampler names. I would like to know if anybody has a link or some documentation about this function and if it is supported by the new graphics card. I did that on a nVidia FX 5700.
Then I also would like to know if a way to set up the texture compparison function and mode to allow shadow2DRect to return 0 or 1 instead the shadow depth in order the don’t have to perform the depth comparison by hand.
void main (void)
{
float epsilon = 0.000001;
vec4 defaultColor = vec4(0,1,0,1);
vec2 rect = vec2(imageWidth,imageHeight);
vec2 txc = vec2(gl_TexCoord[0]);
float pointDepth = ProjShadow.z/ProjShadow.w;
vec3 txcd = vec3(txc,pointDepth);
float shadowDepth = shadow2DRect(shadowMap, txcd).r;
if (inRect(rect,txc) == false) discard;
if (pointDepth > shadowDepth + epsilon) discard;
gl_FragColor.r = texture2DRect(fptexture, txc).r gl_FragColor.g = texture2DRect(fptexture, txc).g;
gl_FragColor.b = texture2DRect(fptexture, txc).b;
gl_FragColor.a = 1.0;
gl_FragColor *=expstop;
}
Thanks,
Charles-Félix.