Three.js Mountain Vista (Terrain LOD with THREE.LOD)
A 3.6 km mountain landscape in Three.js built from 81 terrain chunks, each a THREE.LOD with four resolutions, using ridged multifractal noise with domain warping, slope- and height-based snow and rock, a physical sky and fog, with live triangle counts.
Key topics: terrain lod, three.js lod, mountain landscape, ridged multifractal, level of detail, procedural terrain
Game Over
What this code does
- Chunked LOD: every 400 m chunk exists at 96, 40, 14 and 6 segments, and THREE.LOD picks a level from camera distance each frame.
- Savings: the HUD compares triangles drawn with the full-detail count, usually a small fraction of it.
- Cracks: neighbouring chunks at different levels don't share edge vertices, so a small skirt drop hides the gaps.
- Terrain: ridged multifractal noise (each octave weighted by the previous ridge) with domain warping, flattened toward the centre valley lake.
- Materials: vertex colours by height and slope give grass, scree, bare rock on cliffs and snow on high flats.
- Controls: LOD distance multiplier, colour by LOD level, wireframe, sun elevation and fly-over.
Related Demos
Continue Learning
JavaScript Implementation
// Chunked terrain with THREE.LOD: the same tile at several resolutions, switched by distance
for (const [cx, cz] of chunkCentres) {
const lod = new THREE.LOD()
;[128, 48, 16, 6].forEach((segments, k) => lod.addLevel(new THREE.Mesh(tile(cx, cz, segments), material), [0, 700, 1400, 2400][k]))
lod.position.set(cx, 0, cz)
scene.add(lod) // renderer auto-updates LOD each frame
}
// Ridged multifractal: r = (1 − |noise|)², weighted by the previous octave → sharp crests