A black hole with a disk of hot gas around it, drawn by tracing every pixel's ray of light backward through curved space, live in the browser. It opens with gravity switched off, so the disk is a plain flat ring around a dark ball, then turns gravity on over a few seconds. The far side of the disk lifts over the top of the hole, its underside appears below, and a thin photon ring traces the edge of the shadow.
How to use it
- Drag to orbit the hole and scroll (or pinch) to zoom. The arrow keys orbit too, and + and − zoom.
- Gravity runs from off to full strength, so you can watch the lensing grow from a flat ring.
- Disk temperature sets the gas from 2,400 K to 14,000 K, from a dull red to blue-white.
- Doppler switches the brightening and colour shift from the gas's orbital speed on and off. With it on, the side moving toward you is brighter and bluer.
- Notes labels the features: the far side and underside of the disk, the photon ring, the Einstein ring, the shadow and the approaching side.
- Replay runs the opening again, and H hides the interface.
With reduced motion set in your system, it starts with gravity already on and the scene holds still.
How it works
Distances are in units of the Schwarzschild radius, so the event horizon sits at r = 1, the photon sphere at 1.5 and the innermost stable orbit, where the disk begins, at 3. For each pixel, a fragment shader follows a ray of light from the camera using the Schwarzschild null geodesic written as an acceleration, x'' = −(3/2) h² x / r⁵, where h is the ray's angular momentum. It integrates that with up to 260 leapfrog steps whose size grows with distance from the hole. A ray that falls inside r = 1 is black. One that escapes picks up the sky, and one that crosses the disk plane between r = 3 and 13.5 adds the disk's light and loses some of its transparency. The Gravity slider scales the acceleration, so at zero every ray runs straight.
The disk's brightness follows a thin-disk flux profile. Its colour is a black-body temperature from a fit to the Planckian locus, shifted by the product of the Doppler factor for gas orbiting at up to half the speed of light and the gravitational redshift. Brightness scales with the cube of that shift. The gas texture is fractal noise sheared by Keplerian rotation, with two time-offset layers cross-fading so the spiral never winds up tight. The sky is three layers of hashed stars with black-body colours and a Milky Way band of noise clouds and a dust lane, set to cross behind the hole in the opening shot.
The frame renders into a half-float target, then a six-level bloom, ACES tone mapping, a vignette and dither. A governor watches frame times and lowers or raises the render resolution to hold a steady rate. The readout in the corner shows the resulting rays per second. The labels are placed with closed-form approximations: the shadow's apparent radius of √27/2 ≈ 2.6 Schwarzschild radii, and the Einstein ring from an iterated weak-field deflection angle with a second-order term.
Notes
Needs WebGL 2; without it the page explains that instead of going blank. Uses no libraries and no images. A personal dedication in the line above the title was removed for the public page, leaving the date.