Hello Guest

Author Topic: Performance on ipod4  (Read 4105 times)

omerm

  • Newbie
  • *
  • Posts: 4
    • View Profile
Performance on ipod4
« on: January 27, 2014, 02:15:48 pm »
Hi. I'm getting quite a performance hit running my game on iPod4. I have ~160 draw calls, and the profiler shows that 261 have been batched. My fps hovers around the 10-15 mark, profiler shows that a lot of cpu time is getting eaten up by MeshRenderer.Render and MeshRenderer.RenderDynamicBatch. I'm using the BlendVertexColor shader. I've read on some forums that for an ipod 4, around 80 draw calls are optimal. The question I have is that I'm porting the game from cocos2d, and that game had no batching whatsover: the same scene had ~400 draw calls in cocos2d yet average fps was around 20-25. Is the problem purely with the number of draw calls? Because I can't create bigger atlases to increase dynamic batching since I'm already running in memory problems on ipod4, ipad1. Thanks!

omerm

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Performance on ipod4
« Reply #1 on: January 27, 2014, 02:24:07 pm »
More info: I have two cameras in my scene, one for rendering UI, and another for the game view (it's a 2d game a la Clash of Clans). Cameras are at different depths, the UI camera has depth 1 and the Game Camera has depth 0. Clear flags for both are set to depth. The near and far clipping plane values for both cameras are pretty large (-1000 to 1000 for the game camera, does this impact performance?). A lot of the stuff in the game scene is non-uniformly scaled, with z scale being 1 always and x and y scales being the same. Also there are around 50 animated sprites in this scene. The UI and Game are in different layers
« Last Edit: January 27, 2014, 02:28:53 pm by omerm »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Performance on ipod4
« Reply #2 on: January 27, 2014, 02:59:44 pm »
It is likely the draw calls that are causing the issue. Its pointless comparing draw calls between engines, as could do things very differently. In this case its probably the draw calls.

How are you non-uniformly scaling things? Are you using sprite.scale or transform.localScale?

omerm

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Performance on ipod4
« Reply #3 on: January 28, 2014, 04:31:28 am »
Thanks for the reply! Using transform.localScale, cause the sprites' transforms have children that also need to be scaled. Resetting the scale to one seemed to help a bit, I'll try using sprite.scale and recursively scale all children to see if it makes a difference.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Performance on ipod4
« Reply #4 on: January 28, 2014, 10:34:44 am »
Before you spend a ton of time testing that, just write a script to reset the scales or make them uniform. See if you get the performance you want there.