OpenGL: Sphere Optimization
I have a 3D world that has approximately 50 spheres in it made with:
gluSphere(q,size,8,8);
and while I''ve dropped the quality of the sphere to the lowest possible value without looking like utter garbage (from 16 to 8), the performance is still much slower than I''d like. Does anyone have any ideas on how drawing all these sphere could be optimized? Such as storing the sphere so I can "paste" it repeatedly...
I believe gluSphere(...) builds up the sphere each time from scratch.
If you put the call the gluSphere(..) inside a display list, you would avoid having to build up the sphere each time, and display list are much faster at drawing objects than calling drawing the individual triangles anyway.
You ought to try making your own spheres (they aren''t that hard to generate) and then you could see exactly what''s making your code slow.
cheers
dan
Game production:
Good, quick, cheap: Choose two.
If you put the call the gluSphere(..) inside a display list, you would avoid having to build up the sphere each time, and display list are much faster at drawing objects than calling drawing the individual triangles anyway.
You ought to try making your own spheres (they aren''t that hard to generate) and then you could see exactly what''s making your code slow.
cheers
dan
Game production:
Good, quick, cheap: Choose two.
Hmm.. i just finished making the modifications so that the spheres are displayed from a list using the CallList() function. However, I''m still getting the same framerate any other ideas out there?
By the way, im not generating the Display List each frame if anyone thought i might be doing that.
By the way, im not generating the Display List each frame if anyone thought i might be doing that.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement