Sharing VBO with multiple objects and fixed size buffer data

Posted by Mark Ingram on Game Development See other posts from Game Development or by Mark Ingram
Published on 2012-09-03T20:21:59Z Indexed on 2012/09/03 21:49 UTC
Read the original article Hit count: 291

Filed under:
|
|

I'm just messing around with OpenGL and getting some basic structures in place and my first attempt resulted in each SceneObject class (just contains vertex information right now) having it's own VBO inside it, however I've read that it might be better to share VBOs across multiple objects.

Also, I read that you should avoid resizing a VBO (repeated calls to glBufferData with different size parameters), and instead choose a fixed size for a VBO, and just try a range from the buffer. I don't think changing the size of the buffer data would happen too often, but surely it would be better to only allocate the data you need? Choosing an arbitrary value seems risky.

I'm looking for some advice on working with individual objects in a scene and their associated buffer data.

© Game Development or respective owner

Related posts about opengl

Related posts about engine