Builtin Library
- ..
- .metadata17 B
- README.md680 B
- bindings.yaml220 B
- shader.wgsl4.6 KB
README.md
compute_tree_placement
GPU vegetation placement over a terrain heightmap. One thread per (x, z) cell:
reads the height, computes local slope, and uses noise-based density to pick what
grows (0 = nothing, 1 = tall pine, 2 = small pine, 3 = shrub, 4 = rock).
Bindings (see bindings.yaml): params (read array<f32> — [gridSize, worldExtent, seed, treeLine, slopeLimit, shrubLine, ...]), heights (read
array<f32>), placement (read_write array<f32>, the per-cell type code).
Usage: dispatch by identity with compute.dispatch("@builtin::shaders.compute_tree_placement", ...) —
it resolves to the shader's stable guid and auto-compiles on first use (no setup).