Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetInstanceMultiplier(uint)

Adds a command to multiply the instance count of every draw call by a specific multiplier.
Read time 1 minuteLast updated 5 days ago

Definition

public void SetInstanceMultiplier(uint multiplier)

Parameters

multiplier

Remarks

Changing the instance multiplier is useful for stereo rendering optimizations such as single pass instanced rendering. For example, if you set the multiplier to 2, a command that draws one instance, instead draws two, and a command that draws two instances, draws four. See Single Pass Instanced Rendering for more information.
The multiplier is used until you reset it by calling this function again with a new value. The default multiplier is 1. Passing a parameter value of 0 to this function also sets the instance multiplier to 1.
The instance multiplier affects draw calls submitted by internal Unity Engine functions as well as CommandBuffer.DrawMesh, CommandBuffer.DrawMeshInstanced, Graphics.DrawMeshInstanced, CommandBuffer.DrawProcedural, and Graphics.DrawProcedural