I've spent the day trying to understand the use of VBO since i want to boost the FPS in my game.
However i'm having some trouble understanding the life-scope of the VBO and how to properly use it. Every sample code and tutorial i've found has shown a single static scene to render and I've got a pretty complex file architecture in my game.
So this literally just occurred to me.
If a VBO behaves kind of like a texture (you generate and bind it) would i be correct to say that each entity in the game should hold it's own VBO?
For example; my player character would create a VBO at runtime and then call a render-function which fills it with data and renders it?
The render code would take the VBO, texture and some placement information. Then my normal code would run (bind the texture, create a clip for the 2D image) then I create a new vertex buffer and a new texture buffer and bind them. Lastly the VBO should be bound and rendered.
A NPC would have it's own VBO just like the player does.
Am i thinking right? And even if i am, could you be so kind to explain the scope and use of a VBO? Like i said, all the examples just handled a static scene to render so i'm having trouble understanding how to update it.
My game is in 2D and currently renders everything as quads or circles (all collision is done with rectangles). The size of an object is never changed after creation. When an object animates it'll change the location of the clip within it's loaded imagesheet. So the image itself will rarely change.
I'm kind of tired at the moment so i hope i made myself clear enough for you to understand.
Looking forward to some answer, thanks in advance!
Edited by Tallkotten, 19 May 2013 - 01:17 PM.