Terrain node
hf_to_mesh
Convert the heightfield to a polygon grid mesh (quads, normals facing +Y). Writes point attributes N (from the height gradient), Cd (see 'color'), uv (0..1 over the terrain) and one float point attribute per layer; prim attributes material='terrain', name='terrain'. Other geometry on the input passes through. 512^2 = 262k quads; use step=2 for lighter meshes.
Inputs
- 0heightfield
Parameters 9
stepintUse every Nth cell (2 = 4x fewer polygons). 1 = full res.
colormenuPoint colour Cd: terrain = procedural grass/dirt/rock/snow from slope, height and erosion masks; height = colour_ramp over normalised height; mask = colour_ramp over the 'color_layer' mask; none.
color_layerstringLayer used when color = mask.
color_ramprampRGB ramp [[pos,[r,g,b]],...] for 'height' or 'mask' colouring.
[
[
0,
[
0.1,
0.25,
0.08
]
],
[
0.45,
[
0.45,
0.42,
0.25
]
],
[
0.75,
[
0.45,
0.43,
0.4
]
],
[
1,
[
0.95,
0.95,
0.97
]
]
]snow_linefloatTerrain colouring: normalised height above which gentle slopes are snow (1.01 = no snow).
rock_slopefloatTerrain colouring: slope (deg) above which rock shows.
layers_as_attribstoggleCopy every heightfield layer to a point float attribute of the same name (e.g. 'flow', 'mask') for later nodes.
keep_heightfieldtoggleAlso keep the heightfield on the output (normally dropped so the viewport shows only the mesh).
skirttoggleAdd vertical side walls down to below the lowest point (solid block look for renders/3D printing).
Use it
Add it from the node menu (right-click empty graph space or Tab, then type hf_to_mesh), ask the AI for it by name, or add it with a graph op from the API or MCP:
{"op":"add","type":"hf_to_mesh","name":"my_hf_to_mesh","params":{},"inputs":["src"]}Any parameter can also be an expression such as "=sin(F*0.1)". See Parameters & expressions.