View Full Version : Projected shadows z-fighting on ATI cards only

08-09-2006, 02:27 AM
I have users experiencing z-fighting with my multipass lights and shadows, on ATI cards only.

-glDepthMask is set to False.
-glDepthFunc is set to GL_LEQUAL
-glPolygonOffset is set to -1.0,-1.0

I can't reproduce this on an NVidia card, so I have no idea what is wrong.



08-09-2006, 03:59 AM
16 vs. 24 bit depth buffers?
Try higher polygon offset values.

08-09-2006, 12:16 PM
Are you using clip-planes and mixing with any pass not using clip-planes (for instance ambient pass)? If so, then you'll indeed get z-fighting due to the clip-plane implementation creating new geometry and you'll need a depth bias for that pass.

08-09-2006, 12:17 PM
Try not using polygon offset and draw polygons exactly in the same place in all passes. If you pass exactly the same vertex coordinates in second pass you should get exactly the same fragment depths.
This is true for stencil shadows or shadowmaps when you draw the same geometry multiple times. If you just render shadows as polygons placed on walls then you do need polygon offset.