Write Image To Depth Buffer

From OpenGL.org
Revision as of 00:02, 27 April 2011 by V-man (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Use the glDrawPixels() command, with the format parameter set to GL_DEPTH_COMPONENT. You may want to mask off the color buffer when you do this, with a call to glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); .

You can read about depth buffer precision at http://www.opengl.org/wiki/Common_Mistakes#Depth_Buffer_Precision