From e005789ba8df392be6d947fe55d9bcaba59151ab Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Sun, 11 Oct 2026 22:46:35 +0200 Subject: [PATCH] config+docs: sun/moon/camera/day blocks, moon map attribution and cache manifest --- README.md | 22 +++++++++++++---- config.js | 72 +++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 80 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8a47b72..341308e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,9 @@ dropped into an iframe or kiosk browser and left running. ground: direct beam through a Kasten-Young air mass with Rayleigh, ozone and aerosol extinction, diffuse skylight, moonlight, a starlight floor and aerial perspective. Sun and moon come from the real positions (SunCalc) for - `CONFIG.location`, or from an accelerated 24 h simulation (`CONFIG.day`). + `CONFIG.location`; `CONFIG.day` can move the clock those positions are + evaluated at (start at a chosen date/time, optionally accelerated) without + replacing the astronomy. - **Theme-tinted lighting**: each theme may pull the physical colours toward its own palette and set its own day/night exposure, without replacing the physics (`window.THEMES[...].lighting`). @@ -126,7 +128,10 @@ Groups: | `lights` | twilight switching window of every artificial light (`offDeg`, `onDeg`, `softDeg`) | | `atmosphere` | turbidity, moon/star gains, night floor, albedo/sky/air gains, haze residual, cloud albedo and cloud haze, cloud shadows, terrain shadows | | `stars` | star colour `tint` and `brightness` | -| `day` | `simulation`, `cycleSeconds`, `fixedTime` | +| `sun` | `angularRadius` (disc size only, 12x physical by default) | +| `moon` | disc size (`angularRadius`, 12x physical by default), `texture`, `lightGain`, `earthshine`, `limbDarkening`, `brightness`, `halo`, `flipU`/`flipV` | +| `camera` | `aim` (`'off'` or `'moon'`), `aimEase`, `aimBob` | +| `day` | `startAt` (`'YYYY-MM-DDTHH:MM'` or null), `speed` (virtual s per real s) | ### World scale @@ -169,13 +174,19 @@ All off by default, all documented in `config.js`: ground texture (orientation check). - `terrain: { wireframe: true }` - draw the mesh edges. - `ground: { style: 'streets' }` - labelled street map instead of satellite. -- `day: { simulation: true }` / `weatherSim: true` - deterministic day cycle and - weather cycle for comparing looks. +- `day: { startAt: '2026-10-29T20:56', speed: 1440 }` - start the scene at a + chosen moment and run the clock accelerated (1440 = one day per minute); + `speed: 1` runs it at real time from that moment, `startAt: null` is strictly + real time. Sun, moon, phase, clock hands and weather all follow that clock. +- `weatherSim: true` - deterministic weather cycle for comparing looks. ## URL hash parameters `http://host:58881/#flight=N&fetch=S` +- `at=2026-10-29T20:56` - start the clock at this local date/time (overrides + `CONFIG.day.startAt`). +- `speed=1440` - virtual seconds per real second (overrides `CONFIG.day.speed`). - `flight=N|NE|E|SE|S|SW|W|NW` - heading of the straight flight corridor (used when `CONFIG.orbit` is disabled) - `fetch=N|NE|E|SE|S|SW|W|NW` - direction the tile mosaic is prefetched ahead of @@ -248,6 +259,7 @@ window.TRANSLATIONS['Sunrise']['xx'] = 'MyTranslation'; ├── vendor/ │ ├── clouds3d.js WebGL scene renderer (sky, clouds, terrain, lights) │ ├── suncalc.js sun/moon positions - ISC (SunCalc by mourner) +│ ├── moon.jpg lunar surface map for the moon disc - CC BY 4.0 │ ├── plane3d.js low-poly aircraft model - CC0 │ ├── stars.json Yale Bright Star Catalogue subset │ └── LICENSE per-library license attributions @@ -274,5 +286,7 @@ window.TRANSLATIONS['Sunrise']['xx'] = 'MyTranslation'; - **Copernicus DEM** (terrain, via Mapzen/TILEZEN terrarium tiles): open data - - **Yale Bright Star Catalogue** (star positions, via `vendor/stars.json`) +- **Solar System Scope** (lunar surface map, via `vendor/moon.jpg`): CC BY 4.0 - + - **OpenStreetMap Nominatim** (reverse geocoding): ODbL - diff --git a/config.js b/config.js index 41668e9..346e88c 100644 --- a/config.js +++ b/config.js @@ -155,6 +155,32 @@ window.CONFIG = { // density: { sunny: 0.05, cloudy: 0.9, stormy: 1.0, night: 0.2 } }, + // ------------------------------------------------------------------ + // Moon + // ------------------------------------------------------------------ + // The disc is drawn artistically larger than the real one (0.0046 rad + // = 0.26 deg, about 9 px at 1080p) so that the surface texture and the + // phase are actually readable. The terminator itself stays geometric: + // lit side = surface normal dot sun direction. + // The map is sampled in a selenographic frame built from the north + // celestial pole, so the disc shows north up and east to the right - + // like a printed lunar map - and rotates as the moon crosses the sky. + moon: { + angularRadius: 0.0552, // 12x the physical 0.0046 rad + texture: 'vendor/moon.jpg', // equirectangular near-side map + // Scene moonlight (terrain, aircraft, contrails, airlight) is + // scaled with the disc, but only half of the excess over the + // physical size counts: 1 + 0.5 * (angularRadius/0.0046 - 1) = 6.5. + // Set 1.0 for the strictly physical night brightness. + lightGain: 6.5, + earthshine: 0.10, // faint light on the dark side + limbDarkening: 0.30, // surface dims towards the limb + brightness: 2.20, // per-pixel luminance of the disc + halo: 1.0, // glow around the disc, scales with phase + flipU: false, // mirror the map if orientation is wrong + flipV: false + }, + // ------------------------------------------------------------------ // Civil aviation // ------------------------------------------------------------------ @@ -308,18 +334,44 @@ window.CONFIG = { }, // ------------------------------------------------------------------ - // Day cycle + // Sun // ------------------------------------------------------------------ - // simulation: true runs a full 24 h cycle in cycleSeconds (sun rises - // east, culminates south, sets west) and the clock plus the sun/moon - // tables follow the simulated date. false uses the real SunCalc positions. + // The real sun is 0.00465 rad (0.27 deg). Like the moon, the disc is + // drawn larger so it reads as a disc; the surface brightness and the + // scene lighting are NOT scaled with it. + sun: { + angularRadius: 0.0558 // 12x the physical 0.00465 rad + }, + + // ------------------------------------------------------------------ + // Camera + // ------------------------------------------------------------------ + // The camera always flies the configured path (figure eight or straight + // drift); 'aim' changes only where it LOOKS. 'moon' turns the view to + // the moon - heading to its azimuth, pitch to its altitude - while the + // flight path, the fetch corridor and the traffic stay as they are. + // Below the horizon the view holds the moon's azimuth at the horizon. + camera: { + aim: 'off', // 'off' | 'moon' + aimEase: 0.94, // 0 = instant turn, 0.99 = very slow + aimBob: 0.25 // share of the altitude bob kept while aiming + // camera: { aim: 'moon' } // look at the moon + }, + + // ------------------------------------------------------------------ + // Clock + // ------------------------------------------------------------------ + // Sun and moon are always the real ones (SunCalc ephemeris) - this block + // only moves the clock that the astronomy is evaluated at. startAt picks + // the moment the scene begins at, speed advances it from there: 1 = real + // time, 1440 = one simulated day per minute. Clock hands, digital readout, + // weather and sky all use the same clock. Hash overrides: #at=... #speed=... day: { - simulation: false, // false = the real sun and moon (default) - cycleSeconds: 60, // only used when simulation is true: - // 60 s = one simulated day per minute - fixedTime: null // 'HH:MM' or 0-24 freezes the sim clock - // (clouds, traffic and flights keep moving) - // day: { simulation: true, cycleSeconds: 60 } // accelerated day + startAt: null, // null = strictly real time + speed: 1 // virtual seconds per real second + // day: { startAt: '2026-10-29T20:56', speed: 1 } // start at a chosen + // // moment, real pace + // day: { startAt: '2026-10-29T20:56', speed: 1440 } // accelerated }, // ------------------------------------------------------------------