Course contentsShow
← Unreal Engine Game Development
Lesson 782 of 88011. Performance Profiling and OptimizationFree lesson

Reducing Draw Call Counts via Batching

Minimize draw thread bottlenecks by grouping static meshes and utilizing instanced rendering techniques to reduce the total draw call count.

In this lesson, you will learn how to minimize draw thread bottlenecks by grouping static meshes and utilizing instanced rendering to keep your GPU fed efficiently.

The Draw Call Bottleneck

Every time the CPU tells the GPU to draw an object, a "draw call" is issued. If you have a scene with a thousand individual rocks, the CPU spends an enormous amount of time preparing those thousand separate commands. This creates a bottleneck on the Render Thread, often resulting in a frame rate drop even if your GPU is technically powerful enough to handle the geometry. To solve this, we must reduce the number of individual communications between the CPU and GPU.

Batching vs. Instancing

Batching and Instancing are your two primary weapons for reducing this overhead:

  1. Static Mesh Batching: Unreal Engine automatically attempts to batch static actors using the same material into a single draw call, provided they are marked as Static. Ensure your assets share materials and textures; changing a material on a single mesh forces the engine to break the batch, creating a new draw call.
  2. Instanced Rendering: If you have many identical objects (like grass, trees, or debris), do not place individual AStaticMeshActor instances. Instead, use an UInstancedStaticMeshComponent (or UHierarchicalInstancedStaticMeshComponent). This allows the CPU to send a single "draw" command for the mesh, followed by a list of transform data (position, rotation, scale) for every instance.

For example, when spawning a field of foliage:

// Instead of spawning 1000 individual StaticMeshActors:
UHierarchicalInstancedStaticMeshComponent* FoliageComp = ...;
for(int32 i = 0; i < 1000; ++i) {
    FTransform InstanceTransform = GetRandomTransform();
    FoliageComp->AddInstance(InstanceTransform);
}

By using the HISM component, the engine processes those 1,000 trees as a single draw call rather than 1,000 separate ones. Always prefer instanced components for repeated geometry to keep your draw thread overhead minimal.

Key Takeaway: Replace repeated static actors with Instanced Static Mesh components and group shared materials to consolidate draw calls and eliminate Render Thread bottlenecks.