In Review

In this tutorial, you have learned the following:

Further Study

Play around with the world space tutorials in the following ways:

  • In the World Space tutorial, we use 3 matrices. This requires an extra matrix multiply, which is a wasteful per-vertex cost. Fold the camera matrix into the perspective transformation matrix, so that only two matrices are used. Any time parameters change to one matrix, make sure to recompute both and combine them together before uploading the combined world-to-clip-space matrix.

  • Instead of folding the world-to-camera transform into the perspective matrix, fold it into the model-to-world matrix instead. Simply push it onto the same stack as everything else. The function MatrixStack::ApplyMatrix can right-multiply an arbitrary matrix with the current matrix.

OpenGL Functions of Note

glGetUniformBlockIndex

Retrieves the uniform block index for a particular uniform block name from a program.

glUniformBlockBinding

Sets the uniform buffer binding index used by a particular uniform block in a given program.

glBindBufferRange

Binds a buffer object to a particular indexed location, as well as binding it to the given. When used with GL_UNIFORM_BUFFER, it binds the buffer object to a particular uniform buffer binding point. It has range parameters that can be used to effectively bind part of the buffer object to an indexed location.