Also known as: VDM Repair
Fixes common problems in heavily displaced VDMs: places where the surface folds over or passes through itself, and borders that have been pushed away from the edges of the world.
When to Use
- Spikes, cracks and shading artifacts: Clean up a VDM after strong displacement has tangled its surface.
- Tiling and side-by-side terrains: Pull displaced borders back onto the edges of the world, so terrains tile or sit next to each other without gaps or overhanging lips.
What is a VDM?
A Vector Displacement Map (VDM) is a special terrain representation that stores full 3D position data (X, Y, Z coordinates) for each point on the terrain surface, rather than just elevation values. This enables terrain with overhangs, caves, and other complex features.
What gets repaired
Strong displacement can push parts of a VDM so far that the surface crumples: it folds back on itself, pinches into creases, or passes through neighboring parts of the surface. These tangles render as spikes, cracks and shading artifacts. VDM Repair Surface finds them and smooths them out, leaving the rest of the surface untouched.
Displacement can also push the edges of the terrain inward or outward, so the terrain no longer fills the world extent cleanly. This leaves gaps or overhanging lips at the borders, which show up when tiling or placing terrains side by side. Border repair pulls the edges back onto the boundary of the world.
How to Use
Run it after the last strongly displacing device in a chain, and before exporting or converting the VDM back to a heightfield. By default it repairs intersections only; border repair is off.
- Build a VDM with strong displacement, for example from VDM Displace or VDM Noise.
- Add VDM Repair Surface after it.
- Check the Repaired areas output to see where intersections were fixed.
- If sharp ridges you want to keep are being smoothed, lower Fold Angle Threshold; if tangles remain, raise it.
- If you will tile or place the terrain next to others, enable Repair borders.
Inputs
| Port | Type | Required | Description |
|---|---|---|---|
| Primary Input | VDM | Required | The VDM to repair |
Outputs
| Port | Type | Description |
|---|---|---|
| Primary Output | VDM | The repaired VDM |
| Repaired areas | Heightfield | A mask of where self-intersections were fixed: repaired spots are bright, untouched surface is black. Border repair is not included in this mask |
Parameters
Repair borders
Default: Off
A checkable group. When enabled, the edges of the terrain are pulled back onto the vertical planes at the edges of the world extent. The correction is strongest at the border and fades away toward the interior.
Pinning – Default: Per-axis
- Per-axis: Pins each edge only in the direction across the border (left and right edges are pinned left-right, top and bottom edges are pinned up-down). Points can still slide along the edge, so overhangs and other features that run along the border are kept
- Both axes: Pins the entire border back to its original, undisplaced grid position (heights along the border are kept). Use this when the edges must match exactly, at the cost of flattening sideways features along the border
Falloff width – Default: 0.1 (Range: 0.01 to 0.5, log slider) How far into the interior the border correction reaches, as a fraction of the terrain’s shorter side. Small values confine the fix to a narrow band at the edge, which can look abrupt if the border was displaced a lot; larger values blend the correction over a wider area.
Allow excursions – Default: Off When off, any point inside the terrain that has been displaced beyond the world extent is pulled back inside it. When on, those points are left where they are, and only the border itself is corrected.
Repair Intersections
Default: On
A checkable group. When enabled, the device finds places where the surface folds over or passes through itself and smooths them out.
Fold Angle Threshold – Default: 30 degrees (Range: 0 to 120 degrees) How sharply the surface has to fold before it counts as a fold that needs repair. The angle is measured between neighboring parts of the surface: 0 degrees is folded completely flat back onto itself, 180 degrees is perfectly flat. Lower values only fix the most severe folds and preserve sharp features; higher values also smooth out sharp creases and ridges.
Tips and Tricks
- The Repaired areas mask is a good guide for adding texture or debris over spots that were smoothed.
- Border repair leaves terrain whose edges already sit on the world boundary untouched, and running it again on its own output changes nothing.
Limitations
- The device is slow on large surfaces, and it cannot be masked.
- The device shows a notice that it may not be fully compatible with tiled builds or layout view.