Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

terrain_mask

A soft-band rule over one feature of a raster, written into a named layer.

input kindvalueunit
0 heightthe surface's own valueworld metres
1 slopethe angle of its gradientdegrees from flat
2 curvatureits Laplacian — positive in a gully, negative on a ridge1/metre
3 noisegradient noise over world position0..1
4 curvedistance to a polyline's sampled control pointsworld metres

A band is min .. max, feathered by feather — a soft half-width in the input's own unit — on either edge; a side left open (±1e29) is not a bound at all. jitter perturbs the sampled value before the band, by up to jitter over a gradient-noise field sized jitterSize, so the boundary wanders instead of tracing a contour. invert swaps what the band selects.

The height/slope/curvature inputs are derived from the raster's own "height" layer, read through op_source at the same resolution as the layer this op writes — one indexed read per cell, no resampling. slope and curvature are central differences over step world metres.

The curve input reads a polyline's sampled control points off op_payload — the same array terrain.project rides — and measures distance to it in the ground plane; a control point's height plays no part in the distance.

blend decides how the band's weight meets what the layer already holds: replace, add, max, or min. A layer written fresh is usually replace; combining two masks into one accumulated layer is add or max.

The written value is a weight in 0..1 — a layer this op writes is what terrain.mask's name param names, and any other raster kernel op's own mask param can reference it by that name, multiplied in or subtracted out, through the generic op_mask/op_common contract every raster kernel op already carries.