menu_bookDocumentation

Terrain System — heightmap creation, material painting, and sculpting

calendar_today May 5, 2026 schedule ~2 min read person patrickjr verified 50

Terrain System

s&box terrain is a heightmap-based landscape system with material painting, sculpting tools, and built-in LOD. Terrain data is stored in a reusable .terrain asset that can be shared across multiple scenes.

Creating Terrain

  1. Right-click in the Hierarchy → 3D Object → Terrain
  2. In the Inspector, click Create New Terrain
  3. Choose heightmap size, world scale, and max height, then save the .terrain asset

Key Settings

SettingDescription
Heightmap SizeResolution of the heightmap. 2048×2048 = 24MB VRAM, 4096×4096 = 96MB
World ScaleInches per heightmap texel. 39 inches ≈ 1 meter is a good default
Max HeightMaximum terrain height in inches. Higher = less precision at low elevations

Terrain Materials

Terrain uses .tmat (Terrain Material) assets — specialized PBR materials with terrain-specific shaders and LOD blending. They differ from standard .vmat materials.

  • The first material applied becomes the base layer covering the whole terrain
  • Additional materials are painted on top with blending
  • Limit: 4 terrain materials per terrain (planned to be increased)

Creating a Terrain Material

In the Inspector with the Terrain selected → New Terrain Material… — or right-click in the Asset Browser → New Asset → New Terrain Material…

Find cloud terrain materials by filtering: @cloud ext:tmat

Sculpting Tools

The editor provides brush-based tools for sculpting:

  • Raise/Lower — push height up or down
  • Smooth — blend height differences
  • Flatten — level to a target height
  • Paint Texture — blend terrain materials

Terrain and Clutter

Terrain integrates with the Clutter System. Use the Terrain Material scatterer in a Clutter Definition to automatically place objects (grass, rocks) based on which terrain material is painted at each point.

Accessing Terrain in Code

CSHARP
// Get the terrain component
var terrain = Scene.GetAll<Terrain>().FirstOrDefault();

// Sample height at a world position
float height = terrain.GetHeightAt( worldPosition );

// Sample the surface normal
Vector3 normal = terrain.GetNormalAt( worldPosition );

Performance Notes

  • Terrain uses GPU-based LOD — distant areas render at lower resolution automatically
  • Keep heightmap size as small as your detail requirements allow — VRAM cost scales quadratically
  • Combine with IndirectLightVolume for realistic bounce lighting across the landscape
Was this helpful?