Terrain node

hf_erode

Realistic erosion: hydraulic particle (droplet) erosion that carves branching channels and gullies and deposits sediment into valleys and fans, followed by thermal (talus) erosion that crumbles over-steep slopes. Numba-accelerated: 512x512 with defaults takes a few seconds. Writes layers: 'height' (eroded), 'flow' (0..1 water flow intensity, rivers/channels), 'water' (same as flow), 'sediment' (0..1 where material was deposited), 'debris' (0..1 thermal talus deposits), 'erosion' (0..1 how much was removed). Use the masks in hf_to_mesh colouring or hf_scatter. Run after hf_noise and before masking.

Inputs

Parameters 15

iterationsint
Default 5Range 0 to 200

Erosion passes. Each pass runs droplets_per_cell x cells water droplets followed by a short thermal pass. 3-6 is good; 10+ = very old, deeply carved terrain.

droplets_per_cellfloat
Default 0.5Range 0 to …

Water droplets per heightfield cell per pass (0.5 x 512^2 = 131k droplets per pass). More = more and finer channels.

strengthfloat
Default 1Range 0 to …

Overall hydraulic erosion strength (scales erode rate and capacity). 0.5 gentle, 1 default, 2 strong gullies.

erode_ratefloat
Default 0.3Range 0 to 1

Fraction of free carrying capacity picked up per step.

deposit_ratefloat
Default 0.3Range 0 to 1

Fraction of excess sediment dropped per step (higher = sharper alluvial fans).

capacityfloat
Default 4Range 0 to …

Sediment carrying capacity factor of a droplet.

inertiafloat
Default 0.05Range 0 to 0.99

How much droplets keep their direction (0 = always follow steepest descent; 0.3 = meandering, wider channels).

evaporationfloat
Default 0.02Range 0 to 0.5

Water loss per step; lower = longer rivers.

lifetimeint
Default 48Range 4 to 500

Maximum steps a droplet travels.

brush_radiusint
Default 1Range 0 to 8

Radius in cells over which erosion is spread (1-3; bigger = smoother, wider valleys).

talus_anglefloat
Default 38Range 5 to 89

Thermal erosion: slopes steeper than this angle (degrees) crumble down and pile up as debris. 30-40 natural scree.

thermal_amountfloat
Default 0.4Range 0 to 1

Thermal erosion strength per step (0 = no thermal erosion).

thermal_stepsint
Default 3Range 0 to 200

Thermal relaxation steps per iteration.

maskstring
Default ""

Optional mask layer: erosion only changes the terrain where mask > 0 (blended).

seedint
Default 0

Random seed of droplet spawn positions.

Use it

Add it from the node menu (right-click empty graph space or Tab, then type hf_erode), ask the AI for it by name, or add it with a graph op from the API or MCP:

{"op":"add","type":"hf_erode","name":"my_hf_erode","params":{},"inputs":["src"]}

Any parameter can also be an expression such as "=sin(F*0.1)". See Parameters & expressions.