To enable GPU instancing for a prebuilt materials, follow these steps:
Note: If you use the Universal Render Pipeline (URP) or High Definition Render Pipeline (HDRP), the recommended best practice is to use the SRP Batcher instead, which is enabled by default. GPU instancing works only if you disable the SRP Batcher.
If multiple GameObjects use the same mesh and material, Unity now uses GPU instancing to render them in single draw calls. To check this, open the Frame Debugger and look for render passes called Draw Mesh (Instanced).
If there’s no Enable GPU Instancing property, the prebuilt shader doesn’t support GPU instancing.
To change the properties of instances at runtime, for example to give each instance a different color or position, create a script to do the following:
For more information, refer to MaterialPropertyBlock.
To render multiple instances of a mesh in a script using GPU instancing, use one of the following APIs: