A Black Hole, Ray Traced

A simulation, not an animation. Each pixel is a light ray traced through the curved space around a non-spinning black hole, calculated live on your graphics card.

Drag to rotate. Ctrl + scroll or pinch to zoom.Drag to rotate. Pinch to zoom. Phones run a reduced-quality version. ↓ What am I looking at?

A Simulation, Not an Animation

The image above is a black hole with an accretion disk: a flat disk of hot gas orbiting it. Gravity bends the light from the disk on its way to the camera. That is why the far side of the disk appears above and below the black hole, and why a thin bright ring surrounds the dark center.

The image is calculated, not drawn. For each pixel, your graphics card traces a ray of light backward from the camera using the equations of general relativity, finds where it came from, and sets the pixel’s color and brightness from the temperature and motion of the gas at that point. Change a setting and the image is recalculated. The method, its simplifications and the sources are described below.

It runs best on a laptop or desktop computer. Phones and other small devices get a lower-resolution, less precise version. The still images further down this page are full-quality renders.

Built with Claude Opus 5.5. New to black holes? Start here →

The Numbers Behind the Image

5.20 M
Shadow radius, 3√3 M. The same from every viewing angle.
3 M
Photon sphere, where light can orbit the hole.
6 M
Innermost stable orbit, the disk’s inner edge.
0.5 c
Orbital speed of gas at the inner edge, as measured locally.
81×
Peak ratio of total (bolometric) brightness, approaching vs. receding inner edge, seen edge-on: (1.41 / 0.47)4.

Distances are in units of M = GM/c², half the event horizon’s radius. For the Sun that is 1.48 km; for Sagittarius A*, 5.9 million km; for M87*, 9.6 billion km.

Reading the Image

The accretion disk is flat. Almost everything that makes the picture look strange is gravity bending the light on its way to you.

The shadow

Any ray passing within 3√3 M ≈ 5.2 M of the center falls in, so the dark region is 2.6 times wider than the event horizon itself. Its angular size gives the ratio of the black hole’s mass to its distance. With the distance known, that gives the mass, which is how the Event Horizon Telescope measured the mass of M87*.

The photon ring

A thin bright line lies just outside the shadow. It holds images of the disk made by light that looped half an orbit, a full orbit and more around the photon sphere. Each successive image is about e−π ≈ 1/23 as wide as the one before.

The arc over the top

Light from the far side of the disk, hidden behind the hole, is bent over the top and under the bottom toward you. This is the disk’s back half, not a second disk. Luminet computed the first such image in 1979.

The bright side

Gas at the inner edge orbits at half the speed of light. Relativistic beaming scales total brightness with the fourth power of the frequency shift, so seen edge-on the approaching side is up to 81 times brighter than the receding side, and bluer.

Gravitational redshift

Light loses energy as it travels away from the black hole. At the inner edge, gravity and orbital time dilation together lower every frequency to √(1 − 3M/r) ≈ 71% of its emitted value, dimming and reddening the inner disk even when seen face-on.

Stretched stars

Background stars near the Einstein ring are stretched into arcs, and each star appears at least twice, once on each side of the hole. Switch the background to the coordinate grid to see the distortion directly.

Black hole seen nearly edge-on, inclination 3 degrees3°
Black hole at inclination 20 degrees20°
Black hole at inclination 50 degrees50°
Black hole seen nearly face-on, inclination 85 degrees85°
The same black hole at four elevations. The shadow keeps its size throughout; the lensed far side, the photon ring and the Doppler asymmetry all change with inclination.

Switch Off the Physics, One Effect at a Time

Each pair below changes a single setting. Every setting shown here is available in the simulator above.

Light bending

Without general relativity, rays travel in straight lines: the disk looks like a flat ring and the horizon is a small black sphere. With it, the far side of the disk becomes visible above and below the black hole, and the shadow grows to 2.6 times the horizon’s size.

Disk rendered with straight light raysStraight-line light
Disk rendered with relativistic light bendingGeneral relativity

Frequency shifts

Doppler beaming brightens the approaching side and dims the receding one; gravitational redshift dims the inner disk everywhere. The film Interstellar deliberately left both out, which is why its disk is symmetric. Real black hole images are lopsided.

Disk without frequency shifts, symmetric in brightnessNo frequency shifts
Disk with Doppler and gravitational shifts, brighter on the leftDoppler and gravitational shifts

Telescope resolution

The Event Horizon Telescope is an Earth-sized radio interferometer with a resolution near 20 microarcseconds, about 5 M for M87*. At that resolution the photon ring and fine structure merge into a single ring; the shadow and the brightness asymmetry remain visible.

Radio-style rendering at full resolutionFull resolution, viewed 17° from the pole
The same rendering blurred to EHT resolution, showing a crescentBlurred to 5 M, as the EHT saw M87*
Both images are renderings from this simulator, not Event Horizon Telescope data. M87’s jet points 17° from our line of sight. Assuming the disk sits perpendicular to the jet, we see it nearly face-on: 73° elevation here. The real image comes from hot, optically thin plasma around a spinning hole, not a thin blackbody disk, so this pair shows the effect of resolution, not a model of M87* itself.

What Moves, and How Fast

A steady disk produces a fixed image; the animation shows the gas itself moving. Gas at each radius orbits at the circular-orbit rate, as seen from far away,

Ω = √(M / r3),

This is the same form as Newton’s law, and for a non-spinning black hole it holds without approximation. With the default 22 M outer edge, gas at the inner edge completes about seven orbits for each one at the outer edge, which stretches bright patches into spiral streaks. A single bright patch gets brighter as it moves toward you and fainter as it moves away, which is relativistic beaming.

Time runs in units of M: GM/c³, the time light takes to travel one M. Its real length depends on mass:

Black holeMass1 M of timeOrbit at the inner edge
Stellar-mass10 suns49 µs4.5 ms
Sagittarius A*4.0 million suns20 s30 minutes
M87*6.5 billion suns8.9 hours34 days

Sagittarius A* really does flare on these timescales: the GRAVITY instrument tracked flaring hot spots circling it in under an hour, close to the innermost stable orbit.

Two simplifications apply. The texture is illustrative turbulence, not a fluid simulation; it is re-seeded every 90 M with a crossfade so shear never winds it into infinitely fine stripes, while the orbital speed at every radius is unchanged. And each frame shows the whole disk at one instant, ignoring the tens of M of extra travel time light from the far side needs to reach you.

How Each Pixel Is Computed

  1. Launch a ray from the camera. The camera is a static observer at radius rc. The direction it sees is converted to Schwarzschild coordinates, which also gives the ray’s impact parameter:
    b = rc sin α / √(1 − 2M/rc)
  2. Follow it through curved spacetime. A light ray’s path around a Schwarzschild black hole obeys the orbit equation below, with u = 1/r. It is integrated in an equivalent three-dimensional form with a fourth-order Runge–Kutta method, taking steps proportional to r so that rays near the photon sphere are resolved finely.
    d2u/dφ2 + u = 3Mu2  ⟺  ẍ = −3M h2 x / r5,  h = |x × ẋ|
  3. Find where it meets the disk. Each crossing of the equatorial plane between the inner and outer radius is a hit. Rays that fall below r = 2M are captured; rays that escape sample the background sky in their final direction.
  4. Compute the frequency shift. Gas on a circular orbit, observed via a photon with angular momentum per unit energy λ, arrives shifted by
    g = νobs/νemit = √(1 − 3M/r) / (1 − Ωλ) × 1/√(1 − 2M/rc)
    This single factor contains the Doppler shift, the transverse time dilation of the orbiting gas, gravitational redshift and the camera’s own gravitational blueshift.
  5. Color it. The disk radiates as a blackbody with temperature set by the Page–Thorne flux, the standard relativistic thin-disk solution with zero torque at the inner edge (x = √(r/M), x0 at the inner edge):
    F(r) ∝ [x − x0 − (√3/2) ln( (x−√3)(x0+√3) / (x+√3)(x0−√3) )] / x5(x2−3),   T ∝ F1/4
    Because Iν/ν3 is conserved along every ray, the light that arrives is exactly a blackbody spectrum at temperature gT. The pixel takes that spectrum’s color and brightness, integrated against the CIE 1931 color-matching functions.
  6. Display it. A filmic tone curve maps the huge range of brightness onto the screen. The optional glow imitates light scattering in a camera or eye and is the one purely cosmetic step.

