Soften night sky: 55% bright (was 85%), wider star band

- skyDarkness 0.85 -> 0.55 so night sky is deep but not pitch
  black, leaving room for stars to show through
- skyMask widened (-0.10 -> -0.20 lower bound, 0.30 -> 0.40 upper)
  so stars appear closer to the horizon in the cockpit view
- Star tint multiplier 0.9 -> 1.0 (full bright) for clearer dots
This commit is contained in:
Richard Zink committed 2026-10-07 20:12:32 +02:00
1 parent f567ebf768
commit 2e745c26ad
1 file changed
+6 -3
+6 -3
View File
@@ -148,10 +148,11 @@ var FRAG_SRC = [
// lower half of the sky so the airplane-cockpit view shows stars // lower half of the sky so the airplane-cockpit view shows stars
// from the horizon up. // from the horizon up.
'float nightFactor = smoothstep(0.05, -0.15, uSunAlt);', 'float nightFactor = smoothstep(0.05, -0.15, uSunAlt);',
'float skyMask = smoothstep(-0.10, 0.30, rd.y);', // Widened sky band so stars appear close to the horizon too.
'float skyMask = smoothstep(-0.20, 0.40, rd.y);',
'float stars = starField(rd) * skyMask * nightFactor;', 'float stars = starField(rd) * skyMask * nightFactor;',
// (nightFactor is also used below for the final darken pass.)', // (nightFactor is also used below for the final darken pass.)',
'col = mix(col, uLight, clamp(stars, 0.0, 1.0) * 0.9);', 'col = mix(col, uLight, clamp(stars, 0.0, 1.0));',
// Density threshold: weather 'sunny' -> high (sparse clouds), // Density threshold: weather 'sunny' -> high (sparse clouds),
// 'stormy' -> low (overcast deck). // 'stormy' -> low (overcast deck).
'float baseThresh = mix(0.72, 0.40, uDensity);', 'float baseThresh = mix(0.72, 0.40, uDensity);',
@@ -189,7 +190,9 @@ var FRAG_SRC = [
// them goes dark. transmittance tells us how much light made it // them goes dark. transmittance tells us how much light made it
// through the cloud layer (1 = clear, 0 = fully cloudy). // through the cloud layer (1 = clear, 0 = fully cloudy).
'float cloud = 1.0 - trans;', 'float cloud = 1.0 - trans;',
'float skyDarkness = nightFactor * 0.85;', // 0.55 — strong but not pitch black, leaves room for stars to
// remain visible against a deep but not void-black sky.
'float skyDarkness = nightFactor * 0.55;',
'col = mix(col, col * (1.0 - skyDarkness), 1.0 - cloud);', 'col = mix(col, col * (1.0 - skyDarkness), 1.0 - cloud);',
'gl_FragColor = vec4(col, 1.0);', 'gl_FragColor = vec4(col, 1.0);',
'}' '}'