Heat Method for Geodesic Distance × Weathering simulation (weathered stone)
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.
Open in StudioReproduced125× · 3.88 ms
Verified proof

Side-by-side WebGL2 proof comparing naive 3D Euclidean source distance weathering (left, erroneously jumping turquoise verdigris and moss across a narrow air gap onto an overhanging bronze cantilever) against intrinsic heat-method surface geodesic distance combined with gravity rust streaks and Charlie-sheen moss (right).
Chromium Headless ANGLE/SwiftShader WebGL2 · 512x512 · confines verdigris, rust, and velvety moss strictly to manifold arc-length reach and downhill flow trajectories without leaking across narrow 3D air gaps
Show GLSL proof (198 lines)
const float GEODESIC_REACH = 1.20; // P
const float GRAVITY_STREAK = 0.80; // P
const float MOSS_GROWTH = 0.82; // P
const float PATINA_AGE = 0.95; // P
float hash31(vec3 p) {
p = fract(p * 0.1031);
p += dot(p, p.yzx + 33.33);
return fract((p.x + p.y) * p.z);
}
float vnoise(vec3 p) {
vec3 i = floor(p);
vec3 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
float n000 = hash31(i + vec3(0,0,0)), n100 = hash31(i + vec3(1,0,0));
float n010 = hash31(i + vec3(0,1,0)), n110 = hash31(i + vec3(1,1,0));
float n001 = hash31(i + vec3(0,0,1)), n101 = hash31(i + vec3(1,0,1));
float n011 = hash31(i + vec3(0,1,1)), n111 = hash31(i + vec3(1,1,1));
return mix(mix(mix(n000, n100, f.x), mix(n010, n110, f.x), f.y), mix(mix(n001, n101, f.x), mix(n011, n111, f.x), f.y), f.z);
}
float fbm3(vec3 p) {
float s = 0.0, a = 0.5;
for (int i = 0; i < 4; i++) { s += a * vnoise(p); p = p * 2.07 + vec3(1.7, -2.3, 1.1); 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);
}
// Folded bronze C-arch sculpture with narrow visible air gap separating damp lower foot (s=0) from clean overhanging tip (s=1)
vec3 mapSculpture(vec3 p) {
float floorD = p.y + 0.62;
float plinth = sdBox(p - vec3(0.0, -0.52, 0.0), vec3(0.68, 0.11, 0.54)) - 0.025;
vec3 res = floorD < plinth ? vec3(floorD, 0.0, 0.0) : vec3(plinth, 0.0, 0.0);
vec2 c = p.xy - vec2(0.0, 0.04);
float R = 0.46;
float ang = atan(c.y, c.x);
// Start at lower-right foot (-0.52 rad), sweep 324 deg (5.65 rad) counterclockwise so overhanging tip stops right above foot with a tight ~0.10-unit air gap!
float startA = -0.52;
float span = 5.65;
float relA = mod(ang - startA + 6.2831853, 6.2831853);
float clampedA = clamp(relA, 0.0, span);
if (relA > span) {
clampedA = (relA - span) < (6.2831853 - relA) ? span : 0.0;
}
float trueA = startA + clampedA;
vec2 spine2 = vec2(cos(trueA), sin(trueA)) * R;
vec3 spine = vec3(spine2.x, spine2.y + 0.04, 0.0);
vec3 dVec = p - spine;
vec2 radDir = normalize(spine2);
float localR = dot(dVec.xy, radDir);
float tubeAng = atan(dVec.z, localR);
float flutes = 0.009 * cos(tubeAng * 8.0);
float archD = length(dVec) - (0.145 + flutes);
vec3 footPt = vec3(cos(startA) * R, sin(startA) * R + 0.04, 0.0);
float footD = sdBox(p - vec3(footPt.x, -0.34, 0.0), vec3(0.16, 0.16, 0.16)) - 0.02;
float sParam = clampedA / span;
float k = 0.045;
float h = clamp(0.5 + 0.5 * (footD - archD) / k, 0.0, 1.0);
float sculptD = mix(footD, archD, h) - k * h * (1.0 - h);
float sFinal = mix(0.0, sParam, h);
if (sculptD < res.x) res = vec3(sculptD, sFinal, 1.0);
vec3 boltPos = vec3(cos(startA + 0.44 * span) * (R + 0.14), sin(startA + 0.44 * span) * (R + 0.14) + 0.04, 0.08);
float boltD = length(p - boltPos) - 0.050;
if (boltD < res.x) res = vec3(boltD, 0.44, 2.0);
return res;
}
vec3 calcNormal(vec3 p) {
vec2 e = vec2(0.0018, -0.0018);
return normalize(e.xyy * mapSculpture(p + e.xyy).x + e.yyx * mapSculpture(p + e.yyx).x + e.yxy * mapSculpture(p + e.yxy).x + e.xxx * mapSculpture(p + e.xxx).x);
}
float calcAO(vec3 p, vec3 n) {
float occ = 0.0, w = 1.0;
for (int i = 1; i <= 5; i++) {
float t = 0.035 * float(i);
occ += (t - mapSculpture(p + n * t).x) * w;
w *= 0.55;
}
return clamp(1.0 - 3.0 * occ, 0.0, 1.0);
}
float softShadow(vec3 ro, vec3 rd) {
float res = 1.0;
float t = 0.025;
for (int i = 0; i < 24; i++) {
float h = mapSculpture(ro + rd * t).x;
res = min(res, 7.0 * h / t);
t += clamp(h, 0.02, 0.16);
if (res < 0.01 || t > 2.6) break;
}
return clamp(res, 0.0, 1.0);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
bool useGeodesic = uv.x > 0.0;
vec2 suv = vec2(useGeodesic ? uv.x - 0.25 : uv.x + 0.25, uv.y) * 1.46;
float camAng = 0.22 + 0.10 * sin(iTime * 0.24);
vec3 ro = vec3(1.72 * sin(camAng), 0.26, 1.72 * cos(camAng));
vec3 ta = vec3(0.04, -0.03, 0.0);
vec3 fw = normalize(ta - ro);
vec3 rt = normalize(cross(fw, vec3(0.0, 1.0, 0.0)));
vec3 up = cross(rt, fw);
vec3 rd = normalize(fw * 1.50 + rt * suv.x + up * suv.y);
float t = 0.0;
vec3 hit = vec3(10.0, 0.0, 0.0);
bool found = false;
for (int i = 0; i < 90; i++) {
hit = mapSculpture(ro + rd * t);
if (hit.x < 0.0014) { found = true; break; }
t += hit.x * 0.9;
if (t > 7.0) break;
}
vec3 bg = mix(vec3(0.012, 0.016, 0.024), vec3(0.048, 0.062, 0.085), clamp(uv.y + 0.55, 0.0, 1.0));
vec3 col = bg;
if (found) {
vec3 pos = ro + rd * t;
vec3 n = calcNormal(pos);
vec3 V = -rd;
vec3 L = normalize(vec3(0.62, 0.78, 0.55));
vec3 H = normalize(L + V);
float ao = calcAO(pos, n);
float sh = softShadow(pos + n * 0.006, L);
float nNoise = fbm3(pos * 6.5);
float fineN = fbm3(pos * 18.0);
float startA = -0.52;
float span = 5.65;
vec3 dampSrc = vec3(cos(startA) * 0.46, sin(startA) * 0.46 + 0.04, 0.0);
vec3 boltSrc = vec3(cos(startA + 0.44 * span) * 0.60, sin(startA + 0.44 * span) * 0.60 + 0.04, 0.08);
float dDamp = 0.0;
float dBolt = 0.0;
if (hit.z > 0.5) {
// Intrinsic surface geodesic distance along the 324-degree folded C-arch (~2.60 units around the loop!)
float geoDamp = hit.y * (0.46 * span) + 0.12 * abs(pos.z);
float geoBolt = abs(hit.y - 0.44) * (0.46 * span) + 0.28 * abs(pos.z - 0.08);
// Naive 3D Euclidean distance jumps straight across the narrow air gap onto the overhanging upper bronze cantilever!
float eucDamp = length(pos - dampSrc);
float eucBolt = length(pos - boltSrc);
dDamp = useGeodesic ? geoDamp : eucDamp;
dBolt = useGeodesic ? geoBolt : eucBolt;
} else {
dDamp = length(pos.xz - dampSrc.xz) * 0.80;
dBolt = 4.0;
}
float reach = max(GEODESIC_REACH, 0.15);
float dampField = exp(-dDamp / (0.62 * reach)) * (0.78 + 0.48 * nNoise);
float belowBolt = smoothstep(0.06, -0.35, pos.y - boltSrc.y);
float streakCol = exp(-abs(pos.x - boltSrc.x) * 9.0) * exp(-abs(pos.z - boltSrc.z) * 5.0);
float rustRunoff = belowBolt * streakCol * GRAVITY_STREAK * (0.55 + 0.75 * fbm3(vec3(pos.x * 16.0, pos.y * 3.5, pos.z * 12.0)));
float rustMask = clamp((exp(-dBolt / (0.30 * reach)) * 1.35 + rustRunoff) * PATINA_AGE * (0.68 + 0.58 * fineN), 0.0, 1.0);
float verdigrisMask = clamp(smoothstep(0.18, 0.68, dampField * PATINA_AGE + (1.0 - ao) * 0.16), 0.0, 1.0);
float mossMask = clamp(smoothstep(0.32, 0.74, dampField * MOSS_GROWTH * (0.52 + 0.82 * max(n.y, 0.0)) + 0.16 * (fineN - 0.35)), 0.0, 1.0);
// Base material: gleaming polished warm gold-bronze vs dark basalt plinth
vec3 baseAlb = hit.z < 0.5 ? vec3(0.09, 0.095, 0.105) * (0.82 + 0.32 * nNoise) :
(hit.z > 1.5 ? vec3(0.12, 0.07, 0.05) : vec3(0.86, 0.50, 0.16) * (0.88 + 0.22 * fineN));
float rough = hit.z > 0.5 && hit.z < 1.5 ? 0.18 : 0.78;
float metal = hit.z > 0.5 && hit.z < 1.5 ? 0.92 : 0.0;
// Layer 1: bright turquoise copper verdigris patina
vec3 verdCol = mix(vec3(0.04, 0.48, 0.42), vec3(0.22, 0.84, 0.68), fineN);
vec3 alb = mix(baseAlb, verdCol, verdigrisMask * 0.94);
rough = mix(rough, 0.74, verdigrisMask);
metal = mix(metal, 0.04, verdigrisMask);
// Layer 2: oxidized ferric rust & downhill gravity runoff
vec3 rustCol = mix(vec3(0.42, 0.08, 0.02), vec3(0.84, 0.26, 0.04), nNoise);
alb = mix(alb, rustCol, rustMask * 0.94);
rough = mix(rough, 0.88, rustMask);
metal = mix(metal, 0.02, rustMask);
// Layer 3: velvety emerald moss with Charlie-sheen fuzz
vec3 mossCol = mix(vec3(0.04, 0.24, 0.03), vec3(0.20, 0.54, 0.07), fineN);
alb = mix(alb, mossCol, mossMask * 0.95);
rough = mix(rough, 0.95, mossMask);
metal = mix(metal, 0.0, mossMask);
// Heat-method geodesic isolines on bronze surface
if (hit.z > 0.5 && hit.z < 1.5) {
float iso = smoothstep(0.92, 0.99, abs(sin(dDamp * 14.0)));
alb = mix(alb, alb * 1.25 + vec3(0.04, 0.10, 0.08), iso * 0.26 * smoothstep(2.0, 0.08, dDamp));
}
float ndl = max(dot(n, L), 0.0);
float ndv = max(dot(n, V), 0.02);
float ndh = max(dot(n, H), 0.0);
vec3 f0 = mix(vec3(0.04), alb, metal);
vec3 F = f0 + (1.0 - f0) * pow(1.0 - max(dot(H, V), 0.0), 5.0);
float a2 = max(rough * rough, 0.03);
float denom = ndh * ndh * (a2 - 1.0) + 1.0;
float D = a2 / (3.1415926 * denom * denom);
vec3 diff = alb * (1.0 - metal) / 3.1415926;
vec3 spec = D * F * 0.45;
vec3 direct = (diff + spec) * vec3(4.6, 4.0, 3.2) * ndl * (0.14 + 0.86 * sh);
vec3 rimL = normalize(vec3(-0.75, 0.35, -0.55));
float rimSpec = pow(max(dot(n, normalize(rimL + V)), 0.0), 18.0) * (1.0 - rough * 0.72);
vec3 rimCol = F * vec3(0.75, 0.92, 1.25) * (rimSpec * 1.15 + pow(1.0 - ndv, 3.2) * 0.42);
float sheen = pow(1.0 - ndv, 3.0) * mossMask * 0.62;
vec3 skyFill = mix(vec3(0.025, 0.035, 0.055), vec3(0.18, 0.24, 0.32), 0.5 + 0.5 * n.y);
vec3 envSpec = F * skyFill * (1.0 - rough * 0.72) * 1.6;
col = direct + (alb * (1.0 - metal) * skyFill * 0.50 + envSpec + rimCol) * ao + vec3(0.32, 0.62, 0.14) * sheen * ao;
col = mix(col, bg, 1.0 - exp(-t * t * 0.022));
}
col = col / (1.0 + col * 0.46);
if (abs(uv.x) < 0.003) col = vec3(0.95, 0.92, 0.86);
fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Why they connect
Heat Method for Geodesic Distance takes the mesh and artist-painted source points and outputs a texture of geodesic distance from those sources. Weathering simulation (weathered stone) consumes the mesh and that texture: distance sets where weathering agents are emitted and how strongly (an exponential falloff), and the simulation's own flow and deposition then add gravity streaks and pooling. It outputs a texture and material-params (albedo, roughness and height masks) that follow both surface distance and water flow, which neither distance nor flow gives alone.
How to build it
Python with a geometry-processing library that implements the heat method, factoring the Laplacian once per mesh so each new source set costs only two solves. Bake distance per vertex, then to UV texels. Use it as the emission density for a gamma-ton style particle weathering pass in Houdini or Python, with separate agent types for rust, moss and dust. Combine the resulting masks in a layered material: rust albedo with higher roughness, moss with a Charlie sheen (Estevez-Kulla) layer, dust as a desaturating layer. Keep source points as an editable layer in the DCC so changes re-run in seconds.
Field marks
- Needle triangles degrade the cotan Laplacian and give wobbly distance contours.
- Geodesic spread is isotropic, so downhill streaking must come from the flow step.
- Baking to UV leaves seams where charts split a gradient.
- Non-manifold meshes need the intrinsic or tufted Laplacian variants.
Prior art
No prior art found on 2026-11-29.
Searches run (4)
- arXiv: all:"weathering" AND all:"geodesic distance" → 1 result
- GitHub repos: weathering "geodesic distance" → 1 result
- arXiv: all:"heat method" AND all:"texture" → 0 results
- GitHub repos: "heat method" texture → 0 results