Thermal (Talus) Erosion
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.
Also known as thermal weathering, talus relaxation
In the family Procedural generation, terrain erosion
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | No built-in terrain thermal/talus erosion solver. |
| Unity | Official add-on | Package Manager > Terrain Tools > Erosion > Thermal docs Official Terrain Tools package. |
| Unreal 5.7 | Built in | Landscape Mode > Sculpt > Erosion tool docs |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
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 choose it
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
Choose it as a cheap finishing pass to knock the spikes off Fractal Brownian Motion and Multifractals terrain and to build scree slopes under cliffs. Prefer Interactive Hydraulic Erosion on Heightfields or GPU Pipe-Model Hydraulic Erosion when you need river valleys and sediment deposition, and Stream-Power Erosion (Fluvial Terrain Uplift) for large-scale drainage-driven mountain shapes.
Field marks
- 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
Presets
Thermal (Talus) Erosion — steep unstable cliffs > talus angle (left) vs relaxed scree aprons (right)
{
"P_TALUS_SLOPE": 0.65,
"P_RELAX_AMT": 0.85,
"P_CAM_ORBIT": 0.38,
"P_SPLIT": 0.48
}Show GLSL (129 lines)
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.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| thermal-erosion-live | Tesla T4 1920x1080 | 511× baseline (extreme) · 16.8 ms / 17.1 ms | opengl-timer-query · 16 frames · GPU Weight Atlas · Colab T4 sweep |
| thermal-erosion-live | NVIDIA L4 1920x1080 | 432× baseline (extreme) · 6.87 ms / 6.99 ms · 2.5× faster on L4 | opengl-timer-query · Cross-architecture validation |
| thermal-erosion-live | NVIDIA A100-SXM4-40GB 1920x1080 | 368× baseline (extreme) · 10.6 ms / 10.7 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
Crosses
- GPU Pipe-Model Hydraulic Erosion: Thermal relaxation runs after the hydraulic step to stabilise steep banks the water pass carves.
Sources
- primaryF. K. Musgrave, C. E. Kolb, R. S. Mace (1989). The synthesis and rendering of eroded fractal terrains. ACM SIGGRAPH Computer Graphics.Verified via crossref · 2026-11-29doi:10.1145/74334.74337
- implementationdandrino (2018). dandrino/terrain-erosion-3-ways. Three Ways of Generating Terrain with Erosion FeaturesGitHub API · license MIT · 2026-11-29