Landscape

How a terrain is built, sculpted, painted and saved, what its collision and height file do, and how painted foliage and grass follow it.

Last updated Dec 4, 2026Version 1.1.0

A landscape is one terrain component: a square height field with up to eight paintable layers, holes, collision and grass. This page covers what the Landscape panel does and how the pieces behave at run time. The World building page covers where the panel sits in the editor.

The grid

A terrain is chunksPerSide x chunkResolution quads on a side. That grid is what is drawn, and it is what the collision uses: the height field the physics engine collides with has its samples on the same grid, so a character stands on the surface you see and a trace cannot miss a ridge that is drawn.

Past 2048 quads a side the collision takes every second (then third, ...) vertex of the render grid, always a divisor of it, so collision vertices still land on render vertices. The collision has one extra row and column of padding on the far edges that collides with nothing; it is there because the physics height field needs an even sample count.

Tools

ToolWhat it does
Sculpt, Smooth, Flatten, NoiseBrush tools. Hold Shift to invert
RampClick a start and an end in the viewport, then Apply Ramp for a constant-grade corridor
Erosion, HydroThermal erosion under the brush, and a hydraulic pass over the whole terrain
RetopSlides the render samples along steep ground. Heights are never rewritten
MirrorCopies one half of the height field onto the other, reflected. Pick the axis and the direction, then Mirror Terrain. The middle line stays put
RegionClick two opposite corners in the viewport, or set the rectangle with the four sliders (fractions of the terrain). Select Whole Terrain resets it
CopyCopy Region takes the heights inside the Region. Click the terrain to place the paste anchor (the pasted block's top-left corner), pick a mode, then Paste

Paste has three modes: Replace writes the copied heights, Add lays the copied relief (relative to its lowest point) on top of what is there, and Max keeps the higher of the two. Mirror and Paste are single undo entries and refit the collision.

Visibility switches to the Paint tab with the visibility (hole) layer armed and turns holes on for the terrain.

Holding a brush still keeps applying it, scaled by frame time, so a held Sculpt or Smooth builds up the way a moving one does. Retop is the exception: it relaxes toward a fixed spacing and has nothing to accumulate.

Every tool works on the terrain under the cursor in that terrain's own space, so a rotated or scaled terrain gets the dab where the ring is. The brush radius is measured on the terrain before its scale. A level with several terrains edits the selected one; pressing on another one switches to it.

Undo and edit layers

Sculpting writes into the active edit layer (or into the base when there is none or it is locked). Undo and redo put back the layer itself, not only the heights you see, so an undone stroke does not return when you sculpt next to it, hide or show a layer, or save. The same holds for Ramp, Mirror, Paste, Noise, splines and erosion; cancelling an erosion run restores the terrain and the layer it was writing into. Adding or removing a layer between a stroke and its undo still undoes the heights, as an edit in the active layer.

Only one long operation runs at a time: while an erosion pass is running, the panel refuses other height operations.

Heights below zero

The height file is unsigned 16-bit. To keep valleys, the terrain component stores a Height Offset next to the Height Scale: the height of a 0 texel is the offset, and the height of a 65535 texel is offset plus scale.

When you export heights, the panel fits both to the sculpt: the offset becomes the lowest height if it is below zero (otherwise it stays 0) and the scale spans valley to peak. A terrain that never dips below zero writes the same file as before. A file you import is read with the component's current offset, so set the offset before importing a heightmap that was exported with one.

Grass on the layer palette

The Grass Types list on the terrain component scatters grass per layer. Each row has a density, a weight threshold, a scale range, a slope limit and an optional mesh. Rows with no mesh draw a blade clump as one GPU batch.

On a terrain larger than twice the Grass Generation Radius (192 m by default) the clump rows are generated around the camera, one 32 m cell at a time, and dropped as the camera moves on. Each cell is generated from its own seed, so the same cell is identical every time it comes back. The grass keeps its density on a multi-kilometre landscape instead of spreading a fixed budget across all of it. Set the radius to 0 to scatter the whole terrain at any size.

The scatter for a cell runs on a background thread. The result is uploaded on a later frame, at most two cells a frame, and at most eight cells are being scattered at once, so moving the camera quickly fills the grass in over a few frames instead of stalling one. A cell whose chunk does not paint a row's layer is skipped without running the scatter.

Rows with a mesh, or with Align To Slope above 0, are scattered over the whole terrain.

GPU Scatter

A row can be marked GPU Scatter for grass, flowers and pebbles. Such a row builds no instances on the CPU. The GPU places the grass each frame in a ring around the camera, from a seed per world cell, so the same ground grows the same grass every time it comes back. There is no streaming and no instance list to tune. The Grass Generation Radius does not apply to these rows.

FieldRangeDefaultMeaning
GPU Scatteron or offoffPlaces the row on the GPU
GPU Max Distance5 to 300 m40How far from the camera the row grows
Exclusion Layer-1 or 0 to 7-1A painted layer, such as a road, that keeps the grass off. -1 has none
Exclusion Threshold0 to 10.5Paint in the exclusion layer above this weight keeps the grass off
Min Height, Max HeightanyunboundedThe height band the grass grows in, in metres

The row's own density, weight threshold, scale range and slope limit still apply. Max Instances sets the row's slot budget. If the budget is short for the reach, the grass reaches less far instead of thinning out.

A row stays on the CPU, and ignores GPU Scatter, when it has a mesh or Align To Slope above 0. The grass still grows only where the row's layer is painted above its weight threshold.

Warning

On a terrain that is rotated or scaled unevenly, GPU Scatter rows are scattered on the CPU instead, like any other row: the grass still grows, with the CPU path's streaming and instance cap.

Grass placement and wind are described on the Weather and wind page. r.Grass.Gpu 0 turns every GPU Scatter row off.

Layers per chunk

The weight maps are two full-resolution planes (layers 0-3 and 4-7) shared by the whole terrain. The terrain keeps a table of which layers each chunk actually paints, updated by every brush stroke from just the chunks the stroke touched. Anything that walks layers uses it to pay per chunk for the layers it needs: grass skips cells that do not paint its layer, and the second plane is written to disk only when some chunk paints one of layers 4-7. If you erase layers 4-7 entirely, the next save drops the second plane and the terrain stops referencing it.

The render shader still samples the two shared planes. The table does not yet reduce GPU memory, and the limit is still eight layers.

Painted foliage follows the terrain

Instances painted with the Foliage tool that stand on the terrain surface (within about a third of a metre of it) keep their height above it when you sculpt. After a stroke, an undo, an erosion pass or a mirror, they are re-projected onto the new surface and re-tilted to its normal. Instances placed on a mesh or in the air stay where they were put.

Saving

Saving the level writes, beside the level file, the terrain's edit-layer stack (<level>_Terrain<id>.mtel: the base heights and every layer, so hidden layers survive) and its painted weights (_Weights.png, plus _Weights2.png when any of layers 4-7 is painted). Only terrains that changed since the last save are written. The terrain component points at those files.

When a level opens, and in a packaged game, the terrain is built from the saved stack: base plus visible layers. The heightmap file the component also names is used only when there is no stack, or when the stack was made for another resolution (a re-imported heightmap, changed chunk settings); the log says so. Grass scattered by a Foliage component reads the same surface.

A terrain spawned by a tile import has no heightmap file; its heights are saved in its stack like a sculpt.

Engine sources

This page describes behavior implemented in these files of the engine repository, checked against commit 0e77abe6b.

  • Engine/Source/Gameplay/Game/Api/Game/Components/TerrainComponent.h
  • Engine/Source/Gameplay/Game/Api/Terrain/TerrainSystem.h
  • Engine/Source/Gameplay/SceneTypes/Api/Terrain/TerrainEdit.h

Page feedback

Was this page helpful?