Black Hole Ray Tracer · Null Geodesics, Live

Every pixel on the stage is one photon traced backward along an exact Schwarzschild null geodesic — RK4, ~200 steps, integrated in the fragment shader at 60 fps. The photon ring, the shadow, the doubled disk image, and the Doppler-bright approaching side all emerge from the geodesic equation; nothing is painted on. The page verifies its own integrator on load.

Darwin 1959 · Luminet 1979 · Bardeen 1973 · James, von Tunzelmann, Franklin & Thorne 2015 · EHT 2019
MODEL CLASS  EXACT NULL GEODESICS  every pixel is one photon integrated backward in Schwarzschild spacetime
Schwarzschild
spacetime
√27 M = 2.598 rs
b_crit · analytic
b_crit · this page, live
6 M
isco = disk inner edge
3 M
photon sphere
shadow diam · this camera
Per-pixel geodesic integration · d²x/dλ² = −(3/2) h² x/r⁵ · exact for Schwarzschild null rays

One pixel, one photon, one geodesic

Drag to move the camera, scroll to zoom. The thin ring hugging the shadow is light that orbited the hole before escaping; the disk appears above and below the shadow because rays from the far side are bent over the top.

Physics switches

Compare · split screen
Light propagation
Disk rendering
Doppler + beaming (g⁴)
Accretion disk
Background
Quality

Side B physics · camera locked to A

Light propagation
Disk rendering
Doppler + beaming
Disk
Mass M_B / M_A · same physical distance
Geometry is scale-free in rs units, so mass only matters at fixed physical distance: a ×2 hole shows a ×2 shadow. Default comparison: Doppler on (A) vs off (B) — the Interstellar choice.
A · GR · Doppler on · blackbody
B · GR · Doppler off · blackbody

Optics at this camera · exact

camera r30.0 r_s
inclination (from pole)80°
field of view30°
shadow angular diam
b_crit (capture)2.598 r_s
disk inner / outer3 – 10 r_s
g at ISCO · face-on0.7071
integrator steps / px192
Shadow diameter uses Synge 1966: sin θ = b_c √(1−r_s/r) / r. Scaled to M87* (6.5×10⁹ M☉ at 16.8 Mpc) this camera's shadow corresponds to 39.7 µas; EHT measured 42 ± 3 µas.
Camera distance30 r_s
Inclination from pole80°
Field of view30°
Disk outer edge10 r_s
Home · Entry XV · Black Hole Ray Tracer

1 · The geodesic engine

For a photon in Schwarzschild spacetime the orbit equation in u = 1/r is the Binet equation with a single relativistic correction term. In Cartesian form — the form a fragment shader wants — it becomes a central force with one conserved quantity, and it is exact: not a post-Newtonian expansion, not a fit. The shader integrates it with fixed-step RK4, one ray per pixel per frame, traced backward from the camera.

$$\frac{d^2u}{d\varphi^2} + u \;=\; \frac{3}{2}\, r_s\, u^2$$
Binet equation for null geodesics, u = 1/r — the (3/2) r_s u² term is all of GR here
$$\frac{d^2\mathbf{x}}{d\lambda^2} \;=\; -\frac{3}{2}\, h^2\, \frac{\mathbf{x}}{r^5}, \qquad h = |\mathbf{x}\times\mathbf{v}| \;\;\text{conserved}$$
equivalent Cartesian form (r_s = 1 units); λ chosen so |v| = 1 at infinity, then h = impact parameter b
$$b \;<\; b_c \;=\; \frac{3\sqrt{3}}{2}\, r_s \;=\; \sqrt{27}\,\frac{GM}{c^2} \;\approx\; 2.598\, r_s$$
capture condition (Darwin 1959) — the edge of the shadow

Rays that end below the horizon paint the shadow. Rays that escape sample the background sky with their final direction — that is all gravitational lensing is. Rays with b just above bc wind around the photon sphere at r = 1.5 rs one or more times before leaving: they build the photon ring and the higher-order disk images, with no special-case code. On load, the page bisects its own integrator for the capture threshold and prints the result in the header strip next to the analytic value — if those two numbers ever disagree, do not trust the picture.

2 · The disk and the redshift factor

The disk is the Shakura-Sunyaev geometrically-thin, optically-thick disk, truncated at the ISCO (r = 6M = 3 rs), with matter on exact circular geodesics. Each disk pixel is shifted and beamed by the exact redshift factor for a circular-orbit emitter seen by a distant observer:

$$g \;=\; \frac{\nu_{\rm obs}}{\nu_{\rm em}} \;=\; \frac{\sqrt{1 - 3M/r}}{1 - \Omega\lambda}, \qquad \Omega = \sqrt{M/r^3}, \qquad \lambda = L_z/E$$
Cunningham 1975 — λ read off the traced ray's conserved x × v
$$I_{\rm obs} = g^4\, I_{\rm em}, \qquad T_{\rm em}(r) \propto r^{-3/4}\left(1 - \sqrt{r_{\rm in}/r}\right)^{1/4}, \qquad T_{\rm obs} = g\, T_{\rm em}$$
bolometric beaming from I_ν/ν³ Liouville invariance · SS73 temperature profile · observed color

Three checks the formula passes by construction: seen face-on, g = √(1−3M/r) everywhere on a ring (pure gravitational + transverse-Doppler — at the ISCO exactly 0.7071, the same number as the orbiting clock in Entry XIV); the approaching side has g > 1 and is beamed brighter by g⁴, which is the asymmetry Luminet's 1979 photograph showed and the EHT ring shows; and with the Doppler switch off the disk becomes symmetric, isolating the purely gravitational redshift. The false-color g mode paints the disk by g directly — blue where the spectrum is blueshifted, red where redshifted — which is the single most useful teaching view on this page.

