← Gallery
Simathon 01Black HoleHas videoHas code

Schwarzschild Black Hole Ray Tracer

Tejasi

A GPU-real-time render where every pixel is a photon traced backwards along an exact null geodesic of the Schwarzschild metric

Still from Schwarzschild Black Hole Ray Tracer

What it does

This is a real-time Schwarzschild black hole renderer where the black hole isn't drawn — it's *computed*. Every pixel on screen represents a photon fired backwards from a fixed cinematic camera (35 Schwarzschild radii out, 55° above the disk), and each one is traced along an exact null geodesic of the Schwarzschild metric using a fourth-order Runge–Kutta integrator. There's no lens-distortion shader faking the bending of light; the ray genuinely gets bent by solving the same equations that govern photon paths around a real non-rotating black hole, in geometric units where `G = c = M = 1`.

As each ray is integrated step by step, the simulation checks whether it crosses the equatorial plane between the photon sphere (3M) and 16M — if so, it's hit the accretion disk. There, it picks up a Shakura–Sunyaev-style intensity profile, gets Doppler-beamed and gravitationally redshifted based on the disk's orbital velocity and the photon's trajectory, and is converted through a blackbody-to-RGB mapping so the inner disk glows blue-white while the outer edge cools to red. Rays that don't hit the disk either fall past the event horizon and vanish, or escape to sample a procedurally generated starfield — gravitationally lensed along the way, which is what produces the warped background and the thin, glowing photon ring.

What makes it compelling is that nearly every visual feature — the shadow's sharp edge, the photon ring, the disk's asymmetric brightness, the lensed stars — falls directly out of solving real physics equations rather than being art-directed. It runs on GPU via Taichi, updates the disk's rotation live, and lets you speed up, slow down, or freeze time to watch how the geometry holds together frame by frame.