- Home /
Marking an object as static has no effect on batching.
In my 2d game, I mark my tilemaps as static because they don't move and I thought that it would enable Unity to batch those tilemaps for optimization purposes. But when I toggle the Stats gizmo in the Game view, there's no change in the Batches value or even the Saved by Batches value. Why is this?
Answer by xibanya · Jan 14, 2020 at 09:45 PM
Make sure to check the frame debugger, as it'll often be able to tell you exactly why something wasn't batched.
If that doesn't clear it up, post a bit more about your scene. Do the sprites share the same material? Do they share the same atlas? Are they mostly next to each other in the hierarchy? Check the shader, if you're using a billboarding sprite, it may have "DisableBatching" = "True" in its tags. Does it have instancing enabled? Batching should override instancing but it doesn't always. Does your scene have lighting and/or any shadow casting objects?
Answer by Brother_77 · Jul 11, 2021 at 06:28 AM
I came accross a thread where one of the Unity people confirm that before 2020.3 the stats window is broken regarding the batches when using URP. Now when I switched to 2020.3 there is no negative number on batches saved but it always stays on 0.
and in the frame debugger the draw calls are the same number as the objects in the scene even though they share the same material and are marked as static.
Soo confusing.
After further investigating I hope these links help anyone who is in a similar situation. The SRP batches by the shader, so draw calls might be high but it can deliver faster performance because the shader data is stored on GPU instead of constant forwarding of shader data from CPU to GPU.
https://forum.unity.com/threads/srp-batcher-and-gpu-instancing.833362/ https://catlikecoding.com/unity/tutorials/basics/measuring-performance/
Your answer
![](https://koobas.hobune.stream/wayback/20220612221449im_/https://answers.unity.com/themes/thub/images/avi.jpg)