feat: render the black hole and sky with a WebGL2 ray tracer

Replace the SVG core and backdrop with one shader that traces each pixel
through Schwarzschild spacetime. The shadow, the arch of the far side of the
disk, the second image and the Einstein ring come from the physics rather than
artwork. The disk is a thin disk seen from a low angle, about five times the
shadow's radius, with Doppler beaming and a filtered, cloud-like texture.

- Sky: a procedural galaxy baked once into a cubemap. Point sources are small,
  few and brightness-capped so they never rival the orbit markers, which now
  carry a dark backing disc and outline.
- Quality: tiers from high to still, a startup calibration cached per canvas
  size, an fps cap, and an idle sleep. A locked realistic map draws nothing.
- Integration: the canvas follows the galaxy frame through Big Screen, draws in
  Motion's post-render step, takes the disk clock and capture absorption from
  the galaxy loop, and falls back to the SVG core without WebGL2.
- Radar view: a toolbar toggle switches to a radar look that spreads outward
  from the hole as a wave, with a sweep on its own clock. The choice is
  remembered per browser; reduced motion switches at once and holds the sweep.
- Tests for the geodesics, quality governor, look spring and layout, plus a
  standalone preview page (web/blackhole-proto.html) for tuning the look.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 21:51:35 +07:00
parent 6320b6f244
commit 34e9afc8a4
19 changed files with 2067 additions and 6 deletions

View File

@@ -313,6 +313,7 @@ button:disabled { cursor: default; }
}
.vault-scene > :not(.space-backdrop) { position: relative; }
.space-backdrop { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.space-backdrop canvas { display: block; width: 100%; height: 100%; }
.space-backdrop::after {
position: absolute;
inset: 0;
@@ -337,13 +338,15 @@ button:disabled { cursor: default; }
.legend-snapshot { border: 1px solid #dfe4ef; transform: rotate(45deg); }
.galaxy-frame { width: 100%; max-width: calc((var(--workspace-height) - 120px) * 1.375); aspect-ratio: 11 / 8; align-self: center; justify-self: center; }
.galaxy-frame > svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.orbit-tracks { fill: none; stroke: #949eaa; stroke-width: .75; opacity: .28; }
.orbit-tracks { fill: none; stroke: #949eaa; stroke-width: .75; opacity: .36; }
.orbit-tracks .is-selected { stroke: #eebf92; stroke-dasharray: 3 4; stroke-width: 1.6; }
.orbit-marker { color: #c3c9d0; }
.orbit-marker--red { color: var(--color-orbit-red); }
.orbit-marker--amber { color: var(--color-orbit-amber); }
.orbit-marker--green { color: var(--color-orbit-green); }
.orbit-light, .orbit-halo { fill: currentColor; pointer-events: none; }
.orbit-light { stroke: #0a0c10; stroke-width: 1.4; }
.orbit-knockout { pointer-events: none; }
.orbit-halo { opacity: .08; }
.orbit-alert, .orbit-selection, .orbit-busy { fill: none; stroke: currentColor; stroke-width: 1.15; pointer-events: none; }
.orbit-selection { stroke: #f8eadc; stroke-width: 1; }