Skip to content
Curious Trove
Concept Rendering OctoShaper 1.2Updated

Rendering and Instancing Modes

A graph can produce the same positions whichever way you render them. The final rendering node decides what Unity actually creates, from full GameObjects with components to lightweight GPU instances.

Three ways to render rows

Mode What Unity creates Good fit Trade-off
GameObjects One object or prefab hierarchy per row Interactive objects, components, colliders, scripts, parenting, spawn callbacks Cost grows with every object
Draw Instanced No objects; batches of up to 1023 instances Repeated visual geometry with an instancing-capable material No components or callbacks; big populations need several batches
Draw Instanced Indirect No objects; transforms and draw arguments live in GPU buffers Very large visual populations Needs a shader that reads OctoShaper's _InstanceData buffer
Same rows, three rendering modes.

Instancing draws many copies of one mesh and material while each keeps its own transform. Indirect drawing goes further: Unity reads the instance count and transforms from GPU buffers. OctoShaper still prepares and uploads those transforms when the result is realized, so the graph itself isn't GPU-only.

GameObject nodes

All of these live in the Rendering category. Each has a Generator form that creates rows, and a normal form that assigns a choice to rows already in the graph.

Use GameObject callbacks to initialize spawned prefabs from row data, and the Physics collider nodes to add colliders.

GPU nodes and the Mesh selector

Draw Instanced and Draw Instanced Indirect take a material, shadow casting and receive-shadow settings, and a Mesh that is either:

  • Constant: one mesh asset for every row.
  • Attribute (usually mesh): each row's own mesh, for example from Realize Meshes or Assign Mesh.

An empty constant mesh or missing material skips drawing. Different mesh and material combinations form different batches, so a small set of combinations is cheaper than making every row unique.

Branches can end in different rendering nodes.

Per-instance material overrides (1.2)

Add Set Material Color, Set Material Texture, Set Material Float or Set Material Texture Transform after a draw node to vary instances without new materials. They work with both draw nodes and with procedural prefabs. See Colors, textures and materials.

Hierarchies need GameObjects

Create Assembly Roots, Assign Parents and Place Local Assembly build and place hierarchies. See Assemblies and placement. Instanced rows have no transform in Unity's hierarchy, so keep parents and children on the GameObject path.

Mixing modes in one graph

OctoShaper splits the final rows by rendering assignment, so one graph can keep a few interactive prefabs as GameObjects and draw thousands of decorative instances on the GPU. Only the GameObject rows get components, colliders and callbacks. Treat GPU rows as rendering data, not lightweight GameObjects.

Choosing, in short

  1. Start with GameObjects when instances need gameplay behavior, physics or hierarchy access.
  2. Move purely visual repeated geometry to Draw Instanced.
  3. Use Draw Instanced Indirect once the population justifies an indirect shader.
  4. Measure the real scene. Shader cost, shadows, overdraw and mesh complexity still matter.

For a complete indirect example, follow GPU-accelerated grass.

Frequently asked questions

Which rendering mode should I start with?
Start with GameObjects if instances need gameplay behavior, physics or hierarchy access. Move purely visual, repeated geometry to Draw Instanced, and very large populations to Draw Instanced Indirect.
Can drawn instances have colliders?
Instanced rows are not GameObjects. Use the collider nodes on GameObject output, or keep a separate GameObject branch for the pieces that need physics.
Can I vary colors per instance with GPU instancing?
Yes. Add Set Material Color, Texture or Float after the draw node. The source material is never modified, and identical overrides share batches.