PDA

View Full Version : Disable z-buufer writes



09-29-2000, 05:00 PM
How do you disable z-buffer writes and still have the z-buffer enabled?

I know this is a simple question but I can't seem to find the information, is it possible?

Thank Mike

DFrey
09-29-2000, 05:09 PM
glDepthMask(GL_FALSE) will disable depth writes.
glDisable(GL_DEPTH_TEST) will disable depth writes and depth testing.

10-02-2000, 04:14 AM
This function call glDepthMask(GL_FALSE) dosen't seem to work on my TNT 2.

GL_DEPTH_TEST is enabled for the whole program. I draw my scene with depth writes enabled then I disable depth writes and draw the blended flares. I get horribe errors all over the screen, before without disabling z-buffer writes it worked but the first drawn flare could stop the later drawn flares behind it from being seen (because z-buffer stops it). I could sort them in depth order but can't understand why this dosen't work.

Thank Mike

10-02-2000, 04:33 AM
Just fixed the problem.

First thing I did was clear the screen and the z-buffer afterwards enabling depth writes. So it was disabled when the operation clear buffers was started.

DOH!!

Mike