Prefer Grass.create, which also validates/initialises the renderer and pre-builds tiles.
Camera the field follows. Can be swapped at any time.
ReadonlyobjectRoot of all grass tiles. Added to scene for you when one is passed to Grass.create.
Terrain height at world (x, z); NaN where there is no terrain. Handy for placing objects on the ground.
Resolved settings (defaults ← preset ← your input). Read-only: change them with Grass.set.
ReadonlystatsLive counters, refreshed on every Grass.update.
ReadonlyuniformsShader uniforms, for advanced tweaks or for reading grass state in your own TSL materials.
Blade colour at the root (from baseColor).
Blade height in metres.
Blade base width in metres.
Per-blade brightness variation, 0..1.
Natural droop, 0..1.
1 tints grass by LOD, 0 = normal shading.
Global multiplier on interactor push.
Number of active entries in interactors.
xyz = world position, w = radius (0 = unused slot).
The four LOD density fractions (x, y, z, w = LOD 0..3).
The four LOD distances (x, y, z, w = LOD 0..3).
Grass map texture (R = coverage, G = height); a neutral 1×1 texture when there is none.
minX, minZ, sizeX, sizeZ of the grass map in world space.
Radius with grass; blades fade over its last 15%.
Field-scale light/dark and dry patches, 0..1.
Resistance to wind and interaction (never below 0.05).
Sun colour × intensity.
Direction towards the sun. Drives back-lit translucency.
Blade colour at the tip (from tipColor).
Back-lit glow strength.
Position LOD/fades are measured from. Set from the Grass camera on the CPU so shadow passes (which render from the light) see exactly the same blades as the main view.
Normalised XZ wind direction.
Gust noise frequency (1/metres).
Gust travel speed.
How far blades bend in the wind.
Fraction (0..1) of full blade density at a distance from the camera — the CPU mirror of the shader's LOD curve.
Removes the grass from the scene and frees its GPU resources.
TSL nodes reading the grass map at a world XZ position. Use them in your terrain material to show
dirt where grass was erased; they follow map edits and grassMap swaps live.
Replaces all settings with input: anything not given falls back to the preset, then to defaults.
Use it to switch presets cleanly after overriding style fields. <Grass> uses it so props behave
declaratively (removing a prop reverts it).
Changes settings at runtime, merging into what was set before. Visual settings (colours, height,
wind, …) apply instantly through uniforms; layout settings (type, density, tileSize, lods, clumping,
variation, maxSlope) rebuild tiles. undefined values are ignored; wind merges field by field.
To drop earlier overrides (e.g. go back to a preset's colours), use Grass.reset.
Swaps the terrain (mesh or height function) and regenerates all tiles.
Optionalterrain: TerrainRe-centres the tiles on the camera, streams tiles in/out and refreshes interactors and the sun.
Called automatically when a scene was given (and by the <Grass> component); otherwise call it once per frame.
Milliseconds allowed for tile (re)builds this frame. Defaults to settings.buildBudget.
StaticcreateCreates a grass field and builds every visible tile so the first frame is complete.
An infinite, camera-centred grass field.
The world is divided into square tiles that stream in and out around the camera; each tile holds instanced blades placed on the terrain, thinned by distance through four LODs.
Example