I would like to ask for your advice about the possibility of fast rendering of large number of dynamic objects. I make some 3d scene with about 100.000 triangles, which positions change every frame. glBegin/glEnd is very slow for this case (near 20 fps), vbo is more optimal for static objects if I understood correctly (it gave me just lower number of fps). Experiments with mesh example from oF didn’t help me too. So question is - what is the most optimal type of high polygon objects rendering with every frame positions update?
There are no simple answer to this, because there many variables involved but I think one option could be do geometry instancing. see this for example: http://www.geeks3d.com/20100210/opengl-3-2-geometry-instanci993S3TRK8Ung-culling-on-gpu-demo/ but this require opengl3.2, , you can increase performance also with a culling and LOD method like here :http://rastergrid.com/blog/2010/10/gpu-based-dynamic-geometry-lod/#more-428 but also this require advanced OpenGL. Never tried this in OF so i can’t say it is possible or not. but i can say that i’m working on something similar and maybe i can help on this in a future. Let me know if this advice you or not.
p.s i remember that some one else has tried geometry instancing but i can’t find any post or info…
Thank you, kalwalt!
I will try your advice. Now I’m using geometry shaders and have good performance.
VBO is definitely faster, particularly if you have a fixed number of points (i.e. a single object) and you’re updating all those points every frame. Geometry shaders are generally slow and unless you’re adding or removing new points from a specific object every frame (fire, grass blowing in wind, particle emission, that kind of thing) they’re usually not worth the trouble. I love the idea of geometry shaders a lot, but I haven’t had great luck with getting them to be faster than a VBO