I forgot to go into details in the vmk on the differences in the buffer usage hint you can specify when creating your vertex arrays. Have a read through the OpenGL spec for details but to summarize:Buffer Usage Hints
The usage parameter allows OpenGL to choose different strategies for storing the buffer depending on how your application intends to use the data. Each call to the glBufferData function provides a usage hint as the last parameter, and passing GL_STATIC_DRAW tells OpenGL that the contents of both buffers are never expected to change. This gives OpenGL more opportunities to optimize how and where the data is stored.
Other use cases:
- GL_STATIC_DRAW should be used for vertex data that is specified once and never changes. Your application should create the vertex buffer during initialization and use them until they are no longer needed.
- GL_DYNAMIC_DRAW should be used when data stored in the buffer may change during the rendering loop. Your application should still initialize these buffers during initialization, and update the data as needed by calling the glBufferSubData function.
- GL_STREAM_DRAW is used when your application needs to create transient geometry that is rendered a small number of times and then discarded. This is most useful when your application must dynamically calculate new vertex data every frame and you perform the calculations inside the shader. Typically, if your application is using stream drawing, you want to create two different buffers; while OpenGL is drawing using the contents of one buffer, your application is filling the other.
If different attributes inside your vertex format require different usage patterns, split the vertex data into multiple structures, and allocate a separate vertex buffer object for each collection of attributes that share common usage characteristics. For example store position and color data in separate buffers. Vertex positions could be stored using GL_STATIC_DRAW and and the color buffer using the GL_DYNAMIC_DRAW hint. Then during run time you can modify the color on the fly and OpenGL will allocate that buffer so that your application maintains reasonable performance.
NOTE: In the example shown in the vmk, I don't actual change any data stored in the vertex array during run time so that is why I use GL_STATIC_DRAW.