PDA

View Full Version : Render speed



wh1sp3rik
11-05-2009, 12:46 PM
Hello :)

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 ;-)

DmitryM
11-05-2009, 12:57 PM
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).

wh1sp3rik
11-05-2009, 11:31 PM
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.

DmitryM
11-06-2009, 06:34 AM
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.

V-man
11-06-2009, 06:41 AM
Should i copy ALL objects into one buffer ? and bindbuffer only once at program start ?

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.