# black hole simulation engine

> i watch too much interstellar. so i made light bend around a black hole in c++.

By DP.

## The problem

interstellar's black hole wasn't just a pretty render. the people who made it published actual physics papers about it. i wanted to understand the light bending well enough to draw it myself.

## What it does

two simulations. the 2d one traces light rays as they bend around a black hole. the 3d one sends the scene to the gpu, where a compute shader works out each ray's path through curved space (its geodesic) so the image renders in real time.

## The story so far

- aug 2025: started with the 2d lensing version.
- oct 2025: moved the heavy maths onto the gpu with a compute shader for the 3d version.

## The research behind it

- [Gravitational lensing by spinning black holes in astrophysics, and in the movie Interstellar](https://arxiv.org/abs/1502.03808), Oliver James, Eugénie von Tunzelmann, Paul Franklin, Kip S. Thorne - Classical and Quantum Gravity 32, 065001 (2015): how the film's black hole, gargantua, was actually rendered: tracing light bundles through a spinning black hole's curved spacetime.
- [Visualizing Interstellar's Wormhole](https://arxiv.org/abs/1502.03809), Oliver James, Eugénie von Tunzelmann, Paul Franklin, Kip S. Thorne - American Journal of Physics (2015): the companion paper, about the wormhole near saturn.
- The Science of Interstellar, Kip Thorne - W. W. Norton (2014): the book the physicist behind the film wrote about the science in it.

## Link

https://github.com/dfordp/Black-Hole-Simulation-Engine