Weathering simulation (weathered stone)
Physically motivated ageing of surfaces: water flow, dust and salt deposition and erosion are simulated on the mesh to produce stains, crusts and wear that follow geometry and exposure rather than random noise.
In the family Materials, BRDFs & texturing, procedural texturing
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 | |
| Unity | None found | |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Dorsey et al. model stone as a slab of layers with a water-transport simulation. Rainwater flows over the surface following gravity and exposure; where water seeps in it dissolves and transports minerals and, depending on the wetness and the saturation, deposits them in layers or erodes material. Surface and subsurface moisture are tracked on a volumetric grid (slab) beneath each surface point, and weathering creates stains, crusts (gypsum), erosion and discolouration. Appearance is rendered with subsurface-scattering since weathered stone is translucent and layered. Later work (gamma-ton tracing, Chen et al. 2005) replaces the fluid simulation with particle tracing, a stochastic transport of weathering agents across the surface, which handles dust, rust, moss and peeling paint in much less time.
When to choose it
Reach for it when
- stone surfaces look too clean and new
- need realistic aging and water stains on buildings
- procedural dirt and erosion on materials
- make models look weathered over time
Choose it when weathering must respond to geometry, orientation and exposure: ruins, monuments, rusting machinery. Prefer curvature- and AO-driven procedural masks in material shaders when you need a fast approximation in real-time. Prefer Procedural noise for texturing for unstructured variation, and Image quilting to extend a scanned weathered exemplar.
Field marks
- Needs a watertight, well-tessellated mesh and parameter tuning per material
- Simulation time and memory scale with grid resolution
- Results look plausible but are not predictive of real ageing
- Artist control is indirect; fixing one stain requires re-running the simulation
Presets
Stone Weathering Simulation — fresh carved limestone (left) vs moss, rain streaks & edge erosion (right)
{
"P_AGE_YEARS": 0.78,
"P_MOSS_WET": 0.82,
"P_RAIN_STREAK": 0.85,
"P_SPLIT": 0.46
}Show GLSL (138 lines)
const float P_AGE_YEARS = 0.78; // P Weathering Age [0.05, 1.0, 0.02]
const float P_MOSS_WET = 0.82; // P Moss & Moisture [0.0, 1.4, 0.04]
const float P_RAIN_STREAK = 0.85; // P Rain Wash Streaks [0.0, 1.5, 0.05]
const float P_SPLIT = 0.46; // P Fresh / Weathered [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
);
}
float fbm(vec2 p) {
float a = 0.5, s = 0.0;
for (int i = 0; i < 4; i++) {
s += a * vnoise(p);
p = p * 2.04 + vec2(13.7, 7.3);
a *= 0.5;
}
return s;
}
float sdBox(vec3 p, vec3 b) {
vec3 q = abs(p) - b;
return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}
// Architectural stone balustrade / temple shrine plinth
float mapStone(vec3 p, float erodeAmt) {
float base = sdBox(p - vec3(0.0, -0.52, 0.0), vec3(0.76, 0.16, 0.52)) - 0.02;
float colL = sdBox(p - vec3(-0.44, 0.02, 0.0), vec3(0.18, 0.42, 0.24)) - 0.02;
float colR = sdBox(p - vec3(0.44, 0.02, 0.0), vec3(0.18, 0.42, 0.24)) - 0.02;
float lintel = sdBox(p - vec3(0.0, 0.52, 0.0), vec3(0.72, 0.14, 0.34)) - 0.02;
float d = min(min(base, lintel), min(colL, colR));
// Subtle physical stone chipping & surface pitting increases with age
float pit = (fbm(p.xy * 7.5 + p.z * 3.1) - 0.5) * 0.028 * erodeAmt;
return (d + pit) * 0.85;
}
vec3 calcNormal(vec3 p, float erodeAmt) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapStone(p + e.xyy, erodeAmt) - mapStone(p - e.xyy, erodeAmt),
mapStone(p + e.yxy, erodeAmt) - mapStone(p - e.yxy, erodeAmt),
mapStone(p + e.yyx, erodeAmt) - mapStone(p - e.yyx, erodeAmt)
));
}
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 isWeathered = screenX >= split;
float age = clamp(P_AGE_YEARS, 0.05, 1.0);
float mossGain = clamp(P_MOSS_WET, 0.0, 1.5);
float streakGain = clamp(P_RAIN_STREAK, 0.0, 1.6);
float spin = sin(iTime * 0.38) * 0.42;
vec3 ro = vec3(0.0, 0.16, 2.38);
vec3 rd = normalize(vec3(uv - vec2(0.0, 0.03), -1.48));
ro.xz = rot2(spin) * ro.xz;
rd.xz = rot2(spin) * rd.xz;
vec3 col = mix(vec3(0.030, 0.036, 0.052), vec3(0.075, 0.092, 0.128), smoothstep(-0.55, 0.55, uv.y));
float erodeAmt = isWeathered ? age : 0.05;
float t = 0.0;
bool hit = false;
for (int i = 0; i < 60; i++) {
float d = mapStone(ro + rd * t, erodeAmt);
if (d < 0.0025) { hit = true; break; }
t += d;
if (t > 6.0) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p, erodeAmt);
vec3 lDir = normalize(vec3(0.62, 0.78, 0.52));
float diff = max(dot(n, lDir), 0.0);
float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 22.0);
// Multi-scale ambient occlusion / crevice accessibility & convex edge curvature
float dNear = mapStone(p + n * 0.08, erodeAmt);
float dMid = mapStone(p + n * 0.22, erodeAmt);
float ao = clamp(0.32 + 0.68 * (dNear / 0.08 * 0.5 + dMid / 0.22 * 0.5), 0.18, 1.0);
float crevice = clamp(1.0 - ao, 0.0, 1.0);
float edgeWear = clamp((dNear - 0.078) * 18.0, 0.0, 1.0);
// Base fresh warm limestone
float grain = fbm(p.xy * 12.0 + p.z * 5.0);
vec3 stoneAlb = mix(vec3(0.76, 0.72, 0.64), vec3(0.88, 0.84, 0.76), grain);
if (isWeathered) {
// 1) Gravity-driven vertical rain-runoff stains & calcium carbonate leaching streaks under lintel!
float streakNoise = fbm(vec2(p.x * 16.0 + p.z * 9.0, p.y * 2.2));
float underLintel = smoothstep(0.55, 0.32, p.y) * smoothstep(-0.55, 0.35, p.y) * (1.0 - abs(n.y));
float streaks = smoothstep(0.42, 0.72, streakNoise) * underLintel * streakGain * age;
// 2) Upward-facing & damp-crevice biological moss colonization
float mossNoise = fbm(p.xz * 9.0 + p.y * 4.0);
float mossMask = smoothstep(0.38, 0.72, n.y * 0.65 + crevice * 0.75 + mossNoise * 0.45 - 0.32) * mossGain * age;
mossMask = clamp(mossMask, 0.0, 1.0);
// 3) Soot/dirt darkening inside recessed crevices + pale leached limestone on exposed convex edges
stoneAlb = mix(stoneAlb, vec3(0.24, 0.22, 0.20), clamp(crevice * 0.85 * age + streaks * 0.62, 0.0, 0.85));
stoneAlb = mix(stoneAlb, vec3(0.92, 0.90, 0.84), edgeWear * 0.55 * age);
vec3 mossCol = mix(vec3(0.14, 0.34, 0.12), vec3(0.34, 0.54, 0.16), mossNoise);
stoneAlb = mix(stoneAlb, mossCol, mossMask);
// Damp glossy sheen along rain runoff channels
spec *= (0.65 + 1.45 * streaks);
}
col = stoneAlb * (0.24 + 0.84 * diff) * ao + vec3(0.96, 0.94, 0.90) * spec * 0.22;
}
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 |
|---|---|---|---|
| weathering-simulation-live | Tesla T4 1920x1080 | 100× baseline (extreme) · 3.29 ms / 3.54 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| weathering-simulation-live | NVIDIA L4 1920x1080 | 87.8× baseline (extreme) · 1.40 ms / 1.41 ms · 2.4× faster on L4 | opengl-timer-query · Cross-architecture validation |
| weathering-simulation-live | NVIDIA A100-SXM4-40GB 1920x1080 | 70.9× baseline (extreme) · 2.04 ms / 2.08 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Unidirectional Path Tracing, Perlin Noise (gradient lattice noise); cited by GPU Pipe-Model Hydraulic Erosion, Stream-Power Erosion (Fluvial Terrain Uplift).
Crosses
- Weathering that creeps along the surface: Rust that spreads from bolt holes, moss from damp bases, dirt from ledges, measured along the surface so it turns corners and follows grooves instead of jumping gaps. Re-sourcing is almost instant, so artists paint sources and iterate.
Sources
- primaryJulie Dorsey, Alan Edelman, Henrik Wann Jensen, Justin Legakis, Hans Køhling Pedersen (1999). Modeling and rendering of weathered stone. Proceedings of the 26th annual conference on Computer graphics and interactive techniques - SIGGRAPH '99.Verified via crossref · 2026-11-29doi:10.1145/311535.311560
- primaryYanyun Chen, Lin Xia, Tien-Tsin Wong, Xin Tong, Hujun Bao, Baining Guo et al. (2005). Visual simulation of weathering by γ-ton tracing. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/1073204.1073321