Builtin Library
- ..
- README.md1.3 KB
- bindings.yaml1.4 KB
- shader.wgsl3.6 KB
README.md
terrain_coast_mask
Pulls the ground outside a landmass down to a seabed altitude, with the landmass given by a painted raster rather than a radius.
The raster is a layer co-registered with the field — one texel is one cell — so the outline an author paints is the outline the coast follows. The value is the land weight directly:
value = mix(seabed, prev, clamp(mask * gain, 0, 1))
1 is land and keeps the landscape untouched, 0 is open water and sits at the
seabed, and the values between are the shoreline slope: the softness of the
brush is the softness of the coast. gain scales the raster before the clamp,
so a stroke painted at a fraction of full strength can still read as solid land.
Like the radial form, this covers the whole field — the ground it changes is the ground the mask does not cover.
terrain_coast is the same operation driven by a radius, for a coastline
described rather than drawn.
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.