开发者

iPhone OpenGL ES: What is the fastest texture mode?

So I've been working on an iPhone 3D game, at the usual 320x480 resolution (not retina).

I've been testing its performance using instruments, and it reports that renderer utilization % is at 64%, whereas tiler utilization% is at a low 9%. Which means that the performance hit is related to textures, blending etc.

The next thing I tried was to remove all the drawings, except for the skybox. Rendering the skybox alone made the renderer % jump to 40% from the menu screen, which was at 20%.

What could be happening? I tried disabling GL_BLEND, and set GL_NEAREST to the texture mag filters, but the renderer % is still pretty bad.

I tried turning on retina displa开发者_高级运维y (four times the resolution) and the frame rate just bombed.

What other things could be done to reduce the renderer overhead? I suppose there must be something, considering RAGE for iPhone runs at 60fps at retina resolution (I haven't confirmed that, actually).


What is the color depth of your textures? In many cases the depth of 32 bits could be easily reduced to 16 (from 8888 format to 4444) without considerable quality loss. And of course the 'fastest' textures are pvrtc. Also, don't forget about texture atlases.

First of all all this tweaks will significantly reduce memory consumption, but this is only the first advantage. The second advantage is that compressed textures need less bandwidth and that's why they will be transfered faster from memory to the GPU (as the result texture sampling would be mush faster). The third advantage is that small textures can fit into the cache and be reused faster.

However, as Brad Larson said, you'd better run OpenGL ES Analyzer and see what it says.


Use 16-bit framebuffer, if you don't need alpha reads. Disable alpha testing and alphablending. Don't forget to disable lighting and z-buffer testing if you don't need it. When starting a new frame, always clear the framebuffer/zbuffer and/or make sure you are overwriting it completely without alpha blending and testing when drawing skybox or background. Use mipmapping, but not trilinear if you are shrinking textures below their original size. You can try to disable bilinear filtering. Usually it's free, but when doing texture minification without mipmapping, it (probably) can be somewhat slower. Use 16-bit or PVR compressed format for textures. Don't even consider other compressed formats, they are not really supported by hardware. Don't switch textures frequently, try to put everything into texture atlas(es). Also, naive NSTimer-based screen update method may be not optimal. I heard that some apps, such as iPhone Doom port, are doing rendering in separate thread.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