Black Hole Engine
What is Black Hole Engine
Black Hole Engine shows what a black hole really looks like, live in the browser. Every pixel traces a ray of light backwards through curved spacetime on the GPU, so the accretion disk bends over and under the shadow, its near side blazes brighter than its far side, and the whole sky warps around the hole. Move the camera or change the physics and everything is recomputed on the spot, with WebGPU on desktop and WebGL 2 on phones and tablets.
Exploring
- Fly anywhere: orbit, pan, roll and zoom with a mouse or a finger, or let a scripted observer circle the hole, hover above it or dive straight through the horizon.
- Real black holes: masses from stellar black holes to quasars, with presets for Sgr A*, M87*, Cygnus X-1 and TON 618 and every derived quantity in physical units.
- Two clocks: your proper time runs beside a distant observer’s, so time dilation is something you watch happen.
- A lensed universe: a rotating procedural galaxy, a star field and a nebula, seen from outside, from the centre or from within the galactic disk, plus an orbiting Jupiter lit by the disk.
- Views you can share: the link holds the whole view, so it opens exactly what you see. The app installs and works offline.
The Physics
- Three solvers: the exact Schwarzschild photon-orbit (Binet) equation, the same light paths with Kerr disk velocities, and full Kerr null geodesics integrated with an adaptive Dormand-Prince 5(4) step in Kerr-Schild coordinates, which stay regular across the horizon.
- Accretion flows: a Novikov-Thorne thin disk with turbulent arcs sheared by its rotation, a thick ADAF torus, a super-Eddington slim disk and GRMHD-inspired variants, all with Doppler beaming, gravitational redshift and blackbody colour. Relativistic jets rise along the spin axis.
- Checked against theory: the shadow of a non-spinning hole matches Synge’s formula within 1 %, and at a/M = 0.9 the flattened edge of a spinning one matches the Bardeen critical curve within 3 % of its width. Unit tests cover the horizon, ISCO and photon-orbit radii and the conserved quantities along a geodesic.
Presentations and Capture
A timeline editor turns any setup into a scripted presentation, with keyframed parameters, camera moves, annotations and bundled tours, saved and shared as JSON. Presentations render frame-exact to MP4 (H.264) or WebM (VP9 or AV1) through WebCodecs, streaming straight into the file where the browser allows it, or record in real time.
Technical Foundation
- One shader source: the ray tracer is written once in three.js TSL and compiled to WGSL for WebGPU and to GLSL for WebGL 2. It is built per scene variant (solver, flow model, jets), so each variant compiles only the code it uses.
- Image pipeline: temporal anti-aliasing, accumulation of still views, energy-conserving bloom, and AgX, Khronos PBR Neutral, ACES or false-colour scientific tone mapping.
- Quality presets: from Mobile to Cinematic, with a one-time GPU benchmark choosing the default.
- Interface: React around a React Three Fiber canvas, with a searchable parameter inspector, a command palette, keyboard shortcuts, in-app physics notes and sound that follows the simulation.
- Pipeline: every tool runs in Docker. Each push to
mainlints, tests and builds, runs the smoke e2e tests in headless Chromium on software WebGPU, then deploys to GitHub Pages. The README banner and gallery are rendered by the simulation itself.
Credits
- Engine: Echo Yin.
- Jupiter: the Cassini global map of Jupiter (NASA Photojournal PIA07782).
- Licence: code under PolyForm Noncommercial 1.0.0; third-party code keeps its own licences.