NokiMo
scottmanley
scottmanley

patreon


Black Hole Raytracing

I've sorta become addicted to building out a proper black hole raytracer to do an updated version of my 360 video showing what it looks like to fall into a black hole.  I started with code from this page as a reference  http://www.madore.org/~david/math/kerr.htmlbut since then I've added a bunch of features I'm going to need, like 360 cameras and intelligent interpolation so I don't waste time computing light rays which are similar to their neighbours. (see: https://twitter.com/DJSnM/status/1225309502146088960?s=20 )

My original 360 black hole video was made in Space Engine and it's not accurate in many ways, for a start the observer isn't really falling, they're a static camera moving towards the hole, the motion is important because it changes the view. Also the Black hole is a simple non-rotating black hole and real black holes all have rotation. This last part is really important and forces me to use a raytracer that propagates photons backwards using an iterative solution rather than simply solving a bunch of equations.

I use a Runge-Kutta integrator to move the light ray through the curved space-time around the black hole. Non-rotating black holes use the Schwarzschild metric which is a solution to Einstein's field equations. The field equations are at the core of general relativity and were published in 1915, Schwarzschild's solution followed in 1916. But the solution for a rotating black hole would take until 1963 when Roy Kerr developed the Kerr Metric.

One of the fun things about rotating black holes (and indeed any rotating mass) is that they drag spacetime along with them - you can see this effect when I adjust the angular momentum of a test metric:

https://twitter.com/DJSnM/status/1221301237783515137?s=20


This is a side project that's taking a lot of my spare time, and I'll publish the code to patrons once I finish 'improving' it.






Black Hole Raytracing

Related Creators