How the engine draws a black hole
Every picture on BlackHoles.fyi is drawn live on your device's graphics chip by one program, the engine. This page goes through what it works out, part by part, and says where we have filled a gap by hand.
Why it marches rays instead of tracing straight lines
Ray tracing, as films and games use it, sends one ray backwards from the camera through each pixel and treats the ray as a straight line. Finding what the pixel shows is then one calculation: where does that line first meet a surface?
Near a black hole that fails, because light doesn't travel in straight lines there. The hole's gravity curves spacetime, and a ray passing close is bent, by more the closer it passes, and keeps bending for as long as it is near. This is gravitational lensing. There is no simple sum that says where a bent ray lands, so the engine walks each ray instead: a short step, a turn by as much as the curved spacetime says, then a check. Has the ray fallen through the event horizon, the boundary nothing gets back out through? Crossed the disc of gas? Got far enough out to read the stars? If not, it takes the next step. That walk is ray marching.
Strictly, it is still ray tracing, done in steps along a curve. Stepping also lets the engine add up the light from glowing gas the ray passes through on the way, not just the first surface it meets.
Side on: a camera a little above the disc of gas, and four rays traced backwards from it, as the engine traces one for every pixel. The dots mark its steps.
- Falls into the hole. Nothing comes back out through the event horizon, so this pixel is black. Rays like it make the shadow.
- Bends over the top of the hole and lands on the far side of the disc. The dashed line is the straight path ordinary ray tracing would follow, and it misses the disc. This is why our pictures show the far side of the disc arching over the shadow.
- Bends a little and goes out to the stars. The pixel shows the star the ray ends on, not the one it set out towards, which is why the sky near the hole looks stretched and moved.
- Heads down onto the near side of the disc, bent only slightly.
These are real paths for a black hole that doesn't spin, worked out with the engine's own step. There are fewer dots than steps: near the hole the steps are shorter, so the bend is followed closely.
Bending the light
A hole that doesn't spin. The engine steps each ray through the curved spacetime Karl Schwarzschild described in 1916, in the flat plane the ray stays in, with up to 600 steps a ray. Steps are short near the hole and grow further out, where the light runs almost straight.
A spinning hole. Most of our pictures show a spinning hole, described by Roy Kerr's solution of 1963. A spinning hole drags spacetime round with it (frame dragging), so the rays no longer stay in one plane and the shadow comes out lopsided. The engine follows each ray in three dimensions, with up to 700 steps, shortening them close to the horizon so the shadow's edge lands where it should. Its shadow matches the size and shape James Bardeen worked out in 1973 to within 1% at the spins we've checked.
Traced once, shaded every frame. For a spinning hole, tracing every ray every frame would be too slow. While the camera moves, the engine traces a coarse picture; once it stops, it traces the full one a few rows at a time. The paths don't change as time passes, only the gas moving along them, so the picture keeps moving without being traced again.
From far away. In the view from Earth the camera is a hundred thousand times the hole's mass away, with the mass measured as a length: for M87*, about a hundred light years. The engine runs those rays straight until they near the hole and adds the small bend they skipped from a formula, which is accurate that far out.
The shadow and the photon ring
The shadow. The dark patch is every direction whose ray ends on the event horizon. It isn't painted on: it is where the marched rays stop.
The photon ring. Light that passed close enough to loop part or all of the way round the hole before reaching the camera makes a thin bright line at the shadow's edge. It comes out of the same rays. It is thinner than a pixel, so each frame the engine aims the rays that pass close to the hole at a slightly different point inside their pixel, and the picture shows the average of the last eight frames.
The disc of gas
Where it starts. The disc's inner edge is the innermost stable circular orbit (ISCO): closer in, gas can't keep circling and falls in. For a hole that doesn't spin it is three times the radius of the event horizon, and closer in for a fast spinner, as Bardeen, Press and Teukolsky worked out in 1972. Each ring of gas orbits at the speed general relativity gives for its distance.
How thick it is. The disc's height comes from the standard model of such discs (Shakura and Sunyaev, 1973) for how fast the hole is feeding. The engine finds the disc's surface where a ray has passed through enough gas to stop seeing through it, so the thin gas at the rim shows as a soft edge.
How hot it is, and its colour. The temperature across the disc follows the relativistic disc model of Novikov and Thorne (1973): zero at the inner edge, hottest a little further out, cooling outwards. Each patch glows as a blackbody, the light any hot object gives off, turned into screen colour the way the eye's colour sensitivity would.
Doppler beaming and redshift. Gas on the side coming towards you looks brighter and bluer, and gas going away looks dimmer and redder: Doppler beaming. Light climbing out of the hole's gravity also loses energy, gravitational redshift. The engine works out both, and frame dragging, for every pixel, from the ray's own path. Near the inner edge, where the gas moves fastest, the side coming towards you can look many times brighter than the side going away.
Limb darkening. A patch of disc seen edge on looks about a third as bright as one seen face on, by a law Subrahmanyan Chandrasekhar worked out for light scattering out of hot gas.
The gas pattern. The streaks in the gas are generated, not simulated. Their size comes from how thick each disc is, following published computer simulations of small patches of such a disc, and they are carried round at the right orbital speed. We draw them longer, sharper and brighter than those simulations show, so that they can be seen.
The outer disc. Far out, where the disc's own gravity would break it up, the engine draws it as clumps sheared into streaks.
How fast it feeds, and the jets
Three states. How fast a hole pulls in gas changes what surrounds it. A starving hole has almost nothing, so you see the shadow and bent starlight. A slowly fed hole has a hot, puffed-up cloud of gas, whose light the engine adds up along each ray. A fast-fed one has the thin bright disc, with a hot layer above it, the corona, that shines mostly in X-rays.
Jets. A spinning hole can fire jets of gas along its axis, powered by its spin, as Roger Blandford and Roman Znajek proposed in 1977. Their strength follows the spin, their width near the hole follows simulations, and further out they widen as measured for M87's jet. Their light is traced, so its bending and beaming are worked out. The bright knots and the twist in them are drawn.
The sky behind it
Bent starlight. A ray that gets clear of the hole reads the sky in the direction it ends up going. The background is NASA's map of the Milky Way, and every star brighter than tenth magnitude in the Hipparcos and Tycho catalogues is drawn as a point, in the colour its temperature gives. Near the hole the bending stretches stars into arcs and brightens them, worked out from how far apart neighbouring pixels' rays end up.
Each hole's own sky. For most of our real black holes the sky is drawn as it would look from the hole itself: the stars of our Galaxy moved to its position, or a model of the galaxy it sits in.
The camera
Where you can stand. The camera hovers in place, from close up to as far as Earth. Close to a spinning hole there is a region, the ergosphere, where nothing can hover: spacetime is dragged round so fast that staying still would mean moving faster than light. So hovering stops at the ergosphere's edge. Keep pushing and the camera lets go and falls instead, down to just outside the event horizon.
Light arrives all at once. The main picture shows every part of the gas at the same moment, as if light took no time to travel. Clocks near a black hole run slow, and the picture doesn't show that yet.
From light to screen
Exposure and glow. The engine works in real brightness, which spans far more than a screen can show, then adds a soft glow round the brightest parts and maps the result onto the screen with a filmic tone curve, as a camera would.
Views. Dramatic colours the gas by how hot it looks, on a scale chosen for the picture. As seen shows the colours a camera would record. Doppler shift colours it by how much its light is shifted. Wavelength band shows it in X-rays, ultraviolet, visible light, infrared or radio.
Sharpness. The engine draws fewer pixels on a slower device and more on a faster one, judging from how long each frame takes.
Where we use artistic licence
Some choices make the picture easier to read, and each is marked on the picture with a way to see it as it is: the Doppler effect drawn at two and a half times its strength, false colour in the Dramatic view, the near side of the disc softened, the host galaxy's glow dimmed, the Milky Way's contrast stretched, a longer exposure for the faint outer disc, and the outer disc cut away. Left out for now: the slim, puffed-up disc of a hole feeding near its limit, winds off the disc, a disc tilted against the spin, and light's travel time.
The Research pages list the papers behind each part of the picture, and say for each whether it is worked out exactly, modelled or drawn.