Thanks in advance for any help…
I don’t want my shadows to be pitch black. It looks like ARB_shadow_ambient or GL_SGIX_shadow_ambient both address this, but I can’t seem to get them to work.
Here is a small bit of code:
//Init Depth Map Texture
glGenTextures(1,&m_depth_map);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D,m_depth_map);
glTexImage2D(GL_TEXTURE_2D,0,m_depth_format,TEX_SIZE,TEX_SIZE,0,GL_DEPTH_COMPONENT,GL_UNSIGNED_INT,0);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
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);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_COMPARE_MODE_ARB,GL_COMPARE_R_TO_TEXTURE_ARB);
glTexParameterf(GL_TEXTURE_2D,GL_SHADOW_AMBIENT_SGIX,0.5f);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_COMPARE_FUNC_ARB,GL_LEQUAL);
But the shadows are still solid black. Everything still shadows correctly, and my understanding is that the only thing I need to get non-black shadows is the call to:
glTexParameterf(GL_TEXTURE_2D,GL_SHADOW_AMBIENT_SGIX,0.5f);
Should’nt this change the luminance of the affected fragments from 0.0 to something else?
Any help is greatly appreciated…this is driving me nuts…
Even better, any other technique to get non-black shadows is welcome - must work on GeForce 4 and above…