Version: Unity 6.3 Beta (6000.3)
Language : English
GPU instancing
Enable GPU instancing for a prebuilt material

Introduction to GPU instancing

GPU instancing is a draw call optimization method that uses a single draw call to render multiple GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
that use the same meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary
and material. This speeds up rendering when you draw things that appear multiple times in a sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
, for example, trees or bushes.

GPU instancing is a built-in functionality of GPUs. Each copy of the mesh is called an instance. Each instance can have different properties, such as color or scale.

The performance benefits of GPU instancing depend on the platform and the GPU. For each draw call, Unity has to collect, combine, and upload properties from various memory locations, so the performance overhead might outweigh the benefits. The performance benefits are better on mobile platforms than on desktop platforms.

Render pipeline compatibility

GPU instancing is compatible with all Unity render pipelines. If you use the Universal Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
(URP) or High Definition Render Pipeline (HDRP), GPU instancing works with custom shadersA program that runs on the GPU. More info
See in Glossary
only if you disable the Scriptable Render Pipeline (SRP) Batcher or make a shader incompatible with the SRP Batcher.

For information on draw call optimization methods you can use instead of GPU instancing, refer to Choose a method for optimizing draw calls.

Indirect lighting compatibility

GPU instancing supports the following types of GameObject:

  • Dynamic GameObjects that get lighting from Light ProbesLight probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
    See in Glossary
    .
  • Static GameObjects that get lighting from lightmapsA pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
    See in Glossary
    , if they have Contribute GI enabled in their Static Editor Flags, and they bake to the same lightmap texture.
  • GameObjects that use Light Probe Proxy VolumesA component that allows you to use more lighting information for large dynamic GameObjects that cannot use baked lightmaps (for example, large Particle Systems or skinned Meshes). More info
    See in Glossary
    (LPPV). You must bake the LPPV for the entire space that contains all the instances.

Shader and mesh compatibility

The following meshes are compatible if you use prebuilt materials:

  • Mesh Renderer components in your scene. Skinned Mesh RendererA mesh component that takes the geometry from the Mesh Filter and renders it at the position defined by the object’s Transform component. More info
    See in Glossary
    components are not supported.
  • Meshes you render in a script using APIs that support GPU instancing in prebuilt materials, such as Graphics.RenderMeshInstanced.

The following shaders support GPU instancing:

To create a custom shader that supports GPU instancing, refer to the following:

Additional resources

GPU instancing
Enable GPU instancing for a prebuilt material