Terrain Setup & Capture

Grassworks accepts plane-based terrain meshes. During initialization it captures the terrain from above and derives the height representation used for grass placement.

Prepare the terrain first

  • Set the terrain to its final world-space position, rotation and scale.
  • Keep the terrain visible when Grassworks initializes.
  • Any Three.js terrain material may be used.
  • Use normal 0–1 UV mapping across the terrain for predictable grass-map mapping.

Terrain detail

Grass placement is based on the captured height representation rather than simply sampling the source mesh's subdivision density. You therefore do not need to redesign the terrain mesh solely to provide more grass-placement samples.

Refreshing changed terrain

If the terrain moves, changes shape or otherwise needs to be re-captured after initialization, call refreshTerrain().