← Technical Notes F26

Lidar terrain, rail splines and PCG forests in UE5

Technical notes · Empire Builder · VFX 380, Fall 2026

Empire Builder is a seven by seven kilometre stretch of the Columbia River with a train running through it. Almost every part of it is generated: the ground from survey data, the rail line from a script, the forest from PCG graphs. That only works if the pieces agree, so they share data: one heightmap and one set of masks feed both the landscape and the plants, and one spline carries the track, the train and the clearing in the forest.

Survey data to Landscape

The ground starts as USGS 3DEP elevation: 1 m lidar along the river, with 10 m data filling the far bank. Houdini merges the two, carves the river bed and exports a heightmap plus a set of masks (water, shore, steep slope, erosion flow, the island and the rail bed) that the landscape material and PCG both read.

Shaded relief of the heightmap beside the same area with coloured masks for water, slope, island and rail bed
Heightmap and masks from the same Houdini network

The export also writes a small ue_import.json with the world size, Z scale and the area each mask covers, so PCG can line every mask up with the Landscape.

The rail line is data, not a hand-drawn spline

A Houdini script, rail_route.py, lays out the route: it follows the river, caps the height above the water and keeps clear of the inland pond. It writes a JSON file that Unreal reads, so a change to the brief is a parameter change and a re-run, not points dragged in the editor.

Shaded relief of the valley with the generated rail route drawn in orange along the north bank of the river
The generated route on the terrain: river in blue, ground less than 14 m above it in green

In Unreal the JSON becomes a spline, and BP_RailTrack builds the track on it: two rails as spline meshes at standard gauge, sleepers as instances with a little random offset, and a trapezoid ballast bed under both.

A single curved spline with two control points on a grey ground
The spline
Two steel rails following the same curve
Rails at 1,435 mm gauge
Sleepers added under the rails along the curve
Sleepers every 60 cm
A trapezoid ballast bed added under the sleepers
Ballast bed

One spline, three systems

The same spline drives the track, the train and the vegetation, so moving the route moves all three:

Locomotive and two Superliner cars following the curve of the finished track
Each car placed from two samples on the spline
Blueprint graph that places each train car on the rail spline
The car placement in BP_Train

The forest in layers

The forest is three groups of PCG volumes, each with its own graph, and all of them read the same terrain masks and the rail spline. Built up one group at a time, seen from the same camera:

Bare lidar terrain with the track along the shore
Terrain and track only
The same view with forest on the upper hills
Far layer: forest on the hills
The same view with forest filling the slopes, stopping short of the track
Land layer: the slopes down to the line
The same view with low cover and scattered trees along the track and the shore
Trackside layer: cover along the line and reeds on the shore
PCG graph for the trackside corridor layer
The trackside layer's graph

Plants that respect the camera

Each side of the line is dressed for the camera. The island side, where the shots look from, gets grass and low shrubs; the tall forest wall goes behind the train, and the embankment itself stays bare. Which side faces the island comes from the island's direction and the spline's right vector. For the close shots, plants also keep clear of the sight line from each camera to the train: 7 m for canopy, 3.5 m for shrubs.

Close view of the track: grass and a few small trees on the near side, a conifer forest behind, bare embankment between
Island side low, forest wall behind, embankment bare
PCG graph that removes points inside the rail embankment
Embankment exclusion in PCG

Megaplants

The hero trees are Megaplants: Nanite skinned meshes with built-in wind, enabled with r.Nanite.Foliage=1. Colour variants are material instances that a palette actor applies after PCG generates, so the heavy meshes are never duplicated. Wind is computed around each instance's own pivot, for a sway of 35–80 cm.

What I'd keep