I have a scene into which I load several things, among which was 100 gluSphere() object that used a common gluQuadric instance and each had 32 stacks and 32 slices. This scene would render horrendously slow … and according to the NetBeans profiler, the drawing of these spheres was the main cause. In particular the ‘sin()’ and ‘cos()’ calculations accounted for about 50% of the effort and the other thing was called ‘Self time’ according to the netbeans profiler.
Is there a quicker/better way to draw gluQuadrics ? I’m suprised at the performance hit I took when I tried to draw 100 spheres even though I was sharing the gluQuadric object instead of creating a new one each time…I create it once at init() and then I just call gluSphere() during the display method.
Just to add a little perspective, in Java3D I had a scene with around 2000 spheres and I was nowhere near the poor frame rates that I was in this case which is why I’m surprised. I know in Java3D that the geometry was shared so that was a speedup and I figured by having only one instance of the gluQuadric for the sphere would be a similar geometry sharing…heck, I’m ignorant on this topic so any help would be appreciated - I don’t even know if and when to delete a gluQuadric instance so I don’t.