Terrain and vegetation
Terrain
Section titled “Terrain”A terrain is open ground: hills, valleys, fields. It is made of three assets:
- a Heightfield: the shape, a grid of heights;
- a Splatmap: where each ground texture is painted;
- a Terrain: what it looks like, tying the two together with the textures.
Making a terrain
Section titled “Making a terrain”- Create > Terrain > Heightfield. A new one is flat. Set its Grid Size (257 points a
side at first; it must be a multiple of 64, plus one), World Size (256 by 256 m), and its
Min Height and Max Height, the range its heights span (0 to 64 m). Or import a
16-bit
.pngor.r16height image instead, from a terrain tool or a map. - Create > Terrain > Terrain. Open it, set its Heightfield, and press one of the Create weights buttons (512, 1024 or 2048) to give it a splatmap of that size.
- Under Base layer, set the textures of the ground everywhere: albedo (colour), normal, ORM (occlusion, roughness and metal in one) and height. Base tile is how large the texture repeats.
- Under Paint layers, add the textures you will paint over it: grass, rock, sand, snow.
- Add an entity with Add Component > Terrain and set its Terrain.
The terrain is centred on its entity. Lod Bias on the component trades detail far away for speed, and Cast Shadows can be turned off.
Shaping and painting
Section titled “Shaping and painting”With the terrain in the scene, the scene page’s toolbar has a Terrain menu of tools that work in the viewport. Each has a brush: its Radius is under the tool’s panel, and Shift+wheel changes it as you paint.
- Sculpt Terrain:
Raise,Lower,SmoothandFlatten(keys 1 to 4), with a Strength. Ctrl+click picks the height to flatten to. - Paint Splat: paints a paint layer (keys 1 to 9) over the base. 0 erases back to the base, and - smooths. Stamp spacing and Airbrush change the stroke.
- Cut Holes: cuts the surface away, for a cave mouth or a tunnel: nothing draws, collides, walks or grows there. Key 2 fills a hole again.
Each stroke is one undo step. Saving the scene saves the heights into the heightfield.
Walking on it
Section titled “Walking on it”Terrain is not solid by itself. Give its entity a Rigid Body with Shape Heightfield and
the same Heightfield, as Physics describes. Navigation needs
no collider: its bake walks on terrain directly.
Vegetation
Section titled “Vegetation”Grass, flowers, bushes, trees and rocks, in their thousands. Add Add Component > Terrain Vegetation to the terrain’s entity. It holds two kinds of layer, each one mesh with its materials.
Procedural layers: grown for you
Section titled “Procedural layers: grown for you”A procedural layer grows its mesh where you say, at a Density (instances per square metre). Nothing is stored per plant, so a field of grass costs no memory to keep. Placement says where:
Uniform: everywhere.Splat: where a paint layer of the terrain is painted, past Splat Threshold: grass where the grass texture is.Mask(the default): where you paint its plane of a Vegetation Mask.SplatTimesMask: both.
For Mask, make a Vegetation Mask (Create > Terrain > Vegetation Mask), set it as the
component’s Mask, and paint it with the Paint Vegetation tool, in the toolbar’s
Vegetation menu: Mask Plane says which of the mask’s planes the layer follows. A new
layer grows nothing until its mask is painted.
Prop layers: placed by you
Section titled “Prop layers: placed by you”A prop layer holds instances you place one stroke at a time with the Paint Props tool: a handful of boulders, the trees along a path. Keys 1 to 9 pick the layer, and Density /m2 and Spacing (x radius) set how close together they land.
Settings of every layer
Section titled “Settings of every layer”- Scale Range: each instance is scaled at random between two values.
- Max Slope: no instances on ground steeper than this, in degrees.
- Height Range: only between these heights.
- Align To Normal: lean with the ground, instead of standing upright.
- Fade Start and Fade End (40 and 80 m): instances fade out with distance between these.
- Cast Shadows: off at first; shadows of many plants cost time.
- Collision Radius and Collision Height: above 0, each instance is solid, an upright capsule of that size: tree trunks. Leave it at 0 for grass.