Making games
Terrain
Create > Terrain (or right-click the viewport > Terrain) makes a generated landscape, already painted and planted:
| Shape | |
|---|---|
| Rolling hills | gentle, grassy |
| Mountains | high ridges, rock on the slopes, snow on top |
| Island (with sea) | a beach-ringed island and a Water object around it |
| Canyons | steep-sided valleys |
| Dunes | wind-blown sand |
| Flat | a blank canvas |
Sculpting and painting
Select the terrain and the Inspector shows its tools. Paint in the viewport with the left mouse button.
| Tool | |
|---|---|
| Raise / Lower | Shift swaps them |
| Smooth | evens out bumps |
| Flatten, Plateau | level the ground to a height; Ctrl+click picks the height |
| Noise | natural bumps |
| Erode | weathering that slides steep slopes down |
| Paint | 8 texture layers, each with colour, normal map, tiling, roughness and tint |
| Trees / Remove | plant or remove trees, bushes and rocks (Shift removes); solid ones get trunk colliders |
Brush size ([ and ]), strength and softness are in the Inspector. Every stroke is one undo
step (Ctrl+Z).
Generate
Generate remakes the heights from a seed, feature size, height and roughness, with optional rain erosion, automatic painting (sand by the shore, grass on flats, rock on slopes, snow up high) and tree scattering.
Other settings: resolution (129 to 2049 samples a side), size in metres, heightmap import / export (8-bit PNG or 16-bit RAW), grass (grows on a chosen layer, with density, height, distance and colour) and draw distances.
In scripts
local y = terrain.height(x, z) -- nil off the terrain
local index, name = terrain.layer(x, z) -- e.g. 2, "dirt" (footstep sounds use this)
terrain.raise(x, z, 4, -2) -- dig a 2 m hole, 4 m across
terrain.paint(x, z, 4, 3) -- paint layer 3
terrain.flatten(x, z, 6, 10) -- level to height 10
terrain.add_tree(x, z, 1, 1.2)
terrain.remove_trees(x, z, 5)
When you play in the editor, script edits go to a copy of the terrain, so stopping restores it.
How it works
Heights, paint and trees are saved in assets/terrain/<name>.terrain along with the scene. The terrain is
cut into 32×32-quad chunks with four levels of detail; distant chunks use fewer triangles, and skirts hide
the seams. The PBR shader blends the paint layers per pixel using their heights, so rock shows between
grass blades naturally, and it breaks up tiling at a distance. Collision is a Jolt height field.
Limits
- One height per point: no caves, overhangs or holes.
- Rotating or scaling a terrain object is ignored; set its size in the Inspector.
- Grass doesn't sway in the wind yet, and trees have no billboard impostors (they use model LODs).
- Brushes run on the CPU: smooth up to 1025², slower at 2049².