Verification. A test harness runs the same integrator in double precision. It places the capture boundary at b = 5.196152 M, matching the exact value 3√3 M to seven digits, and reproduces weak-field deflection angles to a few parts in 100,000. The graphics card repeats the calculation for every pixel in single precision, each frame.

What This Model Leaves Out

References

  1. Luminet, J.-P. (1979). Image of a spherical black hole with thin accretion disk. Astronomy & Astrophysics, 75, 228–235. ADS
  2. Page, D. N., & Thorne, K. S. (1974). Disk-accretion onto a black hole. Time-averaged structure of accretion disk. The Astrophysical Journal, 191, 499–506. DOI
  3. Novikov, I. D., & Thorne, K. S. (1973). Astrophysics of black holes. In C. DeWitt & B. DeWitt (Eds.), Black Holes (Les Astres Occlus), 343–450. Gordon and Breach. ADS
  4. Shakura, N. I., & Sunyaev, R. A. (1973). Black holes in binary systems. Observational appearance. Astronomy & Astrophysics, 24, 337–355. ADS
  5. Bardeen, J. M., Press, W. H., & Teukolsky, S. A. (1972). Rotating black holes: locally nonrotating frames, energy extraction, and scalar synchrotron radiation. The Astrophysical Journal, 178, 347–370. DOI
  6. Misner, C. W., Thorne, K. S., & Wheeler, J. A. (1973). Gravitation, chapter 25. W. H. Freeman. Link
  7. Rybicki, G. B., & Lightman, A. P. (1979). Radiative Processes in Astrophysics, chapter 4. Wiley. ADS
  8. James, O., von Tunzelmann, E., Franklin, P., & Thorne, K. S. (2015). Gravitational lensing by spinning black holes in astrophysics, and in the movie Interstellar. Classical and Quantum Gravity, 32, 065001. DOI
  9. Gralla, S. E., Holz, D. E., & Wald, R. M. (2019). Black hole shadows, photon rings, and lensing rings. Physical Review D, 100, 024018. DOI
  10. Johnson, M. D., et al. (2020). Universal interferometric signatures of a black hole’s photon ring. Science Advances, 6, eaaz1310. DOI
  11. Event Horizon Telescope Collaboration (2019). First M87 Event Horizon Telescope Results. I. The Shadow of the Supermassive Black Hole. The Astrophysical Journal Letters, 875, L1. (Mass in Paper VI, L6.) DOI
  12. Event Horizon Telescope Collaboration (2022). First Sagittarius A* Event Horizon Telescope Results. I. The Shadow of the Supermassive Black Hole in the Center of the Milky Way. The Astrophysical Journal Letters, 930, L12. DOI
  13. GRAVITY Collaboration (2018). Detection of orbital motions near the last stable circular orbit of the massive black hole SgrA*. Astronomy & Astrophysics, 618, L10. DOI
  14. Walker, R. C., et al. (2018). The structure and dynamics of the subparsec jet in M87 based on 50 VLBA observations over 17 years at 43 GHz. The Astrophysical Journal, 855, 128. DOI
  15. Wyman, C., Sloan, P.-P., & Shirley, P. (2013). Simple analytic approximations to the CIE XYZ color matching functions. Journal of Computer Graphics Techniques, 2(2), 1–11. Link

Free to Use, With Credit

Images and recordings you make with this simulator, and the figures on this page, may be used for any purpose, including teaching, publication and commercial work, without asking permission. We only ask that you credit Frosty Wren Studios, for example:

Black hole simulation: Frosty Wren Studios, frostywren.com/black-hole

“Save image” adds this line to the corner of each picture by default; you can switch it off under Animation and output. The simulator’s source code is not covered by this permission.

← Frosty Wren Studios TiGen → Dev Journal →