← All resources

Drawing Thousands of Meshes with DrawMeshInstanced / Indirect (Toqoz)

Auto-discovered

Blog Advanced

Toqoz

Visit resource ↗

Description

Toqoz's November 2019 toqoz.fyi post walks through drawing very large mesh counts in Unity with Graphics.DrawMeshInstanced and Graphics.DrawMeshInstancedIndirect, with C# samples, HLSL shaders, and a GitHub Unity project.

It covers automatic GPU instancing limits and GameObject overhead, instanced draws with MaterialPropertyBlocks under the 1023 batch cap, then indirect draws via argument buffers, ComputeBuffers, StructuredBuffers, and bounds culling.

A compute-shader section moves instances on the GPU without CPU transform loops, stressing identical struct layout in C#, shader, and compute code.

Advanced Unity graphics programmers studying instancing and GPU-driven rendering benefit most; examples use built-in pipeline era APIs.

Free online with runnable code; often linked from curated shader lists including the Cyanilux resources gist for mass foliage or prop batching.