---
id: "thermal-erosion"
title: "Thermal (Talus) Erosion"
aliases: [thermal weathering, talus relaxation]
domain: "procgen"
stage: "procedural"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, cpu, houdini, unity, unreal, godot, python]
year_introduced: 1989
inputs: [heightfield]
outputs: [heightfield]
style: "both"
dynamic: "static"
cost: "cheap"
authority: "Musgrave et al., 1989"
url: "https://texelatlas.vercel.app/t/thermal-erosion/"
sources_verified_at: "2026-11-29"
---
# Thermal (Talus) Erosion (Musgrave et al., 1989)

> Iteratively moves material from a cell to lower neighbours wherever the slope exceeds an angle of repose, softening steep noise-generated cliffs into talus slopes and aprons.

## Reach for it when

- noise terrain has spiky steep cliffs
- need scree slopes under cliffs
- want a cheap finishing pass to soften peaks
- slopes steeper than angle of repose look fake

## How it works

For every cell of a heightfield, compare its height with each of its 4 or 8 neighbours. If the drop to a neighbour exceeds the talus threshold (tan of the repose angle times cell spacing), a fraction of the excess is moved to that neighbour, split among all lower neighbours in proportion to their drop. Repeating the pass lets slopes relax toward the threshold angle. It is local, deterministic and embarrassingly parallel, which makes it a GPU-friendly ping-pong pass. Variants add a hardness map so rock layers resist erosion, or move material only when the slope is under a maximum so cliffs are preserved. Musgrave's 1989 paper introduced it alongside hydraulic erosion on fractal terrain.

## When to use it

Choose it as a cheap finishing pass to knock the spikes off [Fractal Brownian Motion and Multifractals](https://texelatlas.vercel.app/t/fractal-brownian-motion.md) terrain and to build scree slopes under cliffs. Prefer [Interactive Hydraulic Erosion on Heightfields](https://texelatlas.vercel.app/t/hydraulic-erosion-stava.md) or [GPU Pipe-Model Hydraulic Erosion](https://texelatlas.vercel.app/t/gpu-pipe-model-erosion.md) when you need river valleys and sediment deposition, and [Stream-Power Erosion (Fluvial Terrain Uplift)](https://texelatlas.vercel.app/t/stream-power-erosion.md) for large-scale drainage-driven mountain shapes.

## Cost

cheap — One neighbourhood pass per iteration; dozens to hundreds of iterations are typical for convincing talus, so total cost scales with iteration count.
Measured GPU Weight: 511.23× baseline (extreme) — 16.8195 ms median / 17.145 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 432.01× baseline (extreme) — 6.869 ms median (2.45× faster on L4).
Ampere A100 scaling: 367.91× baseline (extreme) — 10.5958 ms median (1.59× faster on A100).

## Failure modes

- Few iterations leave the original noise visible; many iterations over-smooth the entire terrain into a blob
- Grid-aligned diamond or square slope artifacts with 4-neighbour variants
- Without a hardness mask all rock behaves like sand, so crisp cliff bands vanish
- Mass is only conserved if transfers are symmetric; naive in-place updates leak or create height

## Engine support

- unity: official — `Package Manager > Terrain Tools > Erosion > Thermal` (evidence: https://docs.unity3d.com/Packages/com.unity.terrain-tools@5.2/manual/erosion.html, checked 2026-12-01) — Official Terrain Tools package.
- unreal: builtin — `Landscape Mode > Sculpt > Erosion tool` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/landscape-erosion-tool-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: heightfield
- Outputs: heightfield
- Platforms: webgl2, webgpu, desktop-gpu, cpu, houdini, unity, unreal, godot, python

## Presets

### Thermal (Talus) Erosion — steep unstable cliffs > talus angle (left) vs relaxed scree aprons (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_TALUS_SLOPE": 0.65,
  "P_RELAX_AMT": 0.85,
  "P_CAM_ORBIT": 0.38,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_TALUS_SLOPE = 0.65; // P Critical Talus [0.25, 1.2, 0.04]
const float P_RELAX_AMT = 0.85; // P Thermal Slump [0.1, 1.0, 0.02]
const float P_CAM_ORBIT = 0.38; // P Orbit Speed [0.0, 2.0, 0.05]
const float P_SPLIT = 0.48; // P Steep / Talus Split [0.0, 1.0, 0.02]

mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }

float hash21(vec2 p) {
  p = fract(p * vec2(127.1, 311.7));
  p += dot(p, p + 34.5);
  return fract(p.x * p.y);
}

float vnoise(vec2 p) {
  vec2 i = floor(p);
  vec2 f = fract(p);
  vec2 u = f * f * (3.0 - 2.0 * f);
  return mix(
    mix(hash21(i), hash21(i + vec2(1.0, 0.0)), u.x),
    mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0, 1.0)), u.x),
    u.y
  );
}

// Raw steep mesa / jagged butte formation with vertical cliff walls exceeding talus angle
float rawButte(vec2 p) {
  float r1 = length(p - vec2(-0.35, -0.10));
  float r2 = length(p - vec2(0.45, 0.18));
  float jagged = vnoise(p * 2.4) * 0.26 + vnoise(p * 5.6) * 0.10;
  // Steep sheer cliffs
  float m1 = smoothstep(0.95, 0.42, r1 + jagged * 0.55) * 0.92;
  float m2 = smoothstep(0.78, 0.34, r2 + jagged * 0.45) * 0.72;
  return max(m1, m2) + jagged * 0.35 - 0.36;
}

