Configuration
These are the properties accepted by Grassworks.create(). Every property is independently addressable so configuration questions can link directly to the relevant entry.
const grassworks = await Grassworks.create({
camera, scene, renderer, terrain,
tileSize: 25,
maxDistance: 200
});camera
Grassworks camera used for visibility and LOD.
scene
Scene that receives the generated grass tiles.
renderer
WebGPU renderer required by Grassworks.
Grassworks requires WebGPURenderer; WebGLRenderer is not supported.
terrain
Plane-based terrain mesh.
The supported terrain model is a plane-based Three.js terrain surface.
tileSize
Must be greater than 0.
maxDistance
Must be greater than 0.
grassType
Selects the grass representation.
grassAtlas
Required for Billboard grass.
Used by Billboard grass. The atlas source is divided with atlasColumns and atlasRows inside grassParams.
grassMap
Path or URL to a grass map.
See the Grass Maps Guide for mapping behavior and formats.
grassParams
Grass parameter overrides.
preset
Named Blade preset.
Named presets are Blade-only. Billboard has a default configuration but no named preset library.
interactionWorldSize
World coverage of the camera-following interaction map.
interactionResolution
Resolution of the interaction map.
influenceRecoverySpeed
Must be between 0 and 1.
influenceDebugPlaneVisible
Controls the interaction debug plane.
painter
Terrain Painter configuration.
lod
Overrides the four LOD configurations.
castShadow
Sets generated grass meshes to cast shadows.
receiveShadow
Sets generated grass meshes to receive shadows.