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 2 of 2

Thread: How can I draw the surface to only Z-buffer?

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Manchester,England
    Posts
    1

    How can I draw the surface to only Z-buffer?

    In order to draw the surface to the depth buffer but not the color buffer,

    How can I implement the effect?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: How can I draw the surface to only Z-buffer?

    With glColorMask(r, g, b, a), where r, g, b and a is a boolean value (GL_TRUE or GL_FALSE). If r is GL_FALSE, then no red colorcomponents will be drawn, if g is GL_FALSE, green wont be drawn... and so on.

    So calling glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE) will disable ALL writings to the framebuffer.

Posting Permissions

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