PDA

View Full Version : Single large VBO vs multiple VBO with switching



Lord Ciriuz
10-16-2008, 08:49 AM
Hi!

I am trying to realize what is better in terms of performance: a single huge VBO, with the data being managed using some sort of memory manager; or several VBOs doing switching between them at render time.

This is my current process (switching between VBO at render time):

1) if it's the first use of the VBO, creates it with glGenBuffersARB(), binds it with glBindBufferARB() and fills it with glBufferDataARB().
2) else, just binds it.
3) draw()

I do the same thing for every VBO in the scene.

My question is if I could improve performance using one large VBO with some king of management agains using several VBOs.

Thanks in advance

aqnuep
10-17-2008, 04:11 AM
It depends on opengl driver because as I know on NVIDIA cards using one large VBO decreases performance in most of the cases. In the case of ATI using huge VBOs performs better, but only a little because you only skip the VBO switches which are lightweight operations. In the case that many objects can be batched together, using one huge VBO for all geometry can improve performance a lot on ATI cards. Probably with this improved batching the performance is also increased on NVIDIA cards.

Lord Ciriuz
10-17-2008, 06:09 AM
Yes. I agree with you. I am trying to build a mid size VBO with an IBO per shader combination in order to do geometry batching.

I read on gamedev that some people do a kind of memory manager for managing a VBO using a fixed slot size. I am going to test this method using glBufferSubDataARB() for replacing data into the VBO.

Ir order to improve geometry batching, I will use several texture atlas, one per each kind of map (diffuse, normal, ...).

Also I am thinking about passing several transformation matrices, one per each dynamic object in the batch, in order to draw them all in the same draw call. I am doing some research about it.

Finally, I need a way to pass uniform variables per object in the batch. I am going to use lookup tables for static values. I dont know how to pass dynamic values yet.

Is anybody doing something like that? ;)

thanks!