feat: daybreak finale turns the contact arrival into a sunrise with a dawn chord

This commit is contained in:
2026-10-11 05:32:08 +03:00
parent c9e6ac0f29
commit b6e22a1299
37 changed files with 756 additions and 44 deletions

View File

@@ -111,6 +111,60 @@ export const CHAPTER_PALETTES: Readonly<Record<EnvironmentChapter, ChapterPalett
},
};
/**
* END OF SHIFT: the destination's sky at daybreak. Not a journey chapter: the
* environment blends the destination toward it as the outro's dawn rises.
*/
export const DAYBREAK_PALETTE: Readonly<ChapterPaletteDefinition> = {
sky: 0x6b4a7a,
fog: 0xb07a8c,
terrainLow: 0xffb98a,
terrainHigh: 0xffe1c2,
sun: 0xffd49a,
haze: 0xffb07a,
warmth: 1.25,
terrainEnergy: 0.4,
starVisibility: 0,
streakEnergy: 0,
};
const daybreakColors = {
sky: new THREE.Color(DAYBREAK_PALETTE.sky),
fog: new THREE.Color(DAYBREAK_PALETTE.fog),
terrainLow: new THREE.Color(DAYBREAK_PALETTE.terrainLow),
terrainHigh: new THREE.Color(DAYBREAK_PALETTE.terrainHigh),
sun: new THREE.Color(DAYBREAK_PALETTE.sun),
haze: new THREE.Color(DAYBREAK_PALETTE.haze),
};
/** Leans a written palette toward daybreak (0 untouched, 1 full daybreak). */
export function blendDaybreak(
target: MutableChapterPalette,
amount: number,
): MutableChapterPalette {
const mix = clamp01(amount);
if (mix === 0) return target;
target.sky.lerp(daybreakColors.sky, mix);
target.fog.lerp(daybreakColors.fog, mix);
target.terrainLow.lerp(daybreakColors.terrainLow, mix);
target.terrainHigh.lerp(daybreakColors.terrainHigh, mix);
target.sun.lerp(daybreakColors.sun, mix);
target.haze.lerp(daybreakColors.haze, mix);
target.warmth = lerp(target.warmth, DAYBREAK_PALETTE.warmth, mix);
target.terrainEnergy = lerp(target.terrainEnergy, DAYBREAK_PALETTE.terrainEnergy, mix);
target.starVisibility = lerp(target.starVisibility, DAYBREAK_PALETTE.starVisibility, mix);
target.streakEnergy = lerp(target.streakEnergy, DAYBREAK_PALETTE.streakEnergy, mix);
return target;
}
/**
* Star visibility multiplier while the engine is off: the stars brighten as
* the engine cuts (up to 1.8x), then drain back as the dawn rises.
*/
export function engineOffStarScale(engineOff: number, dawn: number): number {
return 1 + 0.8 * clamp01(engineOff) * (1 - clamp01(dawn));
}
/**
* The 03:12 window's storm: a colder navy the Infrastructure sky leans toward
* (about 55%) while the maintenance window is open. A tint, not a chapter.