Render speed

Hello :slight_smile:

I made few speed tests.

First test:
i used Vertex Arrays and i rendered 2376000 polygons (20 hipoly spheres) at 55 FPS.

Second test:
i used Vertex Arrays + VBO and i rendered 2376000 polygons at 430 FPS

I rendered 20 HI poly spheres and i called BindBuffer for every object.

My question is, what is fastest way to render these objects ?
Should i copy ALL objects into one buffer ? and bindbuffer only once at program start ? or is there another way ? Perhaps, how to implement shared vertices, if It’s possible, because vertices, normals, colors, UVs has different data, different amount etc.

thank you :wink:

First, consider using VAO (vertex array objects).

Second, if your spheres are the same you can try HW instancing.

Third, only those vertices can be shared what have the same data (normal, coordinate, UV, etc).
Implementation is just adding & filling the index buffer object (and calling DrawElements instead of DrawArrays).

Thanks for answer.

So, i read about it a little. VAO contains VBO’s ? I can solve bindbuffer speed.

“Third, only those vertices can be shared what have the same data (normal, coordinate, UV, etc).”

but simple cube can’t have same data … because one vertex can have 3 different normal vectors and i don’t know, if it’s good idea to average normals. it could looks bad.

VAO contains vertex attribute bindings you need.
A simple cube doesn’t need indices (sharing vertex attributes), but you are drawing spheres (which are probably smooth), so sharing is a must.

All spheres look the same, so you don’t need 20 spheres in a VBO. Just 1 is enough. Unless if you have some reason for doing it your way.