Get updates ↗

Performance

Draw calls in game development

one call, four hundred crates

Interactive example · scroll or point here to play
29

one call, four hundred crates

A draw call is the CPU telling the GPU to draw one mesh, and the CPU spends time preparing each one. Instancing draws many copies of the same mesh and material in a single call, with a list of positions and rotations for the copies. The animation draws the same 400 crates both ways, and the count drops from 400 calls to 1.

prompt bit
Use GPU instancing for repeated objects that share one mesh and one material, so each group renders in a single draw call with a per-instance transform buffer, and merge static meshes that share a material into one mesh.

When to use it

Use instancing for many objects that share geometry and material. Batch compatible objects while preserving the visibility granularity needed to avoid drawing huge offscreen groups.

Implementation example

Engine-neutral pseudocode. Adapt the functions and coordinate conventions to your engine.

for instance in visibleInstances:
  transforms.append(instance.worldMatrix)
instanceBuffer.upload(transforms)
drawInstanced(mesh, material, transforms.length)

Common mistakes

Reducing draw calls does not automatically reduce triangles, shader cost, or transparent overdraw. Measure the actual bottleneck and remember that material changes can split a batch.

Maintained by Nicolas Zullo · Follow on X ↗