What the upper and lower arcs are: the disk's far side, whose light is bent over the top of (and beneath) the hole on its way to you. The thin ring just outside the shadow is the secondary image — light that crossed the disk plane after at least half an orbit of the photon sphere. Both were in Luminet's hand-plotted 1979 figure and both emerge here from the integrator alone.

3 · Configurations

Presets set camera, disk, and switches; everything stays live afterward. The Gargantua preset deliberately turns Doppler beaming off — the same choice the DNGR team made for Interstellar, because the true g⁴ asymmetry makes half the disk nearly invisible (James+ 2015, §4.2). Toggle it back on to see what Hollywood hid.

Presetcameraincl.switcheswhat it teaches
Luminet 197930 r_s80°blackbody · Doppler onthe original computed image: asymmetric brightness, doubled disk
Gargantua22 r_s85°Doppler offthe Interstellar look, and why it is not what you would really see
EHT M87*60 r_s17°false-color gnear-face-on ring; mild Doppler asymmetry; shadow at √27 M
Pure lensing30 r_s15°disk off · grid bgEinstein ring and sky distortion with no disk in the way
Photon ring110 r_s80°narrow FOV 4°shadow edge and the stacked higher-order images
No relativity30 r_s80°straight rayscontrol case: flat-space camera, disk half-hidden, no ring, no shadow edge

4 · Verification

The integrator in the shader is the same equation verified below. Rows marked live are computed by this page in JavaScript on load with the identical RK4 scheme; the offline rows were run at higher step counts during construction. Published anchors in the right column.

Testintegrator resultanalytic / publishedstatus
Capture threshold b_c (live, bisection)3√3/2 = 2.59808 r_s
Deflection at b = 100 r_s (live)2 r_s/b = 2.000×10⁻² rad (+1.5% O(b⁻²) term)
Deflection at b = 500 r_s (offline)4.006×10⁻³ rad4.000×10⁻³ rad · ratio 1.0015✓ converges to 4GM/c²b
Solar-limb deflection (analytic chain)1.75″ — Dyson, Eddington & Davidson 1920
M87* shadow diameter42 ± 3 µas — EHT 2019 Paper VI
Sgr A* shadow diameter51.8 ± 2.3 µas — EHT 2022 Paper I
g at ISCO, face-on0.70711 (formula in §2)√½ exactly — Bardeen, Press & Teukolsky 1972✓ exact

The M87*/Sgr A* rows convert √27 GM/c² to angular size with the EHT-adopted masses and distances (6.5×10⁹ M☉ at 16.8 Mpc; 4.297×10⁶ M☉ at 8.28 kpc). The Schwarzschild prediction lands inside both error bars; spin moves the predicted diameter by at most ~4% (Johannsen & Psaltis 2010), below EHT's current precision.

5 · Boundary of validity  mandatory

What exact Schwarzschild ray tracing gives you — and what it doesn't

Model class: analytic (exact null geodesics + exact circular-emitter redshift) wrapped around one declared simplification (the Newtonian disk flux profile). The geometry of every photon path is exact; the disk's absolute brightness profile is not.

Lensing geometry exact

Shadow size, photon ring, Einstein rings, deflection angles, image multiplicity: all from the exact geodesic equation, verified against Darwin 1959 / Synge 1966 closed forms in §4 — including by the page itself at load time.

valid · all observables that are pure geometry
Redshift factor exact

g for circular-geodesic emitters is the exact Cunningham 1975 expression — gravitational, special-relativistic Doppler, and beaming combined with no expansion. Face-on ISCO value √½ ties this entry numerically to Entry XIV.

valid · disk kinematics
Schwarzschild, not Kerr

Astrophysical black holes spin. Kerr moves the ISCO (down to 1M prograde), drags the photon region into asymmetry, and displaces the shadow centroid. For the EHT sources the shadow-size shift is ≲4%, but disk appearance at high spin differs substantially — DNGR (James+ 2015) is the Kerr reference implementation.

fails · spin-dependent features
Disk flux is Newtonian SS73

T ∝ r−3/4(1−√(rin/r))1/4 is the Shakura-Sunyaev profile; the fully relativistic Page-Thorne 1974 flux differs by tens of percent near the ISCO. Image geometry and g-factors are unaffected; relative brightness across the inner disk is approximate, and the display temperature scale is a rendering choice.

fails · quantitative inner-disk photometry
Thin disk ≠ EHT source

M87* and Sgr A* are optically-thin, geometrically-thick hot flows imaged at 230 GHz, not optically-thick thin disks. The valid comparison made here is shadow geometry only; reproducing the EHT ring brightness requires GRMHD + radiative transfer (EHT Paper V).

fails · EHT image morphology beyond the shadow
Static spacetime, static camera

No light-travel-time variability, no orbiting hot spots, no polarization (EHT 2021 Paper VII), and the camera is at rest — a camera plunging or orbiting would add aberration and its own Doppler field.

fails · time-domain and polarimetric observables

Bottom line. Every geometric statement this page makes — where light goes, what is hidden, what is doubled, what is shifted by how much — is exact Schwarzschild GR, and the page proves its own integrator at load. The disk's absolute photometry is declared Newtonian, and spin is the next entry's problem.

References