Terrain Graph Overview

intermediate feature

Voxel 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 worksGenerates 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.
OutputsAltitude, MoistureDensity, Voxel ID, Vegetation ID, Tree ID, Water ID
Generator assetMulti-Step Terrain Generator3D Density Terrain Generator
Best forClassic heightmap worlds, simpler setupComplex 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:

  1. Start with a noise sampler (e.g. Noise 3D, Sample Fractal) to generate base terrain shape
  2. Add a Height Gradient node (3D only) to define where solid meets air
  3. Use math and blend nodes to combine, scale and shape the output
  4. Add a Cave Carver to hollow out underground areas
  5. Connect a Climate Map node for biome-aware voxel selection
  6. 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.For with 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:

TerminalTypeDescription
DensityRequiredVolume density. Positive = solid voxel, negative = air, zero = surface.
Voxel IDOptionalBiome index for selecting which block type to place (connects to biome array)
Vegetation IDOptionalBiome index for grass/flower placement
Tree IDOptionalBiome index for tree generation
Water IDOptionalWater 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:

  1. Noise 2D (frequency 0.01, octaves 4) - base continental shape
  2. Height Gradient (base height 0.3, gradient -2) - solid below 30% height, air above
  3. Blend Additive (A=noise, B=gradient) - combine into terrain density
  4. Noise 3D (frequency 0.05, octaves 3) - 3D variation for caves
  5. Cave Carver (threshold 0.6, strength 1) - hollow out where noise is high
  6. Subtract (A=terrain, B=caves) - final density
  7. 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
Was this page helpful?