Expand description
Heightfield-style terrain: a subdivided grid mesh in the XZ plane whose vertex heights (local Y) are edited by radial brush operations.
A terrain is a plain MeshInstance node, so rendering, undo, saving and
glTF export work without any special cases. The brush functions operate
on mesh-local positions; callers with transformed nodes must convert the
brush center into local space first.
Enums§
- Brush
Mode - How a brush stroke changes the heights inside its radius.
Functions§
- add_
terrain - Create a terrain grid node with the soil material attached.
- add_
water - Create a translucent water surface node at world height
height. - brush
- Apply one brush step to a terrain grid mesh in mesh-local space.
- falloff
- Smooth falloff 1.0 at the brush center, 0.0 at (and beyond) the radius.
- grid_
mesh - Subdivided terrain grid centred on the origin, lying on the XZ plane at y = 0 with normals pointing up. Shared vertices (indexed), so brushes deform the surface without seams.
- grid_
segments - Detect a grid produced by
grid_mesh:(s+1)²shared vertices on a regular XZ lattice pluss²·6indices in the builder’s winding pattern. Returns the segment counts. - material_
by_ name - Find or create a named material so repeated calls don’t pile up duplicates.
- resample_
grid - Resample a terrain grid to
new_segmentsper axis by bilinearly sampling the height field; XZ extents are preserved, normals recomputed. Returns false when the mesh is not agrid_meshlattice. - soil_
material - Ground material for freshly created maps.
- water_
material - Translucent blue material for water surfaces.
- water_
mesh - Flat quad on the XZ plane at the given height, for a water surface.