I'm coding an OpenGL ES 1.1 app for Android and iPhone. The OpenGL ES engine lives in a shared library and is accessed via NDK on Android.
I'm looking to optimise my OpenGL performance. There's plenty of videos and resources out there, e.g.:
http://www.vizworld.com/2010/02/ngmocos-tim-omernick-optimizing-opengl-iphone/
http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Performance/Performance.html#//apple_ref/doc/uid/TP40008793-CH105
http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesforWorkingwithVertexData/TechniquesforWorkingwithVertexData.html
OpenGL ES 2.0 : Seeking VBO Performance/Optimisation Tips For Many Moving Vertices
When are VBOs faster than "simple" OpenGL primitives (glBegin())?
https://gamedev.stackexchange.com/questions/1068/opengl-optimization-tips
But generally there are well known techniques that apply universally, such as:
Some techniques are, or may be, a bit more sensitive in their specifics, and may differ between Android and iPhone, and that's what I'm interested in. For example:
So my question is: what are the finer details of the magic optimisations such as the last list above that differ between Android and iPhone? Where they differ, what is the best strategy? Just use a value that suits both worlds? (Fine-tuning such details at runtime depending on the platform might be a bit over the top?)
The major (orthodox) optimizations are mentioned in the answer. However, there some other less known techniques that are applicable to rendering on mobile devices:
The clock rate and memory bandwidth of mobile GPUs are significantly lower compared to desktop monsters. It would be wise to reduce overdraw and textures access as much as possible. Consider using CPU-level hidden surface removal algorithms and techniques.
Use vendor-specific profilers to fine tune your code for specific chips. Use different code paths if the performance varies significantly from vendor to vendor.
Once again, fillrate on mobile devices is of the essence. Use smaller data types, fewer texture fetches. This is especially true for Apple's retina display on the new iPad. Prefer calculations over texture lookups for reasonable formulas (you should profile).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With