glDepthFunc
glDepthFunc is an OpenGL function that specifies the depth comparison function used during the depth test in fragment processing. The depth test compares the depth value of incoming fragments with the value stored in the depth buffer to determine visibility.
Prototype: void glDepthFunc(GLenum func). It sets the function used by the depth test for subsequent draw calls.
Supported comparison functions include: GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS. For example, GL_LESS keeps
Default behavior is GL_LESS in most OpenGL contexts, meaning nearer fragments overwrite farther ones. Depth writes
Notes: The depth buffer must be present and the depth test enabled for glDepthFunc to have an
See also glEnable, glDisable, GL_DEPTH_TEST, glDepthMask, glClear.