When and when not to use VBOs

Hey

I feel like I’m asking questions in excess at this point, so sorry in advance, but:

When drawing dynamic entities, like models loaded from an external file with animations, is it still best to create a VBO every frame?? I would have thought the overhead to be greater than the overhead for immediate rendering.

What if I’m just rendering a simple cube which moves quickly around the scene? That would involve creating a VBO almost every frame just for 24 vertices. It just doesn’t seem worth it.

Performance wise, what should I use and when?

You don’t need to create a VBO every frame, you would just leave a dynamic draw hint and update the VBO’s existing data every frame.

To give some code to ForseenParadox’s answer, [icode]glBufferSubData()[/icode] will let you update the vertices within the VBO.

You will also want to use larger vbos than just 24 vertices. That’s why you have chunks in voxel engines. You don’t have a ridiculous number of VBOs, and you only have to rebuild that chunk if a block changes.

Ah, I didn’t realise you could just update them 0.0

Thanks.