Three.js Ancient Ruins (Weathered Stone Temple)

A procedurally weathered Greek-style temple in Three.js, with fluted column drums eroded by 3D noise, broken and fallen columns, gapped cella walls, rubble, creeping overgrowth and golden-hour light with exponential fog.

Key topics: ancient ruins, procedural ruins, three.js stone, erosion noise, temple, weathering

What this code does

- Layout: a peristyle of 6 × 11 columns on a stepped stylobate around a walled cella, like a classical temple plan.
- Fluted Drums: each drum's vertices are scaled by 1 − 0.04·|sin(10θ)| for 20 flutes, then pulled inward by 3D noise proportional to erosion.
- Ruin Logic: erosion decides which columns stay intact (with capitals and entablature), how many drums survive, which wall blocks are missing and how much rubble lies around.
- Overgrowth: low-poly leaf clumps are instanced onto stones and scattered as tufts, in one draw call.
- Atmosphere: ACES tone mapping, soft shadows and FogExp2 tinted to each lighting preset.
- Controls: erosion, overgrowth, light preset and seed.

Continue Learning

JavaScript Implementation

ES6+
// Weathered column drum: flute the cylinder, then eat into it with 3-D noise
const g = new THREE.CylinderGeometry(0.62, 0.66, 1.1, 20)
const p = g.attributes.position
for (let i = 0; i < p.count; i++) {
  const a = Math.atan2(p.getZ(i), p.getX(i))
  const flute = 1 - 0.04 * Math.abs(Math.sin(a * 10))         // 20 flutes
  const wear = 1 - erosion * 0.12 * (noise3(p.getX(i) * 3, p.getY(i) * 3, p.getZ(i) * 3) * 0.5 + 0.5)
  p.setX(i, p.getX(i) * flute * wear); p.setZ(i, p.getZ(i) * flute * wear)
}
g.computeVertexNormals()
// Erosion also removes whole drums/blocks at random → broken columns, gaps and rubble