Docs menu · Terrain & Unreal heightmaps

Documentation

Terrain & Unreal heightmaps

The terrain chain

Terrain in Tessera is a heightfield: a 2D grid of heights on the XZ plane (Y up) with extra mask layers. Every terrain follows the same chain:

heightfield → hf_noise → hf_erode → hf_mask_by_feature → hf_scatter / hf_to_mesh / hf_export

Open the Eroded mountains or Forest on terrain example to see a finished one. Other terrain nodes include hf_terrace, hf_flow and hf_project; see the Terrain category.

Shape: heightfield and noise

  • heightfield makes a flat grid: size in metres (default 1000 × 1000) and resolution (cells along the longest side, default 512).
  • hf_noise adds fractal noise. One hf_noise with kind hybrid, amplitude 150-300 and element_size about 0.4 × the terrain size gives convincing mountains. Stack a second, small-amplitude fbm for detail. warp bends the noise (domain warp) and power sharpens peaks.
  • Kinds: fbm, perlin, ridged, billow, worley, hybrid. combine adds, sets, multiplies, takes the max or min, or subtracts. A mask limits it to a mask layer.

Erosion

hf_erode runs hydraulic droplet erosion, carving branching channels and gullies and depositing sediment in valleys and fans, followed by thermal erosion that crumbles over-steep slopes (talus_angle). At 512 × 512 the defaults take a few seconds. Besides the eroded height it writes 0..1 layers you can use as masks: flow (and water, rivers and channels), sediment (deposits), debris (talus) and erosion (material removed). Raise iterations or droplets_per_cell for deeper erosion.

Masks

hf_mask_by_feature builds a 0..1 layer from slope, height band, curvature (ridges or gullies) and facing direction; enabled criteria multiply. Name the layer with layer so later nodes can use it:

  • Rock: use_slope, slope_min 35.
  • Snow: use_height with height_min near the top, plus slope_max 40.
  • Grass: slope_min 0, slope_max 25.

Scattering

hf_scatter places points on the surface, weighted by a mask layer and limited by slope_max and height_range. Points carry N, up, orient (random yaw), pscale and every layer value, so copy_to_points can instance trees and rocks on them directly. The forest node does this in one step.

Meshing and colour

hf_to_mesh converts the heightfield to a quad mesh with normals, UVs and colours: color terrain (grass, rock on steep slopes, snow above snow_line), height, mask or none. step 2 halves the resolution for a lighter mesh. You can also send the mesh to Unreal as a static mesh, but for real landscapes use a heightmap.

Export for Unreal

Put hf_export anywhere after the terrain is final and set file to a .png path. It writes:

  • a 16-bit greyscale PNG (black = lowest, white = highest), and an .r16 raw file next to it (write_r16);
  • 8-bit PNG weightmaps for mask layers (<name>_<layer>.png; masks * = all);
  • with unreal_size auto, a resample to the nearest Unreal-recommended size (127, 253, 505, 1009, 2017, 4033, 8129).

It also computes the exact import settings and stores them as detail attributes: unreal_resolution, unreal_scale_xy, unreal_scale_z, unreal_location_z and a readable unreal_notes. Select the node and open Spreadsheet > Detail to read them. The Z scale uses Unreal’s formula: height range in cm / 512.

The node passes its input through unchanged, so it can sit in the middle of the chain. Leave file empty to only compute the settings.

Import into Unreal

  1. In Unreal, open Landscape mode, Manage > New > Import from File.
  2. Pick the 16-bit PNG (or the .r16) as the heightmap. Add weightmaps to your layers if you exported masks.
  3. Check that the resolution matches unreal_resolution.
  4. Set Scale X and Y to unreal_scale_xy and Z to unreal_scale_z.
  5. Import, then set the Landscape actor’s Location Z to unreal_location_z (in cm) so heights match Tessera’s world.

Full example

Ask the AI: “Eroded alpine mountains, 1 km, rock on steep slopes, export a 16-bit heightmap for Unreal”. Or send these ops:

Terrain with erosion, rock mask and an Unreal heightmap
{"ops": [
  {"op":"add","type":"heightfield","name":"terrain","params":{"size":[1000,1000],"resolution":512}},
  {"op":"add","type":"hf_noise","name":"mountains","inputs":["terrain"],"params":{"kind":"hybrid","amplitude":200,"element_size":450}},
  {"op":"add","type":"hf_erode","name":"erode","inputs":["mountains"]},
  {"op":"add","type":"hf_mask_by_feature","name":"rock_mask","inputs":["erode"],"params":{"layer":"rock","use_slope":true,"slope_min":35}},
  {"op":"add","type":"hf_export","name":"to_unreal","inputs":["rock_mask"],"params":{"file":"~/Tessera/exports/mountains.png"}},
  {"op":"add","type":"hf_to_mesh","name":"OUT_terrain","inputs":["to_unreal"],"params":{"step":2},"display":true},
  {"op":"layout"}
]}