// Thermal-erosion talus relaxation: material slumps downslope to form smooth constant-slope scree cones!
vec2 talusButte(vec2 p, float talusTan, float relaxAmt) {
  float hRaw = rawButte(p);
  // 9-tap neighborhood slope-limited relaxation simulating iterative talus diffusion
  float hSmooth = 0.0;
  float hMax = hRaw;
  float rad = 0.24 * relaxAmt / max(talusTan, 0.25);
  for (int dy = -1; dy <= 1; dy++) {
    for (int dx = -1; dx <= 1; dx++) {
      vec2 off = vec2(float(dx), float(dy)) * rad;
      float hn = rawButte(p + off);
      float dist = length(off);
      // Cone-of-repose lower bound: material from higher neighbor slides down at angle tan(alpha)
      float talusBound = hn - dist * talusTan * 0.85;
      hMax = max(hMax, talusBound);
      hSmooth += hn;
    }
  }
  hSmooth /= 9.0;
  float hRelax = mix(hRaw, max(hSmooth * 0.65 + hRaw * 0.35, hMax), relaxAmt);
  float screeMask = clamp((hRelax - hRaw) * 7.5, 0.0, 1.0);
  return vec2(hRelax, screeMask);
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  bool isThermal = screenX >= split;
  float talus = clamp(P_TALUS_SLOPE, 0.2, 1.4);
  float relax = clamp(P_RELAX_AMT, 0.05, 1.0);
  float spin = iTime * max(P_CAM_ORBIT, 0.0) * 0.35;

  vec3 ro = vec3(0.0, 1.18, 2.48);
  vec3 rd = normalize(vec3(uv.x, uv.y - 0.34, -1.35));
  ro.xz = rot2(spin) * ro.xz;
  rd.xz = rot2(spin) * rd.xz;

  vec3 sky = mix(vec3(0.92, 0.68, 0.48), vec3(0.20, 0.38, 0.68), smoothstep(-0.08, 0.52, rd.y));
  vec3 col = sky;

  float t = 0.2;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    vec3 p = ro + rd * t;
    float h = isThermal ? talusButte(p.xz, talus, relax).x : rawButte(p.xz);
    float d = p.y - h;
    if (d < 0.008) { hit = true; break; }
    t += max(d * 0.42, 0.025);
    if (t > 12.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    float e = 0.016;
    vec2 val = isThermal ? talusButte(p.xz, talus, relax) : vec2(rawButte(p.xz), 0.0);
    float hx = isThermal ? talusButte(p.xz + vec2(e, 0.0), talus, relax).x : rawButte(p.xz + vec2(e, 0.0));
    float hz = isThermal ? talusButte(p.xz + vec2(0.0, e), talus, relax).x : rawButte(p.xz + vec2(0.0, e));
    vec3 n = normalize(vec3((val.x - hx) / e, 1.0, (val.x - hz) / e));

    vec3 sunDir = normalize(vec3(0.68, 0.55, 0.48));
    float diff = max(dot(n, sunDir), 0.0);
    // Tangent of local terrain slope = |grad h| = sqrt(1 - n.y^2) / n.y
    float tanSlope = length(n.xz) / max(n.y, 0.05);
    float overTalus = smoothstep(talus * 0.85, talus * 1.45, tanSlope);

    // Desert sandstone strata on bedrock vs loose pale gravel scree on talus aprons
    float strata = 0.5 + 0.5 * sin(val.x * 36.0 + vnoise(p.xz * 4.0) * 2.0);
    vec3 bedrock = mix(vec3(0.58, 0.30, 0.20), vec3(0.78, 0.48, 0.30), strata);
    vec3 scree = mix(vec3(0.62, 0.54, 0.44), vec3(0.76, 0.68, 0.56), vnoise(p.xz * 18.0));
    vec3 floorSand = vec3(0.74, 0.58, 0.42);

    vec3 alb = mix(floorSand, bedrock, smoothstep(-0.22, 0.12, val.x));
    if (isThermal) {
      alb = mix(alb, scree, clamp(val.y * 0.92, 0.0, 0.95));
    } else {
      // On left side, highlight unstable cliffs exceeding critical talus angle in warning red-orange!
      alb = mix(alb, vec3(0.98, 0.24, 0.16), overTalus * 0.62);
    }

    vec3 lit = alb * (0.25 + 0.90 * diff) + vec3(0.24, 0.34, 0.52) * 0.18 * (0.5 + 0.5 * n.y);
    col = mix(lit, sky, 1.0 - exp(-t * 0.075));
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
  col = mix(col, vec3(0.95, 0.97, 1.0), sep);

  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Lineage

- extended by [GPU Pipe-Model Hydraulic Erosion](https://texelatlas.vercel.app/t/gpu-pipe-model-erosion.md)

## Combines with

- [GPU Pipe-Model Hydraulic Erosion](https://texelatlas.vercel.app/t/gpu-pipe-model-erosion.md): Thermal relaxation runs after the hydraulic step to stabilise steep banks the water pass carves.

## Sources

1. [primary] F. K. Musgrave, C. E. Kolb, R. S. Mace (1989) The synthesis and rendering of eroded fractal terrains. ACM SIGGRAPH Computer Graphics. https://doi.org/10.1145/74334.74337 (verified via crossref on 2026-11-29)
2. [implementation] dandrino (2018) dandrino/terrain-erosion-3-ways. https://github.com/dandrino/terrain-erosion-3-ways License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Thermal (Talus) Erosion." https://texelatlas.vercel.app/t/thermal-erosion/ (accessed 2026-12-01).
