Revert "feat(sky): the night sky wheels with the Dereth clock; uniform time fade with a scoped twilight band"

This reverts commit 0dac024cdb.
This commit is contained in:
Erik 2026-08-23 18:26:16 +02:00
parent 0dac024cdb
commit 9fcc3f4870
10 changed files with 15 additions and 98 deletions

View file

@ -43,10 +43,6 @@ layout(std140, ACDREAM_UBO_SET binding = 4) uniform SkyParams {
vec2 uUvScroll;
float uApplyFog;
float uSurfOpacity;
float uNightSkyRotationTurns; // enhanced night sky (IA-26): sky rotation
float uNsPadA;
float uNsPadB;
float uNsPadC;
};
struct Light {
@ -190,50 +186,18 @@ vec3 nightSky(vec3 dir, uint seed)
void main() {
if (uParamA > 0.5) {
// Day/night fade from the UNIFORM ambient term only — the first
// gate's vTint signal carried the per-vertex sun-facing product and
// blanked stars across the whole twilight half of the sky
// (2026-08-23 screenshots). Ambient is one value for the sky, so
// star visibility is even everywhere; the twilight glow gets its
// own tightly-scoped suppression below.
float dayL = dot(uAmbientColor, vec3(0.299, 0.587, 0.114));
float night = 1.0 - smoothstep(0.10, 0.32, dayL);
// The star layer's own retail lighting product (Emissive 0 ->
// ambient + diffuse) is the day/night signal: ~0.1 at deep night,
// ~1.0 at noon. Stars at full strength only under a dark sky.
float dayL = dot(vTint, vec3(0.299, 0.587, 0.114));
float night = 1.0 - smoothstep(0.18, 0.45, dayL);
if (night < 0.004) {
// Daytime: the whole lattice would multiply to zero — skip it
// so the enhanced sky costs nothing outside dusk-to-dawn.
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
return;
}
vec3 d = normalize(vDir);
// Subtle twilight suppression: only the low sky (bottom ~19 deg)
// toward the sun's azimuth, and only while the sun term is strong
// (dusk/dawn) — stars near the bright horizon wash out, the rest
// of the sky keeps its full carpet.
vec3 dflat = normalize(vec3(d.xy, 0.0) + vec3(1e-5, 0.0, 0.0));
vec3 sflat = normalize(vec3(uSunDir.xy, 0.0) + vec3(1e-5, 0.0, 0.0));
float glowSide = max(dot(dflat, sflat), 0.0);
float lowSky = 1.0 - clamp(d.z * 3.0, 0.0, 1.0);
float twilight = clamp(
dot(uSunColor, vec3(0.299, 0.587, 0.114)) * uDiffuseFactor,
0.0, 1.0);
night *= 1.0 - 0.85 * twilight * glowSide * glowSide * lowSky;
// The sky wheels: one revolution per Dereth day about a celestial
// pole ~41 deg above the northern horizon (+Y north, +Z up), plus
// ~1 deg/night of seasonal drift folded into the turns value
// (dayFraction + dayOfYear/360). Rodrigues rotation of the sample
// direction; stars and mottle turn together.
const vec3 NS_POLE = vec3(0.0, 0.6598, 0.7514);
float ang = 6.28318530718 * fract(uNightSkyRotationTurns);
float ca = cos(ang);
float sa = sin(ang);
vec3 rdir = d * ca
+ cross(NS_POLE, d) * sa
+ NS_POLE * dot(NS_POLE, d) * (1.0 - ca);
vec3 sky = nightSky(rdir, uint(uParamB));
vec3 sky = nightSky(normalize(vDir), uint(uParamB));
// Additive pipeline (forced for this draw): rgb adds over the dome.
fragColor = vec4(sky * night, 1.0);
return;

View file

@ -67,10 +67,6 @@ layout(std140, ACDREAM_UBO_SET binding = 4) uniform SkyParams {
vec2 uUvScroll;
float uApplyFog; // 1 for foggable layers; raw-additive keeps fog off
float uSurfOpacity; // final surface opacity multiplier from the CPU
float uNightSkyRotationTurns; // enhanced night sky (IA-26): sky rotation
float uNsPadA;
float uNsPadB;
float uNsPadC;
};
// Shared SceneLighting UBO — we need uFogParams.xy (fog start/end) to

View file

@ -311,12 +311,12 @@
"stages": [
{
"stage": "vert",
"sourceSha256": "80c190d5544433bd6b08810c1e5040cec5090fe91839f436728d5454ed7f3c31",
"sourceSha256": "9102b156bd4fd667831353640b2feee2ddde66e88579a4e425566c9b67304b64",
"compiled": true
},
{
"stage": "frag",
"sourceSha256": "76481dcc1a321c65308bf9c081254978ee7f12413166df5d32a1606228bdc768",
"sourceSha256": "e7ccdb4d5fece2ceeb48eb43aaa827424df2b68614987eeb3dfb7880dff8ea83",
"compiled": true
}
]