Terrain Graph Overview
intermediate featureVoxel Play 4 · 3D Terrain Graph
The 3D Terrain Graph is a visual, node-based editor for designing procedural terrain. Instead of writing code or tweaking numeric arrays, you build a graph of connected nodes that generate, transform and blend noise values into a complete voxel world with biomes, caves, water and vegetation.
Two Graph Systems
Voxel Play 4 includes two terrain graph editors:
| Terrain Graph (2D) | 3D Terrain Graph | |
|---|---|---|
| How it works | Generates a heightmap (altitude + moisture). Terrain is solid below the height, air above. | Generates a 3D density field. Terrain exists wherever density > 0, enabling caves, overhangs and floating islands. |
| Outputs | Altitude, Moisture | Density, Voxel ID, Vegetation ID, Tree ID, Water ID |
| Generator asset | Multi-Step Terrain Generator | 3D Density Terrain Generator |
| Best for | Classic heightmap worlds, simpler setup | Complex worlds with caves, arches, volumetric features |
Getting Started
Step 1: Create a Generator Asset
In the Project window, right-click and choose:
- Create > Voxel Play > Terrain Generators > Multi-Step Terrain Generator for 2D
- Create > Voxel Play > Terrain Generators > 3D Density Terrain Generator for 3D
Name it something descriptive (e.g. "MyWorldTerrain").
Step 2: Open the Graph Editor
Double-click the generator asset in the Inspector to open the visual editor. Alternatively, use the menu Window > Voxel Play > Terrain Graph Editor or 3D Terrain Graph Editor.
Step 3: Build Your Graph
Right-click in the graph area (or press Ctrl+Space) to open the node search menu. Add nodes by category:
- Start with a noise sampler (e.g. Noise 3D, Sample Fractal) to generate base terrain shape
- Add a Height Gradient node (3D only) to define where solid meets air
- Use math and blend nodes to combine, scale and shape the output
- Add a Cave Carver to hollow out underground areas
- Connect a Climate Map node for biome-aware voxel selection
- Wire the final result to the output terminals on the right side of the graph
Step 4: Assign to Your World
In your World Definition asset, set the Terrain Generator field to your generator asset. Press Play to see the result.
Editor Features
Preview Panel
The preview panel shows a real-time visualization of your terrain. Available modes:
- Heightmap - Color-coded altitude (blue = water, green = land, white = peaks)
- Hillshade - 3D shaded relief view
- Biomes - Shows biome assignment colors
- Horizontal Slice (3D only) - Cross-section at a given Y height
- Vertical Slice (3D only) - Side view cross-section
Adjust resolution (32-512px) and use Slice Y slider for 3D preview modes.
Toolbar
- Sync - Toggle live world refresh as you edit the graph
- Auto Layout - Arrange nodes automatically
- Minimap - Toggle with M key for navigation overview
Node Tips
- Right-click a node and select Rename to add a description label
- Use Reroute nodes (right-click > Create Reroute) for cleaner layouts
- Ctrl+C / Ctrl+V to copy and paste nodes
Performance
The graph evaluation includes automatic optimizations:
- Column caching - 2D nodes (noise that only depends on X/Z) are evaluated once per column and cached, avoiding redundant computation across the vertical axis. Up to ~10x speedup for 2D-heavy graphs.
- Multi-core parallelization - 3D evaluation uses
Parallel.Forwith per-thread workspaces. Typical ~5x speedup on modern CPUs. - All-air fast path - Chunks that produce only air are detected early and skipped entirely.
Tip: Prefer 2D noise nodes over 3D noise nodes when the result doesn't need to vary with altitude. The column cache only works for 2D nodes.
3D Graph Outputs
The 3D graph has five output terminals:
| Terminal | Type | Description |
|---|---|---|
| Density | Required | Volume density. Positive = solid voxel, negative = air, zero = surface. |
| Voxel ID | Optional | Biome index for selecting which block type to place (connects to biome array) |
| Vegetation ID | Optional | Biome index for grass/flower placement |
| Tree ID | Optional | Biome index for tree generation |
| Water ID | Optional | Water presence flag (positive = place water) |
ID outputs reference the biome array in your World Definition. For example, if Voxel ID outputs 2, the engine uses the voxel definitions from biomes[2].
Example: Basic 3D World
A minimal 3D terrain graph for a world with mountains and caves:
- Noise 2D (frequency 0.01, octaves 4) - base continental shape
- Height Gradient (base height 0.3, gradient -2) - solid below 30% height, air above
- Blend Additive (A=noise, B=gradient) - combine into terrain density
- Noise 3D (frequency 0.05, octaves 3) - 3D variation for caves
- Cave Carver (threshold 0.6, strength 1) - hollow out where noise is high
- Subtract (A=terrain, B=caves) - final density
- Connect Subtract output to Density terminal
See Also
- Node Reference - Complete list of all available nodes
- Demo 7 (included in package) - Full 3D terrain graph replicating the classic Earth demo
- Demo 8 - Floating Islands example using 3D density generation
Suggest an improvement
Help us improve this documentation page.