Thanks in advance for any help.
Question #1:
I have implemented Shadow Mapping in my game. Historically I have been developing with nvidia hardware. I have recently acquired a new laptop with an ATI Radeon Mobility, and my game has a minor issue with ATI.
It seems that GL_CLAMP_TO_BORDER_ARB is not working for the depth texture. Right now my depth texture represents less than the full visible frustum(for resolution issues - this is an outdoor scene).
The clamping code I am using is roughly:
GLfloat v_bc[] = {1.0f,1.0f,1.0f,1.0f};
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, v_bc);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER_ARB);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER_ARB);
On nvidia, this leaves the non-depth tested portion of the scene out of shadow. ATI appears to ignore the setting.
Even if I render an inverse shadow with glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB,GL_GEQUAL);
ATI appears to ignore the clamp for the depth texture, while nvidia clamps properly.
Any ideas on fixing this?
Question #2:
These issues have also led me to consider implementing shadow mapping with my own glsl vertex and fragment programs. But it appears the GeForce 3 and 4 support the DepthTexture extension but do not support Fragment shaders. In order to provide shadows for GeForce 3 or 4, there would need to be a seperate render path. It does look like all of the ATI cards that support DepthTexture also support Fragment shaders - is this correct?
Question #3:
Trapezoidal Shadow Mapping looks pretty good. Is this the best approach to take to improve the Shadow Map resolution? Does anyone know any sample implementations?
Thanks again for any input…