I'm using OpenGL with JOGL. My project is getting sort of slow. I'm new to OpenGL. What are some of the best ways to optimize it? What are some good tools to profile? (I'm using Eclipse.)
I recently switched from using one static Texture object for a whole bunch of models, to each one having its own Texture object. This appeared to slow it down.
Other ideas to optimize:
- Avoid using trig in the update call to simulate the moon's orbit
- Using more with display lists
- Sort models by texture to reduce texture switching
- Sort models by rotation to avoid rotation matrices
- Sort models by [characteristic X] to avoid [operation Y]
What are some common problematic values of X and Y above?
It seems like display lists help performance. What can I do in display lists? Is there anything that must be done at draw-time, or can it all be precomputed?
Being new to OpenGL, I don't have a great instinct for what to do here.