Various code from the book "Interactive Computer Graphics: A top-down approach with shader-based OpenGL"