Builtin Library
- ..
- README.md1.2 KB
- bindings.yaml1.0 KB
- shader.wgsl2.9 KB
README.md
terrain_layer
Blends a co-registered raster layer into a scalar channel.
A layer shares the field's grid exactly — same tile, same cell, same apron — so
there is no sampling and no transform involved, only a blend. Compare
terrain_stamp, which samples a texture through a world-space transform
because the source has a grid of its own.
That exactness is what lets freehand editing live inside a parametric stack.
Brush strokes accumulate into a layer, the layer is one layer op among the
others, and changing an op above it re-runs the stack with the strokes still in
place. Painting is an edit to the layer's raster rather than a bake over the
terrain the ops produced.
opacity scales the layer before the blend, so the same raster can be dialled
in and out without repainting it. blendMode follows the numbering every
terrain op shares: 0 replace, 1 add, 2 max, 3 min.
Every op carries a mask. The op's weight at a cell is scaled by what the mask reads there — multiplied in, or subtracted out — so the op applies only where the mask lets it and a cell the mask holds out keeps exactly what it already held, at every blend mode. An op that names no mask writes at full strength everywhere.