I just tried to build game for iPhone 4 resolution with Unity 3, and notice a significant performance decrease. Can some confirm if the impact is normal to your games?
My game runs at 45+ fps on iPhone 3GS, and above 50fps on iPhone 4 with standard resolution (480*320). The problem only occurs when I apply the HD resolution to iPhone 4.
On old unity iphone 1.7 the stats shows it has 16 draw calls, 2.5k tris, 1.7verts and about 15m texture when the game is running. On unity 3 the stats looks different but I believe it behaves the same way.
What is the cause of the performance decrement? Is it normal that you lose 30fps when you switch to the double resolution?
The lose is normal if you used blending (normal and/or alpha) in your materials. in this case you overdraw pixels that were previously there already which will eat the full fillrate you have available in no time.
doing this is a bit of a problem as the 3GS gpu (which is used in the iphone 4, ipad, itouch 4th gen too) can only redraw the iphone 4 screen about 3 times per frame to remain within the fluid FPS range. Redraw means “drawing the amount of pixels the screen has again”
Among the major reasons for taking such a performance hit, you can find things as particles where a single badly designed emitter on its own can exceed the fillrate available.
At that very moment the FPS will drop significantly as the pixels per second the gpu can render is a fixed number. the more you try to push per frame, the less frames you get.
The big issue with the larger resolution iOS devices (as Dreamora correctly states in the other thread) is Alpha textures. The amount they slow the GPU down is nothing short of incredible.
I was stuggling to make my current game work at a reasonable frame-rate at standard resolution a few weeks ago (lots of physics, 20k ish polygons, full screen effects), but after Rej told me to make “as little alpha as possible”, I went back through the level and streamlined my shader use, and it now runs at nearing 60 fps on standard resolution on both the 3GS and the iPhone 4.
It still struggles at full res on iPhone 4, though - and due to the nature of the game, I’m not sure I’ll ever get over that, but really - drop as much alpha as you can, and you’ll see MASSIVE speed increases.
Other tips - if you don’t have any lighting on the level, write a new diffuse shader that removes the colour aspect of the shader. It’s an extra bit of GPU use you really don’t need. If that still isn’t enough, if you use it, turn off fog - that’s expensive too.
If you do all of that, you might just see the increase you’re after.
I had performance problems too when porting one of my games to retina and iPad displays. I solved these problems by using more performant shaders (thanks Jessy!), and caching all gameobject and transform objects.