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 |
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.
- Spawn Prefab / Spawn Prefab (Generator): one prefab.
- Create Primitive / (Generator): Unity cubes, spheres and other primitives.
- Pick Weighted / (Generator): a deterministic weighted pick per row.
- Sample Weighted / (Generator): fills the whole prefab column as one weighted batch.
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.
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
- Start with GameObjects when instances need gameplay behavior, physics or hierarchy access.
- Move purely visual repeated geometry to Draw Instanced.
- Use Draw Instanced Indirect once the population justifies an indirect shader.
- Measure the real scene. Shader cost, shadows, overdraw and mesh complexity still matter.
For a complete indirect example, follow GPU-accelerated grass.