Thermal Erosion
Paint mountains onto a heightmap, then watch gravity pull material downhill. When the slope between adjacent cells exceeds a threshold, material slides from high to low — purely gravity-driven thermal weathering, no water involved. The angle of repose shapes everything.
What’s happening
Thermal erosion
Unlike hydraulic erosion (which uses water flow to carve channels), thermal erosion models gravity-driven weathering. Rock exposed to freeze-thaw cycles fractures and tumbles downslope. In this simulation, each cell compares its height to its neighbors. If the height difference exceeds a talus threshold — the tangent of the angle of repose — material transfers from the higher cell to the lower one.
The algorithm
for each cell (i, j):
for each neighbor (ni, nj):
diff = height[i][j] - height[ni][nj]
if diff > talusThreshold:
transfer = rate * (diff - talusThreshold)
height[i][j] -= transfer
height[ni][nj] += transfer
The angle of repose
The talus threshold corresponds to the angle of repose — the steepest angle at which loose material remains stable. For dry sand it is about 34°; for angular gravel, around 45°. Below this angle, the slope is stable. Above it, material slides until the slope relaxes back to the critical angle. This is why scree slopes, sand dunes, and volcanic cinder cones all have characteristic constant slopes.
What differs from hydraulic erosion
Hydraulic erosion simulates water droplets that carry sediment and carve channels. Thermal erosion has no water — material simply slides downhill under gravity. Hydraulic erosion creates river valleys and branching drainage networks; thermal erosion smooths peaks and fills valleys, creating talus cones and scree fields. Real landscapes are shaped by both processes together.
Convergence
Given enough iterations, thermal erosion always converges: the terrain flattens until no slope exceeds the threshold. The lower the threshold, the flatter the final terrain. At zero threshold, the terrain converges to a perfectly flat surface at the mean height.