PDA

View Full Version : How can I draw the surface to only Z-buffer?



ANGEL
09-02-2000, 09:12 AM
In order to draw the surface to the depth buffer but not the color buffer,

How can I implement the effect?

Bob
09-02-2000, 12:00 PM
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.