glDisable( GL_DEPTH_TEST ) vs glDepthFunc( GL_ALWAYS )

Started by
2 comments, last by HellRaiZer 17 years, 8 months ago
Is there a functional difference between glDisable( GL_DEPTH_TEST ) and glEnable( GL_DEPTH_TEST ) + glDepthFunc( GL_ALWAYS )? Is it safe to assume there is no overhead incurred by a depth func of GL_ALWAYS?
Advertisement
glDepthTest(GL_ALWAYS) still writes to the depth buffer if the depth mask allows, while glDisable(GL_DEPTH_TEST) completely disables anything related to the depth buffer. If you intend to disable the depth buffer, then disable the depth test. Not something else.
Brother Bob - are you sure? AFAIK, glDisable(GL_DEPTH_TEST) does not disable writing, that has to be done via glDepthMask(false)...
glEnable, glDisable

Quote:
GL_DEPTH_TEST
If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non- zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRange.


HellRaiZer
HellRaiZer

This topic is closed to new replies.

Advertisement