PDA

View Full Version : z-buffer



mast
07-31-2001, 01:01 PM
Hello,
I would like to put the z-buffer in a
mode so that the objects are ALL
drawn but they affect the z-buffer

Thanks

zed
07-31-2001, 05:00 PM
not to sure what u mean perhaps glDepthFunc( GL_ALWAYS )

mast
07-31-2001, 10:58 PM
in fact I want The objects to write in
the z-buffer in the same way that
glDepthFunc(GL_LESS) does :
only the nearer pixel write in the z-buffer
But I also want the pixels that are
supposed not to be seen(that don't write
in the z-buffer)to be drawn in the
scene.
It is for blending : I want the
the z-buffer to be always written in, but
I want it to has no effect during blending.

Sebb
07-31-2001, 11:44 PM
Hi,

You can do this in two passes. First you draw your scene with your glDepthFunc to GL_LESS but you don't draw in the frame color. To do this, use glColorMask(0, 0, 0, 0). In the second pass, you disable the depth buffer and draw with glColorMask(1, 1, 1, 1). I think it should not take much more time than drawing in one pass.

mast
08-01-2001, 01:57 AM
Yeah, very cool thank you