iPhone Camera.Render is slow on Profiler

Hi!

I’m making a 2D game for iPhone with Unity3D and SpriteManager2.

When I launch the game on my iPhone 4, the FPS is very slow, and the profiler shows me some strange values:

  • the Camera.Render needs more than 100ms to do its job every frame ;
  • sometimes, Camera.Render needs only 7-8ms, but the Device.Present needs more 100ms.

If I understand, Device.Present is just indicated that CPU is waiting for GPU, but is it normal that CPU waits more than 100ms?

Does anyone have any idea?

Thank you!

apply these steps:
if you have moveable character then use lightprobs:
bake scene:
use occlusion culling:
then turned off lights after baking. you will see big difference :slight_smile:

unity3diy

The problem was the bad use of the shader.

I see some tutorial using SpriteManager with “Transparent/Vertex Colored”, but it’s very slow for iPhone (and I don’t know why, Device.Present needs more time, maybe a problem with the video bus, or something else).

So I used the speed shader of Unity like “Mobile/Particles/Alpha Blended” and it ran better (I won 20FPS).

I also optimized the batch render of Sprite Manager and reduce the culling by deactivate somes Game Object not on screen (I won 3ms by frame).

At the end, I didn’t need “Good” Quality Settings, so I changed it to “Fastest”, but I kept “Texture Quality” on “Full Res”.

Some people said to change “Script Call Optimization” (Player Settings on iOS) from “Slow and Safe” to “Fast but no Exceptions” but it maked my application crashed. I will look for this problem later.

With all of that, my game run at 30fps on iPhone 4, iPad 1 and 2, and ~25fps on iPhone 3GS.

Now I’m trying to reduce the Game Object count (I have 2400~5000 by level).