In Review

In this tutorial, you have learned about the following:

OpenGL Functions of Note

glGenVertexArrays/glDeleteVertexArrays

Creates/destroys one or more vertex array objects.

glBindVertexArray

Binds a vertex array object to the GL_VERTEX_ARRAY target.

glDrawElements

Performs indexed rendering with the currently bound GL_ELEMENT_ARRAY_BUFFER (provided via the VAO) and the current attribute arrays.

glDrawElementsBaseVertex

Performs indexed rendering as glDrawElements, except that each element index is offset by a constant value before performing the array lookup. This is useful for minimizing the number of buffer object binds performed in a program.

glEnable/glDisable(GL_DEPTH_TEST)

Enables/disables the per-fragment depth test. If the depth test is enabled, then the result of applying the depth function, set by glDepthFunc, to the incoming fragment's depth and the destination pixel's depth will determine if the incoming fragment is written or not.

glDepthMask

Sets or unsets the writing of values to the depth buffer.

glDepthFunc

Sets the depth comparison function for depth testing. Has no effect if GL_DEPTH_TEST is not enabled.

glDepthRange

Sets the mapping between NDC space and window space for the Z coordinate of the position. The XY counterpart to this function is glViewport. The range for the window-space depth must be [0, 1], though the near does not have to be less than the far. The range zNear value, the first value, is the window-space value that will map to -1 in NDC space. The range zFar is the window-space value that maps to +1 in NDC space.

glClearDepth

Sets the clear depth value. This is the value that the depth buffer will be cleared to when calling glClear with the GL_DEPTH_BUFFER_BIT bit set.

glEnable/glDisable(GL_DEPTH_CLAMP)

Enables/disables depth clamping behavior. When enabled, clipping is deactivated, and any fragments that an object would render that are outside of the [-1, 1] range in NDC space are clamped to this range.

Fork me on GitHub