Search code examples
javaopenglbufferlwjgl

OpenGL Updating static VBO


I just tried updating a Vertex Buffer Object (vbo) which has data with static draw in it. Why can I update it with glBufferSubData? I always thought static vbo's can't be changed.


Solution

  • GL_STATIC_DRAW does not mean that the data can't be changed. The usage parameter of glBufferData is a hint for the underlying implementation and might allow some performance improvements, but it does not constrain the actual usage. The documentation states:

    usage is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.