Post

Terrain Lab

Terrain Lab lets you dig into the landscape, pile more ground on top, smooth it out or flatten an area.

Terrain Lab lets you dig into the landscape, pile more ground on top, smooth it out or flatten an area. You can plant a forest, or wake up a volcano and see what happens to the place.

I used Surface Nets to turn a density field into the terrain you see. The brush changes that density directly, then rebuilds the affected cells in the same frame. So when you’re sculpting, the ground changes right under the brush.

Generating more of the world happens separately in a pool of Web Workers. Buffers get passed between them, and predictive streaming gets terrain ready as you move around. The chunks share world-space samples and samples just beyond their edges, with consistent rules for which chunk owns an edge. That keeps the neighboring pieces lined up.

You can save a world as JSON, export the loaded terrain as an OBJ, or save a playable HTML snapshot. Three.js is embedded in the single-file build.

Project page