From 7cb04686c7de5c1aa6b090722959c4820b25afaa Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Wed, 7 Oct 2026 20:09:56 +0200 Subject: [PATCH] Fix clouds3d: declare outer cloud variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'cloud' was referenced outside the for-loop where it was defined. Use 1.0 - trans (transmittance) as a cloud mask instead — same information, properly scoped. --- vendor/clouds3d.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index a57db79..230a384 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -188,8 +188,9 @@ var FRAG_SRC = [ // is not the same as 'is it night'). // Only darkens the sky, NOT the clouds — we want them to stay // moon-lit (their colour came from uLight) while the sky around - // them goes dark. The cloud mask 'cloud' tells us how much of - // this pixel is cloud, so fully cloudy pixels keep their colour. + // them goes dark. transmittance tells us how much light made it + // through the cloud layer (1 = clear, 0 = fully cloudy). + 'float cloud = 1.0 - trans;', 'float skyDarkness = nightFactor * 0.85;', 'col = mix(col, col * (1.0 - skyDarkness), 1.0 - cloud);', 'gl_FragColor = vec4(col, 1.0);',