Course contentsShow
← Unity Game Development
Lesson 733 of 82811. Performance and Data PersistenceFree lesson

Minimizing Draw Calls via Static Batching

Learners will configure static objects to combine their geometry into single draw calls, significantly reducing CPU overhead during scene rendering.

In this lesson, you will learn how to leverage static batching to consolidate multiple stationary objects into a single draw call, drastically lowering the CPU’s communication overhead with the GPU.

The Problem: CPU-GPU Bottlenecks

Every time Unity renders an object, it sends a command—a "draw call"—from the CPU to the GPU. If you have 500 individual rocks in your scene, the CPU must send 500 unique instructions. Even if the GPU is powerful enough to render the geometry instantly, the CPU becomes the bottleneck because it is overwhelmed by the sheer volume of "Draw this, now draw that" commands.

The Solution: Static Batching

Static batching is an optimization technique that instructs Unity to combine the geometry of all non-moving objects into a single mesh at build time or runtime. Because the objects are "Static"—meaning they never move, rotate, or scale—Unity can safely bake them together. Instead of sending 500 commands, Unity sends one massive command for the combined mesh, reducing your draw call count significantly.

Implementation Steps

To enable this for your environment assets:

  1. Select your GameObjects: Pick the objects in your scene that are immobile (buildings, rocks, trees).
  2. Toggle Static: In the Inspector, check the box labeled Static at the top right. For batching specifically, ensure Batching Static is enabled in the dropdown menu.
  3. Project Settings: Navigate to Edit > Project Settings > Player and ensure that the Static Batching checkbox is enabled under the "Other Settings" section.

A Note on Memory

While static batching drastically reduces CPU load, it comes with a memory cost. Because the objects are combined into one larger mesh, the memory usage increases because Unity keeps both the original individual meshes and the new, combined batch in memory. Always monitor your memory profile using the techniques we covered in lessons 19 and 20 to ensure your optimizations don't exceed your target hardware's RAM limits.

Key Takeaway: By marking immobile objects as Batching Static, you offload the CPU by collapsing numerous individual render instructions into a single, efficient draw call.