WebGPU · three.js · React Three Fiber

threejs-biomes: Whole worlds from one seed.

Climate, continents, mountain ranges, rivers and volcanoes, sorted into 20 blended biomes on an infinite plane or a whole planet. Streaming terrain takes you from orbit down to the ground an ant walks on.

screenshot · terrain.html open ↗
Rivers meandering through a valley between mountain ranges on a generated world
20blended biomes
2surfaces: plane or planet
8world map modes
1 cmto orbit, one camera
Getting started

A planet in a few lines.

Make a World from a seed, hand it to WorldTerrain, and steer with SurfaceControls. Chunks build in workers if you give it one, and every setting can change while it runs.

three.jsthreejs-biomes
import { World, WorldTerrain, SurfaceControls } from 'threejs-biomes'

const world = new World({ seed: 'pangaea', surface: 'sphere', radius: 60_000 })
const controls = new SurfaceControls(camera, renderer.domElement, world) // 1 cm … orbit
const terrain = await WorldTerrain.create({ world, camera, scene })

renderer.setAnimationLoop(() => {
  controls.update()
  terrain.setOrigin(controls.origin) // floating origin
  renderer.render(scene, camera)
})

world.biomeAt(120, -40).name               // 'Temperate deciduous forest'
world.set({ mountains: { height: 1600 } }) // live: chunks rebuild
React Three Fiberthreejs-biomes/react
import { useWorld, WorldTerrain } from 'threejs-biomes/react'

function Scene() {
  const world = useWorld({
    seed: 'pangaea',
    mountains: { height: 1200 },
    rivers: { enabled: true },
  })
  return (
    <WorldTerrain
      world={world}
      lodFactor={2.5}
      material={{ debug: 'biomes' }}
    />
  )
}
Install npm i threejs-biomes three Full API reference → React components →
What's in the box

Everything a world needs.

Climate first, then height, then biomes, then ground. Every step is a deterministic function of the seed and a position, so worlds never end and never change behind your back.

01

Twenty biomes

Blended, never cut.

Each biome has a centre in climate space, and every point blends its nearest few, so forests thin into grassland instead of stopping at a line. The table is plain JSON in BIOMES: edit it or replace it.

  • Deep ocean
  • Beach and coast
  • Temperate grassland
  • Deciduous forest
  • Temperate rainforest
  • Boreal forest (taiga)
  • Tundra
  • Glacier and ice sheet
  • Alpine meadow
  • Mountain peaks
  • Hot desert (erg)
  • Badlands (mesa)
  • Savanna
  • Tropical rainforest
  • Tropical dry forest
  • Mediterranean shrubland
  • Cold steppe
  • Wetland
  • Mangrove
  • Volcanic
Terrain tinted by biome from high abovedebug: 'biomes'
02

Climate drives it

Temperature, moisture, wind.

Continentalness, erosion, temperature and moisture fields come first. Temperature falls 6.5 °C per kilometre of height and mountains cast rain shadows, so peaks are cold and their lee sides dry. renderWorldMap draws any field as a top-down map.

The sandbox with its options panel and a temperature map overlaymap overlay
03

Flat worlds and planets

One switch: surface.

An infinite plane for games that think in x and z, or a whole sphere with a real horizon. On a planet, LocalFrame gives any spot a flat (x, z) => y view, so height-function packages work unchanged.

A flat world with rivers and mountainssurface: 'plane'
The curved horizon of a generated planetsurface: 'sphere'
04

From orbit to an ant

One camera, every scale.

SurfaceControls zooms from 1 cm to orbit with automatic near and far planes. A floating origin keeps the camera near render-space zero, so the ground stays precise at planet scale.

A whole generated planet seen from orbit
05

Streaming LOD terrain

A quadtree that follows the camera.

A flat grid or a cube-sphere quadtree splits where you look and merges behind you. Skirts hide the seams, noise octaves below a chunk's resolution are skipped, and chunks build in Web Workers under a per-frame time budget.

Terrain chunks tinted by level of detaildebug: 'lod'
06

Shaped by the land

Ranges, rivers, volcanoes.

Ridged mountain ranges, eroded hills, rivers carved toward the sea and rare volcanoes with craters. Biomes shape their own ground too: desert dunes, mesa terraces, tundra hummocks, flat wetlands and glacier crevasses.

Tall mountain ranges above river valleysmountains.height: 1800
07

Plain data, all live

Save it, share it, send it to a worker.

Every option is JSON. world.set() rebuilds the terrain progressively, and height, biomeAt and sampleAt answer gameplay questions. Data-only modifiers flatten circles and paths, which is how towns level their roads and lots.

A generated valley with rivers
08planned

Real erosion

For bounded maps.

GPU hydraulic erosion baked into a tile and cached, for maps with edges. Infinite worlds keep the cheap eroded noise they use today.

PLANNED

Go make a world.

Fly from orbit to the ground in the live demo, or go straight to the API reference.