menu_bookDocumentation

Clutter System — scattering grass, rocks, and debris with GPU instancing

calendar_today May 5, 2026 schedule ~2 min read person patrickjr verified 50

Clutter System — Scattering Grass, Rocks, and Debris

The Clutter System scatters large amounts of small objects (grass, rocks, debris) across a scene using GPU-instanced rendering. It handles placement, streaming, and LOD automatically.

Setup

  1. Create a Clutter Definition asset: Asset Browser → Create > Clutter Definition
  2. Add a ClutterComponent to a GameObject in your scene
  3. Assign the Clutter Definition to the component

Clutter Definition

The definition asset controls what gets scattered and how.

Entries

A list of models or prefabs to scatter. Each entry has a Weight controlling relative spawn probability. Use models for static props (grass, rocks), prefabs when you need components or behaviours.

Scatterer Types

ScattererDescription
SimpleRandom placement with density, scale range, ground alignment, and height offset
SlopeFilters by surface angle — e.g. grass on flat ground, rocks on steep slopes
Terrain MaterialPlaces entries based on the terrain material at each point
You can implement a custom scatterer for spline-based, volume-based, or texture-driven placement.

Streaming Settings

  • Tile Size — Size of each generation tile (256–4096 units). Larger = fewer jobs, coarser streaming.
  • Tile Radius — How many tiles around the camera to keep populated (1–10).

ClutterComponent Modes

CSHARP
// Infinite mode — streams tiles around the camera automatically
var clutter = go.Components.Create<ClutterComponent>();
clutter.ClutterDefinition = myDefinition;
clutter.Mode = ClutterComponent.GenerationMode.Infinite;

// Volume mode — generates within a fixed bounding box, saved with scene
clutter.Mode = ClutterComponent.GenerationMode.Volume;
// Then click Generate in the inspector, or call:
clutter.Generate();
Infinite mode auto-regenerates tiles when terrain underneath changes.

Clutter Tool (Editor)

The Clutter Tool in the editor toolbar lets you paint and erase instances by hand:

  • Paint — Left-click to scatter at brush location
  • Erase — Ctrl+click to remove within brush radius
  • Opacity — Controls density of painted placement (thins out for natural look)
Painted instances are stored separately from generated ones and persist with the scene.

Performance Notes

  • GPU instancing means thousands of instances have minimal draw call cost.
  • Keep TileRadius low (2–3) for large open worlds.
  • Use models (not prefabs) for pure static props — prefabs have component overhead.
Was this helpful?