Hello,
We recently bought unity PRO with android addon and migrated our project from Unity 3.5.
I wanted to test static batching and I get strange results. I’m testing my scene on Samsung Galaxy S2. When I mark my asteroids as static I get 40 FPS. When they’re not static its steady 60+ FPS. The docs say that static batching may introduce some memory overhead (it does indeed) - but other than that there are no guidelines regarding performance hits. Maybe I’m doing something wrong ?
Maybe someone could explain what might be the problem? When should we use static batching and when it should be avoided ?
I’m attaching screenshots from unity editor with and without static batching (on PC there is no difference in FPS, but other stats might be useful). On the second one asteroids are static.
Thanks in advance.
I’m adding some profiler screenshots (profiler was connected to the sgs2 phone). You can clearly see that with static flag MeshRenderer.RenderStaticBatch is my bottleneck.
Is it a feature or a bug ? If it’s a feature than how can we avoid it ?
One more thing - my level is quite large - we are using scale where 1 unit = 1 meter. With this kind of content my far clip plane is set to 160000 (160 Km) - can this be causing such overhead in static batching ?
Are your asteroids moving or rotating at all? That’s when I’ve seen static batching cause slowdowns, when moving things were set to static (it basically made Unity re-batch the static objects every frame).
I’m afraid not. They’re not moving nor rotating.
It’s kind of strange - I haven’t read anywhere in the docs, forums etc. that static batching can be slower in some cases than no batching at all.
It seems to be a bug in Unity Android. I get the same results than yours, and this behaviour doesn’t happen on iOS, so it seems to be only on Android. I posted a bug, but I got no answer yet. I hope they will fix this, it’s destroying performance on Android.
well, we have finite amount of qa you know, so not all bugs are processed immediately ;-). No worries, i’m looking into it (note to everyone: you better post case number instead of the link, AND you better post case number instead of simple “bug posted” ;-))
ok, it seems the issue is identified and fixed (crosses fingers). At least i can see 10x speed up locally on galaxy nexus (i just grabbed first device ;-))
so, i’ll check in more devices and pass down to qa. Just so you know that fix is in the pipeline (and as we are doing fast-releases now, should be pretty soon [but not in 4.1 as it is a bit late for this release])
so stay tuned and check release notes
Sorry, didn’t want to sound like I was angry, haha. Thanks Alexey for the support, now we’ll really see what kind of graphics the nexus 10 is able to output