How to choose between GL_STREAM_DRAW or GL_DYNAMIC_DRAW?

lvella picture lvella · Nov 26, 2011 · Viewed 32.2k times · Source

I am using OpenGL ES 2.0, but I think it is also relevant to non-ES: how to know what "usage" to choose when creating a VBO?

This particular VBO will be used for 1 to 4 times before completely updated, and I am not sure if I must pick GL_STREAM_DRAW or GL_DYNAMIC_DRAW.

Answer

murk003 picture murk003 · Apr 11, 2014

Well, according to the OpenGL API you should use DYNAMIC_DRAW.

STREAM
You should use STREAM_DRAW when the data store contents will be modified once and used at most a few times.

STATIC
Use STATIC_DRAW when the data store contents will be modified once and used many times.

DYNAMIC
Use DYNAMIC_DRAW when the data store contents will be modified repeatedly and used many times.

Make sure to update the VBO with glBufferSubData()