GPU ray tracer showing the visual distortion of a checkerboard near a Schwarzschild black hole
This program ray-traces the Schwarzschild spacetime, computing the paths of light rays near a black hole by numerically integrating the geodesic equation using an RK4 solver on the GPU. Each pixel casts a ray whose trajectory is bent by the black hole’s gravitational field; rays that escape hit a checkerboard background plane, while those crossing the event horizon render as black. The adaptive step size ensures accuracy near the horizon while maintaining performance far away.
Controls: WASD to rotate, arrow keys to translate.