PDA

View Full Version : Rendering Without Changing Depth Buffer (OpenGL)



Lster
January 5th, 2008, 09:36 PM
Hi

There may well not be any way I can do this, I certainly haven't found one, but here goes anyway! I would like a way to render an object using depth testing but not altering the depth buffer. Alternately, being able to render to just the depth buffer would be OK (without rendering to the color buffer).

Is there a way to do either of these things?

Thanks
Lster

Auria
January 5th, 2008, 10:12 PM
Yes it is possible:


glDepthMask(GL_FALSE);


http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html

Lster
January 5th, 2008, 10:43 PM
Perfect - Thank you! :)