From cb847df3f541efed606adc984bfaf33b26130281 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Mon, 12 Oct 2026 14:55:32 +0200 Subject: [PATCH] clouds: intensify coverage, scale and detail --- config.js | 2 +- vendor/clouds3d.js | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config.js b/config.js index 642f3ab..19b6400 100644 --- a/config.js +++ b/config.js @@ -151,7 +151,7 @@ window.CONFIG = { // only ever reports sunny/cloudy/stormy, so the deck keeps that // coverage through the night as well - 'night' is used by the weather // simulation (weatherSim: true) alone. - density: { sunny: 0.30, cloudy: 0.80, stormy: 0.92 } + density: { sunny: 0.45, cloudy: 0.90, stormy: 1.00 } // density: { sunny: 0.05, cloudy: 0.9, stormy: 1.0, night: 0.2 } }, diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index bd899a1..fa68c2a 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -182,20 +182,20 @@ var FRAG_SRC = [ 'float cloudDensity(vec3 p, float baseThresh, float soft) {', 'float py = p.y + earthDrop(p.xz);', 'vec3 cp = vec3(p.x, py, p.z);', - 'float n = fbm3(cp * 0.35 + vec3(0.0, 0.0, uTime * 0.06));', + 'float n = fbm3(cp * 0.22 + vec3(0.0, 0.0, uTime * 0.05));', // The detail octave weighs at most 0.20 and fades to zero with // distance; past soft = 0.95 it contributes under 1 %, so the whole // 4-octave lookup is skipped for the (numerous) far samples. - 'if (soft < 0.45) {', - 'float d = fbm3(cp * 1.15 + vec3(uTime * 0.04, 7.3, uTime * 0.03));', - 'n = n + d * mix(0.12, 0.0, soft / 0.45);', + 'if (soft < 0.75) {', + 'float d = fbm3(cp * 1.80 + vec3(uTime * 0.045, 7.3, uTime * 0.035));', + 'n = n + d * mix(0.22, 0.0, soft / 0.75);', '}', // Cloud layer between uCloudBot and uCloudTop, densest in the // middle (bell curve). The layer follows the Earth curvature. 'float h = clamp((py - uCloudBot) / (uCloudTop - uCloudBot), 0.0, 1.0);', 'float profile = 4.0 * h * (1.0 - h); // bell curve', 'profile = max(profile, 0.0);', - 'return smoothstep(baseThresh, baseThresh + 0.45 + soft * 0.35, n) * profile;', + 'return smoothstep(baseThresh, baseThresh + 0.34 + soft * 0.28, n) * profile;', '}', // Star field: project ray onto a far sphere, hash-grid for // positions. Visible above the horizon at night with a small @@ -502,7 +502,7 @@ var FRAG_SRC = [ 'float py = p.y + earthDrop(p.xz);', 'if (py > uCloudTop || py < uCloudBot - 0.1) break;', 'if (tTerrain > 0.0 && t >= tTerrain) break;', - 'float cSoft = smoothstep(3.0, 14.0, t);', + 'float cSoft = smoothstep(4.0, 18.0, t);', 'float d = cloudDensity(p, baseThresh, cSoft);', 'if (d > 0.02) {', 'float lit = clamp((py - uCloudBot) / ((uCloudTop - uCloudBot) * 1.167), 0.0, 1.0);', @@ -537,7 +537,7 @@ var FRAG_SRC = [ 'cloudCol = mix(uCloudShadow, uCloud, lit);', 'cloudCol = mix(cloudCol, uLight, max(0.15, uDayProgress) * 0.35 * lit);', '}', - 'float alpha = clamp(d * stepSize * 1.15, 0.0, 1.0);', + 'float alpha = clamp(d * stepSize * 1.30, 0.0, 1.0);', 'cloudSum += cloudCol * alpha * trans;', 'trans *= (1.0 - alpha);', 'if (trans < 0.04) break;', @@ -698,18 +698,18 @@ var CLOUD_SAMPLER_GLSL = [ 'float cloudDensity(vec3 p, float baseThresh, float soft) {', 'float py = p.y + earthDrop(p.xz);', 'vec3 cp = vec3(p.x, py, p.z);', - 'float n = fbm3(cp * 0.35 + vec3(0.0, 0.0, uTime * 0.06));', + 'float n = fbm3(cp * 0.22 + vec3(0.0, 0.0, uTime * 0.05));', // The detail octave weighs at most 0.20 and fades to zero with // distance; past soft = 0.95 it contributes under 1 %, so the whole // 4-octave lookup is skipped for the (numerous) far samples. - 'if (soft < 0.45) {', - 'float d = fbm3(cp * 1.15 + vec3(uTime * 0.04, 7.3, uTime * 0.03));', - 'n = n + d * mix(0.12, 0.0, soft / 0.45);', + 'if (soft < 0.75) {', + 'float d = fbm3(cp * 1.80 + vec3(uTime * 0.045, 7.3, uTime * 0.035));', + 'n = n + d * mix(0.22, 0.0, soft / 0.75);', '}', 'float h = clamp((py - uCloudBot) / (uCloudTop - uCloudBot), 0.0, 1.0);', 'float profile = 4.0 * h * (1.0 - h);', 'profile = max(profile, 0.0);', - 'return smoothstep(baseThresh, baseThresh + 0.45 + soft * 0.35, n) * profile;', + 'return smoothstep(baseThresh, baseThresh + 0.34 + soft * 0.28, n) * profile;', '}', ].join('\n'); @@ -808,7 +808,7 @@ var TERRAIN_FRAG_SRC = [ 'float dens = 0.0;', 'for (int ci = 0; ci < 5; ci++) {', 'float tt = mix(tBot, tTop, (float(ci) + 0.5) / 5.0);', - 'dens += cloudDensity(vWorld + uSunDir * tt, baseTh, smoothstep(3.0, 14.0, tt));', + 'dens += cloudDensity(vWorld + uSunDir * tt, baseTh, smoothstep(4.0, 18.0, tt));', '}', 'cShadow = mix(uCloudShadowFloor, 1.0,', ' exp(-dens * uCloudShadowDensity));',