I need to display 480 x 320 background image in OpenGL ES. The thing is I experienced a bit of a slow down in iPhone when I use 512 x 512 texture size. So I am finding an optimum case for rendering iPhone resolution size background in OpenGL ES. How should I slice the background in this case to obtain the best possible performance? My main concern is speed. Should I go for 256 x 256 or other texture sizes here?
Share
First of all, are you testing performance on the Simulator? If so, stop immediately and try it on actual hardware. Performance testing on the simulator is worthless.
With that out of the way, I’m not sure how many of these you’ve already implemented, so I apologize if I’m giving you what you already know:
GL_CLEARcallissue, it’s hardware accelerated
Use the OES_Draw_Texture extension if you’re using
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);Beyond that, try grabbing just that segment of your code and seeing just how many background per second it’s capable of spitting out.