Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Better to create new VBOs or just swap the data? (OpenGL)

So in a OpenGL rendering application, is it usually better to create and maintain a vertex buffer throughout the life of an application and just swap out the data every frame with glBufferData, or is it better to just delete the VBO and recreate it every frame?

Intuition tells me it's better to swap out data, but a few sample programs I've seen does the latter, so I'm kind of confused.

I read Nvidia's whitepaper on VBOs, but as I'm a newbie to opengl, it didn't make a whole lot of sense.

Thanks in advance for and advice

like image 213
Xzhsh Avatar asked Jul 30 '10 21:07

Xzhsh


1 Answers

Since you're generating a whole new set of data each frame the documentation seems to indicate that GL_STREAM_DRAW is the Right Way to go about things.

like image 86
genpfault Avatar answered Oct 22 '22 22:10

genpfault