Grass Maps
A grass map is a grayscale image that controls grass coverage and height across the terrain.
| Map value | Grass result |
|---|---|
Black #000000 | Full-height grass |
White #FFFFFF | No grass |
| Intermediate grayscale | Intermediate grass height |
Source and mapping
grassMap accepts a path or URL and Grassworks loads it internally. JPEG/JPG, PNG and WebP are supported. A square 1:1 aspect ratio is recommended; there is no fixed recommended pixel size.
Mapping follows the terrain UVs, so the physical terrain dimensions do not need to match the image pixel dimensions. Predictable results depend on normal 0–1 UV mapping across the terrain surface.
No grass map
If you do not provide a grassMap, the terrain is treated as fully covered by grass.
For scene-aware painting workflows, go directly to the Terrain Painter Guide.
js
const grassworks = await Grassworks.create({
camera, scene, renderer, terrain,
tileSize: 25,
maxDistance: 200,
grassMap: "/assets/grass-map.webp"
});