First of all, do you test performance on the Simulator? If so, stop immediately and try on real hardware. Testing performance on a simulator is futile.
From this point of view, Iβm not sure how many of them you have already implemented, so I apologize if I give you what you already know:
- If you draw a full-screen opaque background for each frame, you may not need to call
GL_CLEAR- gmaclachlan indicates that you should flush the buffers every time you start for performance reasons, however this is contrary to some other users. This may vary between hardware and iOS versions; however, performance can only be verified by commenting out a line. Check before and after.
- If you use the Z axis at all (i.e. 3D objects on a 2D background, think of New Super Mario Bros), you will want to clear the depth buffer
- Use texture compression (PVRTC) if compression artifacts are not a problem, hardware acceleration
- Use a 16-bit background texture if you cannot use PVRTC
- Make sure you're not trying to do a depth / alpha mix check if nothing is there
Use the OES_Draw_Texture extension if you use a fixed function
int rect[4] = {0, 0, 480, 320};
glBindTexture(GL_TEXTURE_2D, texBackground);
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, rect);
glDrawTexiOES(0, 0, z, 480, 320);
In addition, try to capture only this code segment and see how much background per second it can spit out.
source share