I have a level in my 2.5D platformer that is having poor performance on Ipad3. The game is basically a player character that fights waves of enemies. I have the data from the iphone profiler below comparing a level that is running nicely compared to the problem level, Level A and B respectively. Both levels use the Mobile/Particle/Alpha Blended shader as a transparent shader, and a mobile/diffuse shader for the background. There are overlapping shaders in both levels, I read this could be an issue. I am confused why I am getting poor performance on one level because these levels are very similar, Level B is slightly more complex but the performance is unplayable. The weird thing is that even without any enemies spawning, in Level B the performance is still way more jittery than Level A, and Level A has enemies spawning! What could be causing this? Not sure if it is code or texture/shader/geometry. Here is the data:
LEVEL A
Textures/Shaders:
13 Mobile/Particle/Alpha Blended shaders, with textures ranging from 256 to 512, with one 1024.
1 Mobile/Diffuse 2048
All textures are compressed for Iphone
LEVEL A - With Enemies running nicely
iPhone Unity internal profiler stats:
cpu-player> min: 12.4 max: 17.3 avg: 13.8
cpu-ogles-drv> min: 1.9 max: 2.6 avg: 2.1
frametime> min: 32.5 max: 34.2 avg: 33.3
draw-call #> min: 32 max: 32 avg: 32 | batched: 4
tris #> min: 9522 max: 9528 avg: 9524 | batched: 960
verts #> min: 10280 max: 10292 avg: 10285 | batched: 484
player-detail> physx: 4.8 animation: 0.6 culling 0.0 skinning: 2.8 batching: 0.2 render: 2.1 fixed-update-count: 3 … 4
mono-scripts> update: 2.1 fixedUpdate: 0.0 coroutines: 0.1
mono-memory> used heap: 458752 allocated heap: 487424 max number of collections: 4 collection total duration: 10.2
LEVEL B
Textures/Shaders:
15 Mobile/Particle/Alpha Blended shaders, with textures ranging from 256 to 512, with TWO 1024.
1 Mobile/Diffuse 2048
All textures are compressed for Iphone
LEVEL B - No Enemies (Running poorly/jittery)
iPhone Unity internal profiler stats:
cpu-player> min: 45.2 max: 56.7 avg: 51.1
cpu-ogles-drv> min: 0.9 max: 1.3 avg: 1.0
frametime> min: 48.5 max: 60.8 avg: 54.7
draw-call #> min: 24 max: 24 avg: 24 | batched: 6
tris #> min: 4486 max: 4494 avg: 4489 | batched: 1440
verts #> min: 3309 max: 3325 avg: 3315 | batched: 726
player-detail> physx: 46.9 animation: 0.2 culling 0.0 skinning: 0.3 batching: 0.3 render: 1.2 fixed-update-count: 5 … 6
mono-scripts> update: 0.8 fixedUpdate: 0.0 coroutines: 0.1
mono-memory> used heap: 344064 allocated heap: 487424 max number of collections: 75 collection total duration: 153.1
→ applicationWillResignActive()
→ applicationDidEnterBackground()
LEVEL B - With Enemies (Unplayable)