Black Hole

Lens

Behind the render

Topic

The math

How big is the black shadow?

Light that passes closer than about 5.2 M spirals in and never comes back. The shadow is that capture zone seen from far away, about 2.6 times the event horizon's width.

b_c = 3√3 M ≈ 5.20 M(no spin)

In the sim With spin, the edge comes from Bardeen's (1973) photon orbits (shaders.ts rhoCrit), flattened on the side turning toward you.

Why does the far side of the disk appear above the hole?

Light from behind the hole bends up and over it on its way to you. So you see the back of the disk wrapped above, and below, the shadow.

u(φ) = u₁ + (u₂ − u₁) sn²(sφ + c, k),u = M/r

In the sim Each pixel's ray follows this exact orbit, traced once per view (shaders.ts trace). Each frame then only re-lights the gas where the ray crossed the disk.

Why is one side of the disk brighter?

That side is orbiting toward you at a good fraction of light speed. Its light gets Doppler-boosted and bluer, and the gravity well reddens it all a little.

g = 1 / [uᵗ (1 − Ωλ)],T_seen = g · T

In the sim Each crossing's shift g is worked out from its orbit and the ray's angular momentum λ. Since I_ν/ν³ is invariant, shading a blackbody at g·T is exact, not a filter.

How hot is the disk?

Gas loses orbital energy as it spirals in, and radiates it. Bigger holes have cooler disks, because T ∝ M^−¼.

σT⁴ = 3GMṀ · Q(r) / (8π r³)

In the sim Q(r) is Page & Thorne's (1974) relativistic factor, zero at the inner edge (presets.ts). That gives about 6,400 K for Gargantua and 7.7 million K for the X-ray binary.

Where does the disk end?

Close in there are no stable circular orbits. Inside the ISCO, gas stops orbiting and plunges, so the disk has a sharp inner rim, and spin pulls it inward.

r_isco = 6 M (a = 0)→2.32 M (a = 0.9)

In the sim The rim comes from Bardeen, Press & Teukolsky's (1972) formula for each preset's spin (presets.ts). It also sets the orbit the Speed picker times.

What are the thin rings hugging the shadow?

Light that circled the hole once or more before escaping. Each extra half-orbit squeezes the image about 23× thinner, so the rings nest ever closer to the edge.

δₙ = C(r) · e^(−γ (φ₀ + nπ) / π),γ = π (no spin)

In the sim Orders 2 and 3 are drawn at their δₙ, with γ lowered by spin as Johnson et al. (2020) find. Each pixel is lit by the share of it that a ring covers.

Why do the spiral arms wind up?

Inner gas orbits faster than outer gas, so any pattern shears into a tightening spiral, then smears out.

Ω(r) = 1 / (r^3/2 + a)(in c³/GM)

In the sim Six arms are born and fade on a 240 M cycle as they wind up (shaders.ts). Each radius's orbital phase is reduced in double precision on the CPU, so the gas never judders.

Why does the X-ray binary look hotter than its temperature?

Its disk is so hot that electrons, not atoms, scatter the light. That hardens the spectrum into a diluted blackbody about 1.7× hotter.

I = f⁻⁴ B(f·T),f ≈ (72 keV / kT)^1/9

In the sim This is Done et al.'s (2012) colour correction. It takes the X-ray binary's 0.66 keV disk to the 1.1 keV observed in real systems; the two cool disks are unchanged.

Coding decisions

Why trace the light only when the view changes?

Where each pixel's ray crosses the disk depends only on the camera, not on time. So the lens is traced once into textures, and each frame just re-lights those crossings.

if (needsTrace) dispatch(trace)// tilt, zoom, preset, resize

Trade-off Dragging the tilt re-traces every frame, which is the slowest thing the page does. Automatic resolution steps down during a drag.

Why not step each ray through curved space?

Around a non-spinning hole a light ray's path has an exact formula. One evaluation per sample replaces hundreds of small integration steps per pixel.

u = u₁ + (u₂ − u₁) · sn²(sφ + c, k)

Trade-off Spin is approximated by stretching those paths to fit the spinning hole's real shadow, so there's no frame dragging twisting the lensed sky.

How does auto-exposure avoid stalling?

A compute pass meters a 96 × 54 grid of the image every 6 frames and nudges the exposure on the GPU. The original read pixels back to the CPU, freezing the GPU each time.

meter[0] = clamp(meter[0] − 0.5 · err, −1.5, 1.5)

Trade-off The WebGL2 fallback has no compute, so it uses only the starting exposure and runs a little brighter.

How do you prove a change didn't alter the picture?

A test page swaps the browser's clock for an exact 1/60 s per frame, so every run renders identical frames. A pixel diff then shows exactly what a change touched.

requestAnimationFrame = (cb) => raf(() => cb(t += 1000 / 60))

Trade-off It only runs in a headless browser on a software GPU, outside the site's build, so it isn't automatic yet.

Why is the fallback its own file?

Most visitors have WebGPU and never need it. The WebGL2 version is a separate 32 KB bundle, loaded with its integrity hash only after WebGPU fails.

<script data-bh-fallback=… data-bh-fallback-integrity=…>

Trade-off Its shaders are a hand port of the WebGPU ones, so a physics change has to be made in both.

Why does the Cool Sites card have its own copy?

The card is a plain script with no bundler, and its camera never moves, so it traces the lens once and only re-renders the gas, a few texture reads a pixel.

// copied from pages/black-hole/shaders.ts; keep in step

Trade-off Two copies of the physics drift apart unless both are edited together.

Fun facts

How sharp was the first black hole picture?

The Event Horizon Telescope linked dishes across the Earth to image M87* in 2019. Its ring is 42 microarcseconds wide, like spotting a doughnut on the Moon.

On this page The M87-like preset uses its mass and viewing angle.

Was Interstellar's black hole real physics?

Largely. Kip Thorne and the effects team traced real light paths and published the method. They left out Doppler beaming so the disk looked even, which is why the film's is symmetric.

On this page The Gargantua-like preset leaves beaming off too.

Would Earth fall in if the Sun became a black hole?

No. A black hole of the Sun's mass pulls on Earth exactly as the Sun does. Earth would keep its orbit; it would just get very cold and dark.

Would you be stretched like spaghetti?

Near a small black hole, yes, long before the horizon. A supermassive one's tides are gentle at the horizon, so you'd cross it without feeling anything special.

How fast does gas orbit at the edge?

Around a 10-solar-mass hole spinning fast, gas at the inner edge laps it in about 1.4 milliseconds. That's over 700 orbits a second.

On this page The readout shows each preset's orbit time; the Speed picker slows it down.

Is a black hole a good power source?

The best there is. A thin disk around a fast-spinning hole turns 15.6 % of the infalling mass into light. Fusion in the Sun manages about 0.7 %.

Do black holes evaporate?

In theory, by Hawking radiation. But a solar-mass hole is about 60 billionths of a degree above absolute zero, far colder than space, so today they all grow instead.

How big is the one at the middle of our galaxy?

Sagittarius A* is about 4 million times the Sun's mass, 26,000 light-years away. The Event Horizon Telescope imaged it in 2022.