Static batching not working as expected

Hi there !

I’m working on a mobile game, and i’m experiencing some strange issue with the static batching.
I have some prefabs with a lot of little objets inside it, with the static batching checkbox ticked. Sometimes it works fine and I have only one draw call, and sometimes (when i move the camera) more than 20 draw calls.

I don’t understand, i have only one texture and one material for the scene.

One draw call :

20 draw calls :

Your help would be greatly appreciated :slight_smile: !

Up

Do the draw calls go up in play mode in the editor or just on the target device?

A bug report with a repro project would be appreciated:
http://unity3d.com/BugReportingFAQ

Ok, doesn’t seem to occur when built on a mobile device (Android, HTC One X), but on a pc build the number of draw calls is increasing when the camera is zooming out.

1093170–41058–$batching.zip (4.22 MB)

Here’s a test project. I will submit a bug report too.

Thanks. I checked that it draws the scene with one draw call in Unity 4, but 3.5.6 has more calls than expected. We’ll check out the bug report.

It turns out that 3.5.6 breaks batches around the shadow distance, even with shadows disabled. We fixed that in 4.0 but apparently not 3.5.6. Mobile builds are not affected.

A workaround is to set the Shadow Distance in Quality settings to either zero or some large value.