Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
52cd61b047 Merge pull request 'Ridge: the sky, stars and night bodies turn with the heading' (#179) from void/ridge-sky-turns into dev
All checks were successful
Rat dev preview / Build dev preview (push) Successful in 3m5s
2026-11-23 05:56:38 +00:00
Meta Vens
da27bc06b6 harness: plateCost passes the plate's slack
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m14s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 06:54:36 +01:00
Meta Vens
2a83976e7c ridge sky: a swap keys from the clock after its paint, the margin follows the speed and the tick, the twinkle is keyed by star
swap-lag: a plate is repainted first (`refit`), then everything is keyed from a clock read after the paint, on the issue path and the residency path alike; paint time is no longer lag.
recentre-margin-zero: the recentre margin is the speed in force (heading.ts turnRate) over the tick's real period plus a 2 s lateness budget; the slack is sized to the same speed, and a plate is repainted when a faster turn asks for more.
twinkle-reroll: the twinkle schedule runs over the catalogue (Star.id), so a swap keeps which stars swing and their phase, and the new twinkle canvas is drawn before it is shown.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 06:46:22 +01:00
Meta Vens
1ed14c93d7 harness: a live ridge page for the sky plate and a sun override for the look sheet; the scene README names the plate
ridgeLive.html runs one tier-full scene for a CDP driver (hold, pose, plate edge, plate paint cost, long tasks); ridgeSheet takes &sun=az:el so a column's sun can
stand where a turned camera should see it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 06:12:17 +01:00
Meta Vens
fe6be73807 ridge sky: the sky, the stars and the night bodies turn with the heading on a plate of the viewport arc plus slack, re-centred before it runs out
The live scene paints its physical sky into one plate element, 20 degrees wider than the viewport each side, centred on the heading heading.ts owns, with
the twinkle canvas as its child, and slides it on the same keyframes as the cards (translate by -(h - centre) px per degree; the sky is at infinity).
A residency tick or a reissue paints a new plate about the heading when it is within 14 degrees of the plate's edge and swaps it in the same tick.
The host canvas now holds only a still's sky (painted facing the still's frozen pose) or a gradient; the fixed full-viewport twinkle overlay is gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 06:04:37 +01:00
a229d19781 Merge pull request 'Ridge runtime: the camera turns the whole ring (lazy tiles, rotation modes, per-mode offset bound)' (#178) from void/ridge-ring-runtime into dev
All checks were successful
Rat dev preview / Build dev preview (push) Successful in 3m38s
2026-11-23 04:47:56 +00:00
Meta Vens
013a3783f5 scene: a rebuild has no failure end; ink and theme follow the sky of the scene that is up
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m5s
A rebuild with no tile stays pending (its loader retries) and replaces the shown scene the moment it holds one; a newer rebuild supersedes it. sceneDrawn owns the drawn sky; the door tells it the band of the scene it shows, and the theme and ink hooks read it, not the announced band. A rebuild over a sky-only scene keeps the first-load deadline.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 05:46:16 +01:00
Meta Vens
0c614f9e22 ridge still: one pose, frozen at the first paint; arrivals repaint it, a resize takes a fresh one and asks for its tiles
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 05:38:24 +01:00
Meta Vens
a95e5447b1 docs: the ridge target names the one owner of the pose
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:34:57 +01:00
Meta Vens
27356ff7c4 scene start: one lifecycle rule, a new backdrop replaces the shown scene once it holds tiles
A build a newer one supersedes is given up at once (its backdrop disposed, its requests aborted) instead of running to the end of its pass: five quick sky picks on a slow link left five backdrops and lighting contexts alive. A rebuild that ends with no tile no longer swaps a ridge that was fine for the sky alone and tells the host its planes failed: the scene that is up stays, its own backdrop is disposed, and the next change of sky tries again. Only a first load that ends with no tile is the sky alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:22:47 +01:00
Meta Vens
721bb0b392 ridge heading: one owner of the camera pose, a segment that is a pure function of the clock; Vienna rebaked under the continuous fit gate
heading.ts holds one segment: the pose (view direction, camera angle, offset) at t0, the mode and bounded speed, and the ease to the pose the inputs owe. poseAt(t) is a pure function of it. Any change (a mode pick, a hold, a resume, the speed, the offset slider, a new bound, reduced motion, a place) starts a new segment from poseAt(now), and the order of the two stages (the angle first when the camera goes to stand on its heading, the offset first when it goes off it) is decided from that pose against the bound, so every pose inside an ease is inside the bound from wherever it starts.

Deleted: the change log in cameraState (takeChanges, CameraChange: the owner is one synchronous hook called before every listener, no queue), the offset ease and its closure state in Ridge.ts (offsetNow, offsetFrom, offsetAt, easeLeft, easeEndsAt, offsetFreeAt, shownPhiAt), and the rig's camera subscription (the rig hears heading alone). A rebuild reads poseAt(now) and lands exactly where the old scene was.

Vienna rebaked under the continuous measure: vienna-2aac8e6fee59, r_max_m 95.8 (was 98.2), r_max_forward_m 198.4 (was 205.4); the worst card is at 24.0 px by the continuous measure. Tests: a pick made while an ease is under way and a rebuild in the middle of one at Vienna's bounds, and a seeded property run of picks, holds, speeds, offsets and rebuilds at random times checking every laid-out pose against the bound and the owner's pose, and continuity across rebuilds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:22:10 +01:00
Meta Vens
7aea83856b ridge loader: the backdrop retries a failed tile on its own backoff, for every tier
A still has no residency timer, so a tile that failed in its first pass was never asked for again and the ridge kept an 11.25 degree hole until reload. The loader now keeps the arc last asked for and, when a tile of it failed, asks again at the end of its pause (doubling to a minute, as before) with no one asking; the arc moving away or dispose ends it, a 404 is still not asked for again. Residency timers say which tiles are wanted and nothing else.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:21:02 +01:00
Meta Vens
128fda5ec5 ridge-bake: the fit gate measures the continuous error, the manifest and index are written as bytes
fit_px took the least-squares line of 33 uniform samples and the error on the same 33: the line was biased by its end samples, so the shipped bounds were at 24.7 and 26.3 card px by the continuous measure. The line is now the quadrature of the viewport (Gauss-Legendre, 48 nodes) and the error is looked for on 513 points; a fixture checks it against a 20001-sample brute force within 0.1 px at the offsets the bound is set at.

write_bake wrote manifest.json and index.json with Path.write_text, which ends lines with CRLF on Windows while bake_id hashed LF: the bytes served were not the bytes the id was hashed from. They are written as bytes now; the fixture runs the writer with a text writer that ends lines CRLF and checks the id from the bytes on disk.

Mutants: the 33-sample line, a two-node quadrature, and each text write.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:20:56 +01:00
Meta Vens
7b92d5c6ee ridge heading: the owner computes on read from the clock and the changes the viewer made (no listener, no order); a mode pick eases the camera's inputs in two stages, the angle and the offset one after the other, each pose a real pose inside the fit; reduced motion has no ease
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:54:28 +01:00
Meta Vens
aeace1f346 ridge still: the backdrop tells of each tile it makes, and a still rebuilds once per burst of arrivals (the same debounced rebuild as a resize), so the tiles that come after the deadline are drawn
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:45:30 +01:00
Meta Vens
5ed3327b14 scene start: the deadline is for the first scene alone; a rebuild keeps the scene it replaces until the new one has its tiles, and never swaps to the sky alone for want of time
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:45:28 +01:00
Meta Vens
801fdf3e31 ridge assets: public/ridge is checked out as committed (-text), so a Windows checkout serves the bytes its bake id was hashed from; the asset test hashes the real bytes and pins the attribute
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:41:04 +01:00
Meta Vens
0f4739f8b8 ridge assets: Vienna rebaked under baker 5 with the new bake id vienna-6c0b4df70bf5 (tiles byte-identical, manifest now inside the id); the asset test hashes the manifest too
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:23:49 +01:00
Meta Vens
fcfa26c2bc ridge-bake: bake_id addresses the whole bake, the manifest as written (its id blanked) and then the tile files, so a manifest change is a new directory
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:23:47 +01:00
Meta Vens
fa2e216039 ridge runtime: the speed is bounded from the anchor, the owner settles before the rig reads it, a mode pick eases the view, and a scene start has a deadline
anchor takes the place's speed bound, so the view never turns past it while the first tiles load, and the rig no longer installs it. The owner keeps one
listener (same function, same place in cameraState's order) so a re-anchor cannot move it behind the old rig's. A change of mode eases phi (shownPhiAt) and
the offset the clamp releases or takes over EASE_MS, keyed finely in the same WAAPI animation. prepare waits PREPARE_DEADLINE_MS for the first arc, then draws
with the tiles held (the rig asks for the rest) or, with none, is the sky alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:09:27 +01:00
Meta Vens
32bcc2490a ridge loader: a freed slot is handed to the next waiter, so the cap of six holds under arc churn; dispose gives up the requests of the pass in flight
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:09:25 +01:00
Meta Vens
898ace2291 ridge runtime: the hold is session state in cameraState, the clamps are derived at read and never written back, fetches go nearest the view first
- cameraState holds the chosen mode (persisted) and a non-persisted hold flag;
  the mode in effect is still while held. A rebuild keeps the hold, a reload is
  a Return, and picking a mode (the chosen one included) ends it.
- The speed bound is applied at read in heading.ts (setSpeedLimit); the stored
  speed and offset are the viewer's and nothing writes them back.
- ensure(arc, first): the tiles are asked for and made nearest first to the arc
  the view shows now, then outward along the sweep.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:34:07 +01:00
Meta Vens
76d02e1997 ridge-bake tests: the forward offset is searched at phi 0 alone (a mutant that searched the circle survived)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:27:52 +01:00
Meta Vens
35c3f825a8 ridge runtime: one owner of the rotation mode and the hold; the offset range and the speed bound per mode; the arc swept, not sampled at its ends; the heading kept bounded
- cameraState owns the mode; heading.ts keeps only where the view was at a
  clock and integrates under the choice, listening to it. A manual turn sets
  the mode to still, so a rebuild or a reload keeps the hold and choosing a
  mode again (the one the viewer had included) resumes it. The second copy of
  the mode in heading.ts and the sync that re-applied it at every scene build
  are deleted. Reduced motion is an override in heading.ts (freeze).
- offsetRange takes the mode (and the camera's angle): the forward bound
  camera.r_max_forward_m where the camera stays on its heading, the worst-case
  camera.r_max_m where it circles and for a backward offset, the nearest card's
  foot clamp on both sides where the circle takes the offset round to phi 180.
  The default +200 m is clamped by the range of the current mode.
- maxSpeed: the speed the baked resident count sustains, applied to the stored
  choice at the scene start and on every change.
- sweepArc: the arc of every pose of the next 30 s, sampled four times a
  second; the rig mounts and asks the loader for that, and lays out in the same
  tick as it issues a stretch.
- heading.normalize brings h and phi into [0, 360) before each stretch, so
  transforms and tile positions stay small however long the page is open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:01:57 +01:00
Meta Vens
b4232c9c55 ridge runtime: the loader asks for files six at a time against a timeout, backs off a failed tile and gives up on a 404
A tile's files were fetched one card after another with no timeout, and a
failed tile was asked for again every 500 ms for as long as it stayed in the
arc. Requests now queue to FETCH_PARALLEL over every tile of the pass, each
gives up after FETCH_TIMEOUT_MS (aborted), a tile that failed is asked for
again after a pause that doubles from 1 s to 60 s, and a file the server
answers 404 or 410 is not asked for again while its tile stays: the scene draws
the tile's other cards. The load and keep margins move to ring.ts, where
view.ts's speed bound spends them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:01:36 +01:00
Meta Vens
40573e5c32 ridge assets: Vienna rebaked with camera.r_max_forward_m (205.4 m, r_max_m 98.2 m); the manifest and the gate read it
The tile files are unchanged (same bake id); the manifest gains the forward
offset bound. The assets gate recomputes the resident run at the larger of the
two offsets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 00:53:07 +01:00
Meta Vens
86063b86ff ridge-bake: camera.r_max_forward_m, the offset bound with the camera on its heading (phi = 0 alone); baker version 5
r_max_m holds over every angle of the camera on its circle, which only the
offset-only rotation mode reaches. Where the view direction turns with the
camera phi stays 0 and the linear map holds further out: the baker ships that
bound too (same FIT_PX_MAX, same half-nearest-distance cap, same resident gate,
refused if below r_max_m).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 00:44:43 +01:00
Meta Vens
5fb77e2bcd ridge runtime: view test pins the sign of the camera's sideways shift
A mutant that flipped the offset's sin(phi) term survived: the phi 90 test read
the shift by magnitude only. It now requires the shift to the left for a camera
clockwise of the heading and to the right for the other side.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 00:11:13 +01:00
Meta Vens
44ad930253 ridge runtime: look sheet draws through the app's still path and takes views; README and target describe the ring and heading
harness/scene/ridgeSheet.html lights a baked place by tile and draws each cell with
createRidgeScene at tier still; ?views=heading:phi:offset renders a heading across
north and the offset-only rotation mode. The scene README and the ridge target
doc replace the drift with the ring, the heading owner and the camera pose.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 00:06:18 +01:00
Meta Vens
94cfae1945 ridge assets: Vienna as a ring bake (schema 3, r_max 98.2 m); the gate reads tiles
public/ridge replaces the 72 degree window bake with the ring bake from the baker
cut (32 tiles per card, 192 tile files, 1.6 MB, bake id 64118fed28c7). The assets
gate is recomputed for schema 3: per-tile and per-place byte caps, the resident
run from the manifest alone (export.py run_tiles), each tile file's WebP size
tile_w + 2 apron by its band, the bake id re-derived tile-major, no stray files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 23:43:44 +01:00
Meta Vens
19d49cbd46 ridge runtime: one box per card posed from the heading owner; tiles mounted by arc
The rig is a box per card holding that card's resident tiles, carried by one
animation of cardPose sampled each second over 30 s from heading.ts and the
viewer's offset, reissued at 80% and on any change; a 500 ms timer asks the
backdrop for the arc ahead and mounts what it has made. The reach animation,
DRIFT_LEG_S and the drift's easing are gone. prepare() anchors the heading and
awaits the first arc; a stale or failed build disposes its backdrop.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 23:39:20 +01:00
Meta Vens
0f7a297339 ridge runtime: a lighter per sky, tiles lit by ring column; a backdrop holds tiles by arc
lightCards becomes createLighter: the sun columns and the sky table span the ring
in absolute azimuth, the ground noise is a function of the ground point and so
periodic over the wrap, and a tile is lit from its own files with one overlap
column kept each side. loadBackdrop (every card, at build) becomes createBackdrop:
ensure(arc) fetches, decodes and lights one tile at a time and evicts beyond the
arc and two tiles; a failed tile is retried, never thrown into the scene.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 23:31:55 +01:00
Meta Vens
e82b6cf01f ridge runtime: ring, heading, cameraState; view without a window; manifest schema 3
cardMotion, DRIFT_FRAC, driftPx, headingMaxDeg and the per-card scale are deleted.
ring.ts owns wrap-around and a card's distance at an azimuth, heading.ts the
view direction and the camera's angle on its circle, cameraState.ts the viewer's
mode, speed and offset; view.ts derives a card's pose and clamps the offset.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 23:27:48 +01:00
1ef6abab13 Merge pull request 'Ridge baker: the ring is the bake (32 tiles per card, schema 3)' (#177) from void/ridge-ring-bake into dev
All checks were successful
Rat dev preview / Build dev preview (push) Successful in 3m49s
2026-11-22 22:04:34 +00:00
Meta Vens
069df981f9 ridge-bake tests: r_max at R = d, the 0.1 seam-prior pin back where it holds, tighter albedo bounds
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m34s
The 0.1 pin is back on the 3-12, 4-15/10 and 6-14 km fixtures; 0.04 stays on 4-15/6, 5-30 and 8-40 (closing the seam on the ring tears them above it). Albedo: mean 0.021, p99 0.081 (measured maxima 0.0202, 0.0806).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 22:48:46 +01:00
Meta Vens
30e4ee549a ridge-bake: r_max_m fits each card tile's linear map at its own distance (R = d)
The per-column median distances inside a tile are no longer part of the fit: the card sits at the tile's distance_m, as ruling ridge-offset-range-fit has it. Vienna's r_max_m is 98.2 m (was 56.1).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 22:48:46 +01:00
Meta Vens
920e37e385 ridge-bake tests: pin the tile cut, the ring anchors and the apron against mutants; mutate.py takes name filters
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 22:10:31 +01:00
Meta Vens
dbef945493 ridge-bake: README and places.json for the ring, tiles and r_max_m
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:25:12 +01:00
Meta Vens
65db62c986 ridge-bake: the ring is the bake, 32 azimuth tiles per card (schema 3)
The 72 degree window and the baked camera are deleted. The march's 6400 columns are the bake: seams run periodic round the ring (DP over three laps, middle kept), ridge.cards runs per tile on 204 columns with the matching normals, and the vertical anchors read the skyline of the whole ring. Each card tile carries its own distance_m; camera.r_max_m is the largest offset the per-card linear slide fits within 24 card px (and the resident gate allows). Tile, place and resident budgets replace the window's. Manifest schema 3, baker version 4. Tests and mutants rewritten for the ring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:25:09 +01:00
d851a5fca9 Merge pull request 'Sky menu: Auto, six named moments and a free moment, in the place's local time' (#176) from void/sky-menu-moments into dev
All checks were successful
Rat dev preview / Build dev preview (push) Successful in 3m55s
2026-11-20 23:12:54 +00:00
Meta Vens
cd81f85d05 Sky menu fixes: one owner of the drawn place, Night is tonight's, named moments roll
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m32s
- skyPlace.ts is the only writer of the sky's place: the manifest's when the cards load, FALLBACK_VIEW's
  when the manifest or cards fail; the scene draws the view it told the store, so sky, weather, ink and
  Auto agree on every drawn state (Auto ticks on the fallback).
- useSkyPlace removed: only a scene start fetches the manifest.
- Old-key migration writes the new key first; a refused write keeps the pick for the page load.
- A named moment re-resolves when the place-local day rolls over (the one timer); Night is the nearest
  solar midnight (before the day's noon the one just passed or coming), keyed by the instant drawn.
- Baker validate/schema check place.tz as load_preset does; Vienna manifest baker_version 3 (it carries tz).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 00:07:01 +01:00
Meta Vens
3269250d19 Scene README: the sky choice, the moment authority and place.tz
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 23:42:49 +01:00
Meta Vens
e948f99f9e Sky menu: Auto, six named moments and a free moment picker
Seven radio items plus Pick a moment, which opens a date input and a 5-minute time slider that show the
place-local time and zone and commit on the native change event (slider release), never per input tick.
The picker opens from the moment being drawn, in the place zone (seedFree).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 23:42:48 +01:00
Meta Vens
4597539976 Tests and look sheet follow the moment authority
Tests move to SkyChoice and the sun-taking makePhysicalSky; the harness sheet takes the six named moments
on both solstices (?named=1).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 23:36:08 +01:00
Meta Vens
ca77bacb4a Sky choice store: Auto, named or free moment resolved at the loaded place
skyState.ts holds the choice, the place and the lines and resolves the band through momentFor and skyBand;
resolveSkyState, LAT and the page-zone clock approximation are deleted. skyPlace.ts shares the manifest with
the scene; hooks, theme and ink take an undefined sky until a place is known. Old 'ratatoskr.skyState' is read
once and removed; the choice persists as 'ratatoskr.skyChoice'.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 23:36:06 +01:00
Meta Vens
8e44479792 Place carries its time zone: baker writes place.tz, manifest parses it
places.json tz per preset, load_preset refuses a missing or unknown zone, schema regenerated,
BAKER_VERSION 3; runtime rejects a zone Intl does not know; Vienna manifest gains the one line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 23:23:26 +01:00
Meta Vens
fbe9c9a930 Sky moment authority: skyMoment.ts decides the drawn instant; sunForState deleted
momentFor(choice, place, now) and skyBand are the one owner of the instant and the band.
sunAt.ts loses STATE_ELEVATION, solarNoon and sunForState; makePhysicalSky takes the sun it is given.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 23:23:24 +01:00
270 changed files with 9270 additions and 1884 deletions

5
.gitattributes vendored Normal file
View file

@ -0,0 +1,5 @@
# The ridge bake is addressed by its bytes (bake_id covers the manifest text and the tile files): public/ridge is checked out exactly as committed, whatever
# core.autocrlf says, so a Windows working tree serves the bytes its directory name was hashed from.
public/ridge/** -text
# The baker's inputs and schema are text, read the same everywhere.
scripts/ridge-bake/**/*.json text eol=lf

View file

@ -6,9 +6,11 @@ The scene's bottom silhouette is replaced by baked A+D ridge planes. The baker i
The live noise ridge is nearly invisible on a phone (about 1.35:1 against the darkest sky) because every ridge pixel is lifted to the text-contrast floor, and the star dots show between nav and header glyphs because the shell is transparent. Meta, 2026-11-13: do not polish the old backdrop; ship the A+D ridge pipeline (round 2 mockup: https://minds.gamecult.org/nibu/ridge-mockups-ad/). The live noise ridge is nearly invisible on a phone (about 1.35:1 against the darkest sky) because every ridge pixel is lifted to the text-contrast floor, and the star dots show between nav and header glyphs because the shell is transparent. Meta, 2026-11-13: do not polish the old backdrop; ship the A+D ridge pipeline (round 2 mockup: https://minds.gamecult.org/nibu/ridge-mockups-ad/).
## Ends ## Ends
- One owner per decision: the baker owns ridge geometry and shading; the runtime owns only frame choice, blending, camera drift and compositing. No ridge geometry is computed in the browser. - One owner per decision: the baker owns ridge geometry and shading; the runtime owns only the ring's residency, the camera's pose against its heading, blending and compositing. No ridge geometry is computed in the browser.
- Nothing from the scene paints above app content: the scene is one stacking context at the back of the app, and nothing it creates has its own z-index or lives outside it. - Nothing from the scene paints above app content: the scene is one stacking context at the back of the app, and nothing it creates has its own z-index or lives outside it.
- Phone cost is bounded: no per-frame script for the ridge, decoded size and fetched size gated in CI. - Phone cost is bounded: no per-frame script for the ridge, decoded size and fetched size gated in CI.
- The ring is the bake and the heading is unbounded: the whole 360 degrees ships as azimuth tiles, the client holds only the arc it is about to need and fetches more as the view turns, and nothing caps the heading: it is unwrapped within a stretch of motion and `ridge/heading.ts` `normalize` brings it into [0, 360) before each one, so no angle or pixel position grows with uptime, while `ridge/ring.ts` is the one place that reasons about the wrap at 0 / 360.
- Motion is derived, not authored: a card's scale and shift come each second from the heading, the camera's angle on its circle and the viewer's offset (one pose, one owner: `ridge/heading.ts`, whose every change starts a segment from the pose the view has, and whose eases keep each pose inside the baked bound) and the card's distance (`ridge/view.ts` `cardPose`), and ride the compositor as one animation per card.
- The baker has fixtures with known right answers (the far-plateau spike, chain-end taper, slot union, seam) and a mutation runner that must kill each re-introduced cause. - The baker has fixtures with known right answers (the far-plateau spike, chain-end taper, slot union, seam) and a mutation runner that must kill each re-introduced cause.
- A baked asset names its baker version, DEM source and licence in a validated manifest; the credits shown in the Sky menu come from the manifest. - A baked asset names its baker version, DEM source and licence in a validated manifest; the credits shown in the Sky menu come from the manifest.

View file

@ -21,11 +21,25 @@ directory whose ancestors hold no empty `package.json` (esbuild reads them).
Timings from SwiftShader are CPU time: use them for the split between passes and for before and Timings from SwiftShader are CPU time: use them for the split between passes and for before and
after of one change, never as a phone frame time. after of one change, never as a phone frame time.
## Ridge live scene
`ridgeLive.html` is one live scene (tier 'full', the sky plate and the cards on the compositor) filling the window, for a driver to turn and screenshot: `?h=214&sun=232:22&speed=6` (start heading, the sun's azimuth and elevation, degrees a second of rotation),
`?sky=night&lines=1`. `window.live` offers `hold(h)`, `pose()`, `plate()`, `left()` (the plate's left edge on the page) and `plateCost()` (ms of main thread to paint one plate here); `window.longTasks` lists the tasks over 50 ms.
A held heading's sun lands within a tenth of a pixel of the column the heading owner says, across re-centres of the plate.
## Ridge look sheet ## Ridge look sheet
Renders the Vienna cards (`public/ridge/vienna-6815bb9dca99`) lit for six sky states (dawn 2, morning 15, noon 55, golden 6, dusk -3, night -30 degrees of sun) Renders a baked place (`?place=`, the index default otherwise) lit for six sky states (dawn 2, morning 15, noon 55, golden 6, dusk -3, night -30 degrees of sun)
by a set of looks (`RidgeLook`, `src/app/features/scene/ridge/lightCards.ts`, the one owner of look values), one 480x270 canvas per cell at heading 0. The sky by a set of looks (`RidgeLook`, `src/app/features/scene/ridge/lightCards.ts`, the one owner of look values), one 480x270 canvas per cell, drawn by the app's own still
behind a cell is the app's own (`makePhysicalSky` + `paintSky`, upscaled), without the sun disc, stars or clouds. Not shipped. path (`createRidgeScene` at tier 'still' over a `createBackdrop` of the tiles round the heading), at the rest azimuth unless `?views=` says otherwise. The sky
behind a cell is the app's own, without clouds. Not shipped.
...ridgeSheet.html?views=214:0:200,0:0:200,214:90:98.2&sky=2 # one column per view heading:phi:offset (degrees, degrees, metres) at one sky (an index of SKIES)
`&sun=100:6` puts the sun of that sky at compass azimuth 100, 6 degrees up (the stars are those of the moment the sheet is opened): a sun at the heading's side shows where the turned sky puts it, `&sky=5&lines=1` is the night.
A heading of 0 or 360 is across north; a phi other than 0 is the offset-only rotation mode (the camera circling the centre, the view direction staying); the offset is
clamped to the place's range as the app does (phi 0: `camera.r_max_forward_m`, another phi: `camera.r_max_m`).
npx vite --port 5199 # from the repo root; the app's vite config serves the page and public/ npx vite --port 5199 # from the repo root; the app's vite config serves the page and public/
http://localhost:5199/harness/scene/ridgeSheet.html # four presets x six skies http://localhost:5199/harness/scene/ridgeSheet.html # four presets x six skies
@ -46,4 +60,4 @@ Presets (`PRESETS` in `ridgeSheet.ts`; swiss and poster take every key not named
| painterly | DEFAULT_LOOK: groundNoise 0.35, cloudShadows 0.5, nearWarm 0.6, hazeScale 2, inkScale 0.4, celBands 3, celSoftness 0.05, celAmbientAway 0.7 | | painterly | DEFAULT_LOOK: groundNoise 0.35, cloudShadows 0.5, nearWarm 0.6, hazeScale 2, inkScale 0.4, celBands 3, celSoftness 0.05, celAmbientAway 0.7 |
| painterly-cel-2 / -3 / -4 | painterly with celBands 2 / 3 / 4 | | painterly-cel-2 / -3 / -4 | painterly with celBands 2 / 3 / 4 |
Night sets (`ridgeSheet.html`): `?moments=2026-11-24T22:00Z,2026-12-09T20:00Z` pins explicit UTC moments (the sun, moon and stars are those of the moment); `?night=1` renders the next new moon, first quarter and full moon from today (`&from=YYYY-MM-DD`) at four hours each (`&hours=18,21,0,4`, UTC) plus deep dusk of the full-moon evening; `&lines=1` draws the constellation lines (the Sky menu's hidden toggle). Use `&w=300` for the 13-column set. The night look's knobs: `NIGHT_LOOK` in `ridge/nightSky.ts` (star point spread, contrast exponents, moon size, earthshine, line opacity), `NIGHT_CEILING` and `SCOTOPIC` in `ridge/toneMap.ts`, the night `Budget` (key, targets, partial adaptation). Named moments (`ridgeSheet.html?named=1`): the six moments of the Sky menu (dawn, morning, noon, golden hour, dusk, night) at the baked place on the December and June solstices, drawn from `momentFor` as the app draws them (`SKY_MOMENTS` in `ridge/skyMoment.ts` is the table tuned by eye from this sheet). Night sets (`ridgeSheet.html`): `?moments=2026-11-24T22:00Z,2026-12-09T20:00Z` pins explicit UTC moments (the sun, moon and stars are those of the moment); `?night=1` renders the next new moon, first quarter and full moon from today (`&from=YYYY-MM-DD`) at four hours each (`&hours=18,21,0,4`, UTC) plus deep dusk of the full-moon evening; `&lines=1` draws the constellation lines (the Sky menu's hidden toggle). Use `&w=300` for the 13-column set. The night look's knobs: `NIGHT_LOOK` in `ridge/nightSky.ts` (star point spread, contrast exponents, moon size, earthshine, line opacity), `NIGHT_CEILING` and `SCOTOPIC` in `ridge/toneMap.ts`, the night `Budget` (key, targets, partial adaptation).

View file

@ -0,0 +1,8 @@
<!doctype html>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Ridge live scene</title>
<body style="margin:0;background:#111">
<div id="host" style="position:fixed;inset:0;overflow:hidden"><canvas id="c" style="position:absolute;left:0;top:0;width:100%;height:100%"></canvas></div>
<script type="module" src="./ridgeLive.ts"></script>
</body>

View file

@ -0,0 +1,71 @@
// One live ridge scene (tier 'full': the sky plate and the cards on the compositor) filling the window, for a driver to turn and screenshot. Not shipped.
// `?h=214` the heading the scene starts at; `?sun=232:22` the sun's compass azimuth and elevation (degrees); `?sky=night` the stars of now (sun below the horizon); `?lines=1` the constellation lines.
// `?speed=6` degrees a second the view turns (rotation mode 'both'); 0 holds it. The page offers `window.live`: `hold(h)` turns the view by hand, `pose()` is the heading owner's pose now,
// `plate()` the sky plate's element and `left()` its left edge and width on the page.
import { parseManifest } from '../../src/app/features/scene/ridge/manifest';
import { makePhysicalSky } from '../../src/app/features/scene/ridge/physicalSky';
import { createBackdrop } from '../../src/app/features/scene/ridge/Backdrop';
import { createRidgeScene } from '../../src/app/features/scene/ridge/Ridge';
import { anchor, hold, poseAt } from '../../src/app/features/scene/ridge/heading';
import { setCamera } from '../../src/app/features/scene/cameraState';
import { HFOV_MAX_DEG, windowFor } from '../../src/app/features/scene/ridge/view';
import { paintSky } from '../../src/app/features/scene/ridge/physicalSky';
import { nightBodies } from '../../src/app/features/scene/ridge/nightBodies';
import { plateCamera, plateSize, SLACK_MIN_DEG } from '../../src/app/features/scene/ridge/skyTurn';
const q = new URLSearchParams(location.search);
/** The main-thread tasks over 50 ms the page saw, ms: `window.longTasks`. */
const longTasks: number[] = [];
(window as unknown as { longTasks: number[] }).longTasks = longTasks;
try {
new PerformanceObserver((l) => l.getEntries().forEach((e) => longTasks.push(e.duration))).observe({ entryTypes: ['longtask'] });
} catch {
// No long-task entries in this browser.
}
async function main() {
const index = await (await fetch('/public/ridge/index.json')).json();
const dir = `/public/ridge/${index.places[q.get('place') ?? index.default]}/`;
const manifest = parseManifest(await (await fetch(`${dir}manifest.json`)).json(), dir);
const { view } = manifest;
const [az, el] = (q.get('sun') ?? '232:22').split(':').map(Number);
const time = new Date();
const sun = q.get('sky') === 'night' ? { azimuth: 0, elevation: -30, time } : { azimuth: az, elevation: el, time };
const physical = makePhysicalSky(sun, 0, view);
const h0 = Number(q.get('h') ?? view.lookAzDeg);
anchor(view.place.id, h0, performance.now());
setCamera({ mode: 'both', speedDegPerS: Number(q.get('speed') ?? 0), offsetM: 200 });
const backdrop = createBackdrop(manifest, physical);
await backdrop.ensure({ fromDeg: h0 - HFOV_MAX_DEG, toDeg: h0 + HFOV_MAX_DEG });
const canvas = document.getElementById('c') as HTMLCanvasElement;
const scene = createRidgeScene({ canvas, tier: 'full', sky: { ...physical.stops, physical }, backdrop, lines: q.get('lines') === '1' });
const host = document.getElementById('host') as HTMLElement;
// The plate is the host's div whose first child is a canvas (the rig's first child is a div, the rain's has none).
const plate = () => [...host.children].find((c) => c.tagName === 'DIV' && c.firstElementChild?.tagName === 'CANVAS');
(window as unknown as { live: unknown }).live = {
scene,
hold: (h: number) => hold(h, performance.now()),
pose: () => poseAt(performance.now()),
plate,
/** Mean ms of the main-thread part of painting one plate here (the dome, its pixels and the bodies, not the canvas upscale), over `n` runs. */
plateCost: (n = 10) => {
const w = innerWidth;
const h = innerHeight;
const win = windowFor(view, w, h);
const { cssW } = plateSize(win, w, h, devicePixelRatio >= 2 ? 2 : 1, SLACK_MIN_DEG);
const t0 = performance.now();
for (let i = 0; i < n; i += 1) nightBodies(physical, paintSky(physical, cssW, h, plateCamera(win, 214 + i, SLACK_MIN_DEG)), true);
return (performance.now() - t0) / n;
},
left: () => {
const r = plate()?.getBoundingClientRect();
return r && { left: r.left, width: r.width };
},
};
document.title = 'ridge live: done';
}
main().catch((e) => {
console.error(e);
document.title = `ridge live: failed ${e}`;
});

View file

@ -1,4 +1,8 @@
// Look sheet for the lit ridge cards: the Vienna bake lit for a grid of sky states (or pinned moments) x looks, each cell a small canvas at heading 0. Not shipped. // Look sheet for the lit ridge cards: a baked place lit for a grid of sky states (or pinned moments) x looks, each cell a small canvas drawn by the app's own still path
// (`createRidgeScene` at tier 'still', the tiles of the arc round the heading, each card at `cardPose`). Not shipped.
// `?views=214:0:200,0:0:200,100:0:200,214:90:98.2` one column per view `heading:phi:offset` (degrees, degrees, metres) at one sky (`?sky=2`, an index of SKIES, noon by default); a heading
// of 360 or 0 is across north. `&sun=100:6` puts the sun of that sky at azimuth 100, 6 degrees up (the stars are always those of the moment the sheet is opened). The offset is clamped to the place's range as the app does (phi 0: the bake's forward bound, any other phi: the worst-case bound), and a phi other than 0 is the offset-only rotation mode, the camera circling the centre.
// `?place=vienna` the baked place (index.json's default if absent)
// `?preset=all|physical|swiss|poster|painterly|painterly-cel-2|painterly-cel-3|painterly-cel-4` (default all: one row each; painterly is DEFAULT_LOOK); `?looks=<JSON array, url-encoded or base64>` replaces the rows with // `?preset=all|physical|swiss|poster|painterly|painterly-cel-2|painterly-cel-3|painterly-cel-4` (default all: one row each; painterly is DEFAULT_LOOK); `?looks=<JSON array, url-encoded or base64>` replaces the rows with
// the given `{label, ...partial RidgeLook}` entries (inkKeep and reliefLight merge by key). `?w=480` sets the cell width, 16:9 unless `?h=` gives the height (`?w=375&h=812` is a phone). // the given `{label, ...partial RidgeLook}` entries (inkKeep and reliefLight merge by key). `?w=480` sets the cell width, 16:9 unless `?h=` gives the height (`?w=375&h=812` is a phone).
// The sky behind a cell is the app's own: `makePhysicalSky` + `paintSky` upscaled smoothly, with the real stars and the moon (`nightBodies`), // The sky behind a cell is the app's own: `makePhysicalSky` + `paintSky` upscaled smoothly, with the real stars and the moon (`nightBodies`),
@ -8,19 +12,21 @@
// (`?hours=18,21,0,4` UTC), plus deep dusk (sun at -10 degrees) of the evening of the full moon // (`?hours=18,21,0,4` UTC), plus deep dusk (sun at -10 degrees) of the evening of the full moon
// `?labels=1` DEBUG: label each constellation chain in frame with its d3-celestial abbreviation (fetched from the source repository at run time; not shipped) // `?labels=1` DEBUG: label each constellation chain in frame with its d3-celestial abbreviation (fetched from the source repository at run time; not shipped)
// `?lines=1` constellation lines over the stars, as the Sky menu's hidden toggle does (night cells only) // `?lines=1` constellation lines over the stars, as the Sky menu's hidden toggle does (night cells only)
import { DEFAULT_LOOK, PHYSICAL_LOOK, lightCards } from '../../src/app/features/scene/ridge/lightCards'; import { DEFAULT_LOOK, PHYSICAL_LOOK, createLighter } from '../../src/app/features/scene/ridge/lightCards';
import type { RidgeLook } from '../../src/app/features/scene/ridge/lightCards'; import type { RidgeLook } from '../../src/app/features/scene/ridge/lightCards';
import { parseManifest } from '../../src/app/features/scene/ridge/manifest'; import { parseIndex, parseManifest } from '../../src/app/features/scene/ridge/manifest';
import { makePhysicalSky, paintSky } from '../../src/app/features/scene/ridge/physicalSky'; import { makePhysicalSky } from '../../src/app/features/scene/ridge/physicalSky';
import { windowFor } from '../../src/app/features/scene/ridge/view'; import { HFOV_MAX_DEG, windowFor } from '../../src/app/features/scene/ridge/view';
import { nightBodies, onScreen, paintNightBodies } from '../../src/app/features/scene/ridge/nightBodies'; import { onScreen } from '../../src/app/features/scene/ridge/nightBodies';
import { createBackdrop } from '../../src/app/features/scene/ridge/Backdrop';
import { createRidgeScene } from '../../src/app/features/scene/ridge/Ridge';
import { anchor, hold } from '../../src/app/features/scene/ridge/heading';
import { setCamera } from '../../src/app/features/scene/cameraState';
import { sunAt } from '../../src/app/features/scene/ridge/sunAt'; import { sunAt } from '../../src/app/features/scene/ridge/sunAt';
import { linesAt } from '../../src/app/features/scene/ridge/starCatalogue'; import { linesAt } from '../../src/app/features/scene/ridge/starCatalogue';
import { moonPhase } from '../../src/sky/moon.js'; import { moonPhase } from '../../src/sky/moon.js';
import { DAY_FROM } from '../../src/app/features/scene/skyState'; import { MOMENT_IDS, momentFor } from '../../src/app/features/scene/ridge/skyMoment';
import type { FixedSkyState } from '../../src/app/features/scene/skyState';
const DIR = '/public/ridge/vienna-6815bb9dca99/';
type Override = Partial<Omit<RidgeLook, 'inkKeep' | 'reliefLight'>> & { type Override = Partial<Omit<RidgeLook, 'inkKeep' | 'reliefLight'>> & {
label: string; label: string;
@ -36,9 +42,11 @@ interface Column {
azimuth?: number; azimuth?: number;
/** A moment: the sun is the real one of it. */ /** A moment: the sun is the real one of it. */
time?: Date; time?: Date;
/** Where the view faces and the camera stands: heading and phi in degrees, offset in metres. Absent: the rest azimuth, phi 0, the app's default offset. */
view?: { h: number; phi: number; r: number };
} }
/** Sun elevation and compass azimuth of each column; the cards look at 214 +- 36. Elevation picks the display budget (day from DAY_FROM, night below its negative). */ /** Sun elevation and compass azimuth of each column; the cards look at 214 +- 36. The band of the elevation (`skyBand`) picks the display budget. */
const SKIES: Column[] = [ const SKIES: Column[] = [
{ label: 'dawn 2 deg', elevation: 2, azimuth: 100 }, { label: 'dawn 2 deg', elevation: 2, azimuth: 100 },
{ label: 'morning 15 deg', elevation: 15, azimuth: 135 }, { label: 'morning 15 deg', elevation: 15, azimuth: 135 },
@ -138,6 +146,14 @@ function momentsFrom(params: URLSearchParams, place: Parameters<typeof sunAt>[0]
if (Number.isNaN(time.getTime())) throw new Error(`moments=: ${iso} is not a date`); if (Number.isNaN(time.getTime())) throw new Error(`moments=: ${iso} is not a date`);
return { label: fmt(time), time }; return { label: fmt(time), time };
}); });
// `named=1`: the six named moments of the sky menu (`momentFor`, as the app draws them) on both solstices at the place: the look sheet the elevation table is tuned from.
if (params.get('named'))
return ['2026-12-21', '2026-06-21'].flatMap((day) =>
MOMENT_IDS.map((id) => {
const time = momentFor({ kind: 'named', id }, place, new Date(`${day}T12:00:00Z`));
return { label: `${id} ${day.slice(5)} ${fmt(time)}`, time };
})
);
if (!params.get('night')) return undefined; if (!params.get('night')) return undefined;
const from = params.get('from') ? new Date(`${params.get('from')}T00:00:00Z`) : new Date(); const from = params.get('from') ? new Date(`${params.get('from')}T00:00:00Z`) : new Date();
const hours = (params.get('hours') ?? '18,21,0,4').split(',').map(Number); const hours = (params.get('hours') ?? '18,21,0,4').split(',').map(Number);
@ -155,6 +171,17 @@ function momentsFrom(params: URLSearchParams, place: Parameters<typeof sunAt>[0]
}); });
return cols; return cols;
} }
/** `?views=h:phi:r,...`: one column per view, all at the sky `?sky=` (default noon), whose sun `?sun=az:el` may put elsewhere (compass degrees, degrees above the horizon). */
function viewsFrom(params: URLSearchParams): Column[] | undefined {
const list = params.get('views');
if (!list) return undefined;
const [az, el] = (params.get('sun') ?? '').split(':').map(Number);
const sky = { ...SKIES[Number(params.get('sky') ?? 2)], ...(Number.isFinite(az) && Number.isFinite(el) ? { azimuth: az, elevation: el } : {}) };
return list.split(',').map((v) => {
const [h, phi, r] = v.split(':').map(Number);
return { ...sky, label: `h ${h} phi ${phi} r ${r}`, view: { h, phi, r } };
});
}
const preset = q.get('preset'); const preset = q.get('preset');
const pinned = q.get('moments') || q.get('night'); const pinned = q.get('moments') || q.get('night');
const rows = (q.get('looks') const rows = (q.get('looks')
@ -176,23 +203,14 @@ const W = Number(q.get('w') ?? 480);
const H = q.get('h') ? Number(q.get('h')) : Math.round((W * 9) / 16); const H = q.get('h') ? Number(q.get('h')) : Math.round((W * 9) / 16);
const root = document.getElementById('sheet') as HTMLElement; const root = document.getElementById('sheet') as HTMLElement;
const stateOf = (el: number): FixedSkyState =>
el >= DAY_FROM ? 'day' : el <= -DAY_FROM ? 'night' : 'dusk';
async function main() { async function main() {
const index = parseIndex(await (await fetch('/public/ridge/index.json')).json());
const DIR = `/public/ridge/${index.places[q.get('place') ?? index.default] ?? index.places[index.default]}/`;
const manifest = parseManifest(await (await fetch(`${DIR}manifest.json`)).json(), DIR); const manifest = parseManifest(await (await fetch(`${DIR}manifest.json`)).json(), DIR);
const blobs = await Promise.all(
manifest.cards.map(async (c) => ({
colour: await (await fetch(`${DIR}${c.colour}`)).blob(),
geometry: await (await fetch(`${DIR}${c.geometry}`)).blob(),
}))
);
const decode = (b: Blob) =>
createImageBitmap(b, { premultiplyAlpha: 'none', colorSpaceConversion: 'none' });
const { view } = manifest; const { view } = manifest;
const win = windowFor(view, W, H); const win = windowFor(view, W, H);
const now = new Date(); const now = new Date();
const columns = momentsFrom(q, view.place) ?? SKIES; const columns = viewsFrom(q) ?? momentsFrom(q, view.place) ?? SKIES;
const ids = q.get('labels') === '1' ? await chainIds() : undefined; const ids = q.get('labels') === '1' ? await chainIds() : undefined;
const table = document.createElement('table'); const table = document.createElement('table');
@ -213,34 +231,33 @@ async function main() {
col.time !== undefined col.time !== undefined
? sunAt(view.place, col.time) ? sunAt(view.place, col.time)
: { elevation: col.elevation as number, azimuth: col.azimuth as number, time }; : { elevation: col.elevation as number, azimuth: col.azimuth as number, time };
const physical = makePhysicalSky(stateOf(sun.elevation), time, 0, view, sun); const physical = makePhysicalSky(sun, 0, view);
const px = paintSky(physical, W, H, win.camera); const sky = { ...physical.stops, physical };
const bodies = nightBodies(physical, px, withLines); const v = col.view ?? { h: view.lookAzDeg, phi: 0, r: 200 };
const small = document.createElement('canvas');
small.width = px.w;
small.height = px.h;
const sctx = small.getContext('2d') as CanvasRenderingContext2D;
const img = sctx.createImageData(px.w, px.h);
img.data.set(px.data);
sctx.putImageData(img, 0, 0);
for (let r = 0; r < rows.length; r += 1) { for (let r = 0; r < rows.length; r += 1) {
const bitmaps = await Promise.all( // A host as the page has one: a positioned box of the cell's size holding the canvas the scene paints.
blobs.map(async (b) => ({ const host = document.createElement('div');
colour: await decode(b.colour), Object.assign(host.style, { position: 'relative', width: `${W}px`, height: `${H}px`, overflow: 'hidden' });
geometry: await decode(b.geometry),
}))
);
const cards = lightCards(manifest, bitmaps, physical, rows[r].look);
const cell = document.createElement('canvas'); const cell = document.createElement('canvas');
cell.width = W; Object.assign(cell.style, { position: 'absolute', left: '0', top: '0', width: '100%', height: '100%' });
cell.height = H; host.append(cell);
const ctx = cell.getContext('2d') as CanvasRenderingContext2D; tr[r].insertCell().append(host);
ctx.imageSmoothingQuality = 'high';
ctx.drawImage(small, 0, 0, W, H); // The heading owner as the app leaves it: this view's heading, the camera on its circle at phi (offset-only rotation), the offset the viewer chose.
paintNightBodies(ctx, bodies, W, H, 1); const t0 = performance.now() - 3_600_000;
anchor(`sheet-${manifest.bakeId}-${columns.indexOf(col)}-${r}`, v.h, t0); // a key of its own: every cell starts from phi 0
setCamera({ mode: 'offset', speedDegPerS: 1, offsetM: v.r }, t0); // the offset-only rotation mode for phi seconds at 1 degree per second ...
hold(v.h, t0 + v.phi * 1000); // ... then the view is held at h: the mode is still, the camera stays at phi (phi 0 is the camera on its heading)
const backdrop = createBackdrop(manifest, physical, { lighter: (m, s) => createLighter(m, s, rows[r].look) });
await backdrop.ensure({ fromDeg: v.h - HFOV_MAX_DEG, toDeg: v.h + HFOV_MAX_DEG });
const scene = createRidgeScene({ canvas: cell, tier: 'still', sky, backdrop, lines: withLines });
scene?.dispose();
if (ids) { if (ids) {
// Debug labels: each chain's id at the mean of its vertices that lie in the frame. // Debug labels: each chain's id at the mean of its vertices that lie in the frame.
const ctx = cell.getContext('2d') as CanvasRenderingContext2D;
ctx.font = '11px monospace'; ctx.font = '11px monospace';
ctx.fillStyle = '#ffd24a'; ctx.fillStyle = '#ffd24a';
linesAt(physical.sun.time, view.place.lat, view.place.lon).forEach((chain, i) => { linesAt(physical.sun.time, view.place.lat, view.place.lon).forEach((chain, i) => {
@ -251,26 +268,6 @@ async function main() {
ctx.fillText(`${ids[i]} ${pts.length}/${chain.length}`, mx * W, my * H); ctx.fillText(`${ids[i]} ${pts.length}/${chain.length}`, mx * W, my * H);
}); });
} }
// As Ridge.ts paintCards at heading 0: farthest first, each card at its own scale about the horizon row of the plane.
const s = win.plane.scale;
const x0 = (W - win.plane.w) / 2;
const planeTop = H - (win.plane.h + win.plane.bottom);
const ox = x0 + win.plane.w / 2;
const oy = planeTop + view.horizonRow * s;
for (let k = cards.length - 1; k >= 0; k -= 1) {
ctx.save();
ctx.translate(ox, oy);
ctx.scale(cards[k].scale, cards[k].scale);
ctx.drawImage(
cards[k].canvas,
x0 - ox,
planeTop + cards[k].top * s - oy,
win.plane.w,
cards[k].h * s
);
ctx.restore();
}
tr[r].insertCell().append(cell);
} }
} }
document.title = 'ridge look sheet: done'; document.title = 'ridge look sheet: done';

View file

@ -2,6 +2,6 @@
"schema": 1, "schema": 1,
"default": "vienna", "default": "vienna",
"places": { "places": {
"vienna": "vienna-6815bb9dca99" "vienna": "vienna-2aac8e6fee59"
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,002 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,008 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Some files were not shown because too many files have changed in this diff Show more