Rendering of spheres

posted Aug 21, 2012, 12:12 PM by Nico Kruithof
There are different ways to render spheres using OpenGL. I made four implementations based on OpenSceneGraph. Each sphere is composed of 800 quads that are stored in Quad strips (40 segments by 20 rows).

Performance is measured on a laptop, with an Intel core 2 duo, 2GHz and a GeForce 9600M GT.
  1. Using osg::ShapeDrawables (an easy way to draw spheres for debugging purposes in OpenSceneGraph)
    1000 spheres @ 40 fps
  2. Renders a scene composed of a group node containing a transform and shared geometry for every sphere.
    1000 spheres @ 43 fps
  3. Renders a scene composed of one node with appropriately translated and scaled spheres
    1000 spheres @ 44.5 fps
  4. Renders a scene composed of one sphere that is rendered using GPU instancing.
    1000 spheres @ 60 fps (limited)
    10.000 spheres @ 8.3 fps
In all cases, one of the biggest bottlenecks is the GPU, so I should run the tests on a computer with a faster graphics card to see the difference. The test applications are attached.
Nico Kruithof,
Aug 21, 2012, 12:12 PM