GPU Instancing is a hardware optimization technology that allows a large number of objects that share the same "3D mesh" and "material" to be sent to the GPU in just one draw call (draw command) and drawn at ultra-high speed.

Real-world analogy: Bulk mass production using a taiyaki mold

The mechanism of GPU Instancing can be compared to “a batch mass production process using a taiyaki mold”.

  • Conventional (no instancing): In order to make 100 taiyaki (objects), each time we knead the dough to make a mold, bake one object, break the mold, remake the mold from the beginning and bake the next one, repeating the wasteful process 100 times. The cook (CPU) collapses from overwork.
  • With GPU Instancing: Prepare a huge mold with "100 taiyaki indentations (molds of the same mesh)" lined up on one iron plate. Then, pour the batter just once (one draw call) and bake 100 taiyaki at once. The baked taiyaki can be quickly served by changing only the location of the plate (position coordinates of each instance). The chef's effort (CPU load) is reduced to just one meal, resulting in an explosive increase in efficiency.
Unity GPU Instancing optimization diagram

Figure: Infographic of the flow of one drawing command and mass clone drawing by GPU instancing

Mechanism and operating principle

When GPU instancing is enabled, the CPU transfers the "common mesh data for drawing" and the "array data of the position, rotation, scale (and arbitrary color, etc.) of each object" to the video memory (VRAM). Within the vertex shader, the GPU refers to the index of the array sent (SV_InstanceID), applies individual transform matrices, and renders all instances at once with a single draw call.