card-grass
Card Grass
Target: Three.js 0.187.0, three/webgpu and TSL node materials from three/tsl; WebGPU only, no WebGL fallback, no GLSL strings.
The companion file scripts/card-grass.tsl.js is the material, the placement and the tile meshes. Copy it into the project; it imports only from three/webgpu and three/tsl. references/make-atlas.md builds the atlas it samples.
What it is
Ground cover the way the truck simulators do it: each clump is ONE textured quad standing upright at a fixed random yaw (it never turns to the camera), cut from a 4 x 4 atlas of cutout plant photos. Cards sit on a jittered grid (density from the spacing, not a count), thinned by a two-octave noise field so patches are dense and the ground between is thin. The CPU picks each card's atlas cell (by climate, altitude, wetness: the caller's rule) and its height. The shader lights every card as flat ground, alpha-tests it, sways its top, tints it toward the ground colour, turns it into snow-covered tufts in winter, and sinks it underground past a fade band. Cards never cast shadows and receive one shadow sample at the root.
When to use it
- open terrain seen from 1-3 m up, at speed or walking: roadsides, fields, hills, moorland, snowfields
- terrain streamed in tiles (64-512 m) with a draw distance for vegetation of 150-400 m
- fill-bound scenes where blade geometry or crossed billboards cost too much
Not for: lawns seen from above (cards read as flat sticks top-down), close-up hero grass you walk through (use blade geometry with bending), or anything past ~400 m (let the terrain texture carry it).