Skip to content

feat: canvas performance + cinematic upgrade#3

Merged
pacMakaveli merged 9 commits into
mainfrom
feat/canvas-perf-cinematic-upgrade
Jun 12, 2026
Merged

feat: canvas performance + cinematic upgrade#3
pacMakaveli merged 9 commits into
mainfrom
feat/canvas-perf-cinematic-upgrade

Conversation

@pacMakaveli

@pacMakaveli pacMakaveli commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Orbit — performance + cinematic upgrade (Canvas build)

Brings the upstream perf + cinematic patch into main. Same architecture (shared core, thin renderers, schema-driven scene) and file layout. Canvas build only; the SVG build keeps working since the shared geometry retains its legacy fields. Root index.html (the Canvas-vs-SVG chooser) is unchanged.

Performance

  • Zero trig in hot loops — land dots, corona spikes and aurora samples precompute sin/cos at build; per-frame projection is pure multiplies via angle-sum identities. Sun cos/sin(lon) cached too.
  • Tier-sorted land dots — sorted by relief tier with tierEnd ranges so each tier draws as one contiguous run (one fillStyle, no per-dot branching).
  • Low-res offscreen terminator — day/night fills a 0.22× canvas upscaled to screen (~1/20th the fill cost, softer twilight edge for free).
  • Cached GeoJSON — night/core circles rebuild only when the sun moves (~1/s), not per frame.
  • Adaptive qualityBaseEngine tracks an EMA of frame time and nudges a dpr multiplier (down to 0.55) with cooldown hysteresis; CSS size never changes.

Visual

  • Deeper offset-lit ocean + atmospheric scatter inside the limb; wider cyan→violet rim with a crisp shell line.
  • New toggles: sun glare at the subsolar limb (drawn under the sphere), parallax starfield, nebula haze.
  • 4-layer beams, twin impact rings, 3-pass aurora, warmer city lights, slower/majestic meteors.

Cinema

  • Cinematic arrival (intro) — ~3.2s choreographed bloom on load; rotation eases in from stillness.
  • Pointer parallax (parallax) — pointer eases a ±3.2° look offset added at projection time.
  • The Moon (moon), HQ heartbeat (heartbeat), rare comet (comet), constellations, ocean sun glint (sunGlint), city surges (surges).

Interaction & defaults

  • Fling inertia — flick the globe and it glides, decaying back into auto-rotation (works while paused).
  • Calmer defaults: rotation 4°/s, activity 2.4/s, meteor frequency 40%.

Files

  • New: canvas/draw.js (shared canvas helpers), canvas/cinema.js (six cinematic layers).
  • Touched: shared/{geometry,geo,engine,sim,scene-schema,config,ui.css,ui}.js, canvas/{layers,main}.js, CHANGELOG.md.

Commits are split by theme and GPG-signed.

@pacMakaveli pacMakaveli force-pushed the feat/canvas-perf-cinematic-upgrade branch from 7542860 to b0fd24b Compare June 12, 2026 12:23
Precompute sin/cos of lat and lng at build time so per-frame projection
of land dots, corona spikes and aurora samples is pure multiplies via
the angle-sum identities. Tier-sort land dots with tierEnd ranges so each
relief tier draws as one contiguous run. Cache the sun's cos/sin(lon) and
rebuild night/core GeoJSON only when the sun moves, not per frame. Legacy
geometry fields retained so the SVG build keeps working.
Track an EMA of raw frame time and nudge a dpr multiplier down (to 0.55
min) on sustained slow frames, back up with cooldown hysteresis; CSS size
never changes. Add the intro ramp (0->1 over ~3.2s) with introPhase(a,b)
for layers to read eased sub-windows, plus fling inertia so a flick glides
and decays back into auto-rotation (works while paused).
Slower, longer-lived meteors and slower beam draw with longer dissolve.
Calmer defaults: rotation 4 deg/s, activity 2.4/s, meteor frequency 40%.
Add the cinema schema section (intro, parallax, moon, heartbeat, comet,
constellations, sunGlint, surges) and the new visual toggles (sunGlare,
parallaxStars, nebula) so platform configs can drive them.
New canvas/draw.js (composite ops, glow sprites, blit, path-from-segments)
and canvas/cinema.js with six layers: orbiting moon, rare comet,
shimmering constellations, ocean sun glint, HQ heartbeat wave, and city
surges.
Deeper offset-lit ocean, wider atmospheric rim with crisp shell line,
sun glare under the sphere, low-res offscreen terminator, parallax
starfield, nebula haze, 4-layer beams, twin impact rings, 3-pass aurora
and warmer city lights. Register the new cinematic layers and read the
engine's intro/parallax state in main.
Surface the new cinema and visual toggles in the scene panel with
matching styles.
@pacMakaveli pacMakaveli force-pushed the feat/canvas-perf-cinematic-upgrade branch from b0fd24b to 401fdb4 Compare June 12, 2026 12:25
@pacMakaveli pacMakaveli changed the title Feat/canvas perf cinematic upgrade feat: canvas performance + cinematic upgrade Jun 12, 2026
@pacMakaveli pacMakaveli merged commit a37618b into main Jun 12, 2026
1 of 2 checks passed
@pacMakaveli pacMakaveli deleted the feat/canvas-perf-cinematic-upgrade branch June 12, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant