Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Disable z-buufer writes

  1. #1
    Guest

    Disable z-buufer writes

    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

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Disable z-buufer writes

    glDepthMask(GL_FALSE) will disable depth writes.
    glDisable(GL_DEPTH_TEST) will disable depth writes and depth testing.

  3. #3
    Guest

    Re: Disable z-buufer writes

    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

  4. #4
    Guest

    Re: Disable z-buufer writes

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •