Sign in to follow this  

VBO Strategies

This topic is 3294 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've never really bothered to learn VBOs (client-side vertex arrays have been fine for my purposes). But vertex arrays are deprecated in GL3, so it's time to learn VBOs. The general concept is fine, but I'm not really sure the best way to actually use them... Should I create one large VBO and stuff one (or more) objects in it at a time? many small VBOs for each object? some combination of the two? My first thought was to do lots of small ones, and let the driver handle deciding which to stick in VRAM, just like for textures. If I do skinning on the GPU, I can just load all the vertex data at the beginning and not worry about it. I don't know if this could cause problems with drivers that don't like to swap out VBOs or something like that, though.

Share this post


Link to post
Share on other sites
It's best to reduce the number of calls to GL so in order to do that, it is is best to keep many objects in one VBO and do the same for the index buffer object (IBO). You can make each VBO/IBO 1 to 4 MB which is ok for all graphic cards.

Share this post


Link to post
Share on other sites
I agree with V-man. In my engine, I keep [up to] several large IBOs and VBOs and fill each with objects that can be rendered with the same shaders. In many cases I can draw all the objects in a VBO with one glDrawElements() call, which reduces "batch" overhead to nearly zero. Actually, a clever programmer can be slightly more efficient by filling up each IBO and VBO from both ends (one end for each of two batches... and let them grow until they meet).

If you have a GL3 capable video card, you probably have plenty of video RAM to hold a large environment without drivers swapping IBOs/VBOs in and out.

Share this post


Link to post
Share on other sites

This topic is 3294 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this