Terrain node
hf_from_mesh
Rasterise a polygon mesh (input 0) into a heightfield by projecting it straight down Y: e.g. convert a sculpted/imported terrain mesh, or stamp rocks/buildings into a terrain. With input 1 the mesh is written into that heightfield's grid; otherwise a new grid around the mesh is made. Writes 'height' and a 'mesh_mask' layer (1 where covered). Other geometry of input 0 is dropped (output is the heightfield, plus input-1 geometry).
Inputs
- 0mesh
- 1heightfield (optional grid)
Parameters 5
cell_sizefloatCell size when no heightfield is given on input 1 (grid covers the mesh bounding box).
paddingfloatExtra border around the mesh bounds (world units).
modemenuWhich surface to take where the mesh overlaps itself: max = top surface (typical), min = underside.
combinemenuWith input 1: replace = covered cells take the mesh height, max/min = combine with existing terrain.
backgroundfloatHeight of cells not covered by the mesh (when creating a new grid).
Use it
Add it from the node menu (right-click empty graph space or Tab, then type hf_from_mesh), ask the AI for it by name, or add it with a graph op from the API or MCP:
{"op":"add","type":"hf_from_mesh","name":"my_hf_from_mesh","params":{},"inputs":["src"]}Any parameter can also be an expression such as "=sin(F*0.1)". See Parameters & expressions.