Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

facett-map3d-flight/.nornir/daycycle-design.md

Time-of-day sun driver + weather — design

The chosen design for animating the sky: a pure-CPU, deterministic DayCycle (facett-map3d-flight/src/daycycle.rs) that turns (latitude, day-of-year, hour, weather) into a facett_map3d::SunSky, driving the existing GPU PBR shader + CPU painter with no new passes (additive, L2). This is the single biggest realism win over a fixed SunSky::noon().

Pipeline (part-steps, each testable)

# step fn in → out emit / bench
1 solar position solar_angles(lat, doy, hour) time → SolarAngles{elevation, azimuth} daycycle.solar_angles bench; asserted (east/noon/west, season)
2 sun direction sun_dir(angles) angles → unit surface→sun (+X east,+Y up,+Z north), unclamped so night stays below the horizon daycycle.sun_dir bench
3 direct-sun colour sun_sky sun_color = base ⊙ T(alt, μ_sun) from the reused atmos transmittance LUT, hue-normalised golden-hour reddening asserted
4 sun intensity daylight_curve(elev) 0 below −6°, rising with sin(elev) to a noon peak night/golden dimming asserted
5 sky tint + ambient atmos.sky_colors × sky_scale zenith/horizon tint, dimmed by a twilight/night gate daycycle.sun_sky bench
6 weather blend Weather.cloudiness overcast: dim sun, grey+desaturate sky, lift ambient, flatten overcast asserted (monotone)

Key decisions

Alternatives considered live in flightsim-engine-roadmap.md; this doc names only the shipped design.