Z-Fighting Problem Solved
Thanks to an user named kRogue on the OpenGL forums the problem mentioned here is finally solved:
glTexParameteri( GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_ALPHA );is not part of GL3 core... though it is there in a compatible context. Try taking that call out and use the .r component of the depth texture in your shader... this should NOT make a difference, but you never know.
- kRogue
Furthermore I've been notified that the problem didn't occur on a GF GTX260.
One more important aspect to notice that you should check if you should ever happen to run into the same problem as I did: The GL_MIN_FILTER and GL_MAG_FILTER properties of the depth texture object must be set to GL_NEAREST. At least they are not allowed to be set to GL_LINEAR. Don't ask me for the reason. Otherwise you will experience the same Z-Fighting as I did.
Juli 23rd, 2010
Stange thing.. and a even stranger solution oô
Maybe that is also some driver issue (?)
Juli 23rd, 2010
My guess is that GL_DEPTH_TEXTURE_MODE is somehow unsupported by my quite old hardware (GeForce 6600 GT) since it worked for a GeForce GTX 260.