scene: shape each sky state's drawn sky into a luminance band its text ink clears #54
Loading…
Reference in a new issue
No description provided.
Delete branch "nibu/sky-contrast"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Per the operator's ruling (no plates; fix contrast in the sky itself): each fixed sky state's drawn sky is shaped into a luminance band (WCAG relative luminance, the
luminanceofsrc/sky/skyTokens.js) in which that state's theme text ink clears 4.5:1 on bare sky. Nothing was seen rendered: tests and numbers only. GL/GLSL was not run on a GPU (the Terrain GL fake pins the uploaded uniforms; the GLSL twin of the shaping is pinned by source-string tests, not by numeric evaluation).Bands
skyBackdrop, darkest to lightest)displayedLuminance(c, 'low' | 'high')moves every encoded channel one 8-bit step down or up (rounding plus dither cannot move it further), a smooth bound that can be searched.shapeToBand(skyBand.ts), with a GLSL twin (SHAPE_SKY_GLSL,terrainShaders.ts): below the floor it mixes toward a state tint by exactly the amount that lands on the floor (hue kept); above the ceiling it scales down. Applied to the final terrain sky colour, in the sky pass and in the haze that fades into it, and the 2D fallback inherits it throughskyColour.ridge/skyColour.ts); day and night use the baked gradients unchanged. The ridge is bounded over its whole range (stops and blends); it clears every floor without forcing (day 0.540, dusk 0.336 to 0.409, night 0.0599 to 0.0775).TERRAIN_REACH_DEG, derived fromCAMERA: top edge 14.5 plus 1.5 margin), every azimuth. Within that reach unshaped terrain dusk bottoms out at 0.2585; the lift takes it over the bound.sunElevationfromsun.js, latitude 45, longitude from the timezone's standard-time offset; day at 6 degrees or more, night at -6 or less, dusk between).subscribenotifies the resolved state;getResolvedSkyStateis the plain getter;skyBackdrop('auto')is the resolved state's band. One timer, only while a listener exists and the choice is auto. Auto does not override a signed-in person's theme:skyThemeId('auto')is undefined.?sun=?az=?sky=steer the terrain in auto (shaped into the band of the clock-resolved state); an explicit state beats the URL.Measured ratios on bare sky (worst case over the backdrop)
Text clears 4.5 everywhere. The dusk and night link shortfall is Void's wiring: the link colours are derived by taking them toward black; the Night link is Void's to lighten to about 0.53 luminance or more. The numbers are pinned in
skyTheme.test.tsas known values, not as >= 4.5.Constants and how they are held
BACKDROPSinskyState.ts(constants, so the main chunk imports no terrain sky or baked tables) are the union of the ridge (whole range) and the terrain (camera reach, 0 to 16 degrees) asridgeDrawn/terrainDrawngive them, rounded outward to six places.terrainDrawncarries #48's finer search (compass step halving to 5e-7 degrees). The drift test adds #48's independent cross-check, alternating golden-section line searches from 60 starts on the same screen reading, and holds each constant within 1e-6 above the swept extreme (a constant 1e-6 inward or 2e-5 outward fails, for all six). The entry chunk size was not measured; no production build was run.Not done / findings
skyPlate*.tsis still wired into the signed-in UI (CallView, RoomIntro, shell regions); removal is a follow-up.useActiveTheme-level render test (no React render harness in the repo); the decision is pinned atskyThemeId.chooseSky's URL path now also serves the door in auto;ridgeSkyForignores the URL as before.🤖 Generated with Claude Code
Day and dusk: floor 0.30 (dark ink needs 0.2983). Night: ceiling 0.0931 for the light ink; the baked night sky is kept. One shaping function (skyBand.shapeToBand) with a GLSL twin lifts the terrain sky toward a tint (hue kept) or scales it down. The ridge dusk becomes lavender, rose and orange. 'auto' resolves from the clock (sun.js elevation) to day, dusk or night; subscribers hear the resolved sky; skyBackdrop('auto') is the resolved state's band. Link ink is not in the band (Void's wiring). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>- skyThemeId('auto') is undefined again (auto must not override a signed-in theme); the resolved state stays readable by getResolvedSkyState and subscribe. - In auto, ?sun= ?az= ?sky= reach the terrain again, shaped into the band of the clock-resolved state; an explicit state beats the URL. - The sky-change notice is no longer swallowed by a listener arriving or leaving between the clock crossing and the tick. - BACKDROPS bound what the 8-bit screen shows with the dither at its worst; shaping floor 0.317, night ceiling 0.085. - The clock uses standard time, so daylight saving does not move the sun. - A Terrain GL fake test pins uBand and uLift for each state. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>