
Raytracing a Black Hole - Ohtrahddis
http://rantonels.github.io/starless/
======
pavlov
_Easy. Take the Schwarzschild metric, find the Christoffel symbols, find their
derivative, write down the geodesic equation, change to some cartesian
coordinates to avoid endless suffering, get an immense multiline ODE,
integrate. That 's pretty much it._

The TV and books I consumed as a kid made it seem plausible that people in the
future will regularly talk like that.

Now, living in the future, I'm happy that it turned out to be true.

~~~
piannucci
Oddly, the math invoked by that quote is 100 years old.

~~~
pokpokpok
Were less applications for it back then though!

------
gridspy
Performance thought:

I like the way you raytrace the entire image at once. Clever, but you might be
able to make it faster...

Right now you process the entire image in one hit. However a 1080p * 4 byte
image is 777,600 bytes - from a quick read I believe you have several of
these. They're large enough to blow the caches in your CPU.

It might be much faster to break the image into 8,16 or 32 square or
rectangular or line shaped "patches" and process each in sequence. That would
help you hit the same parts of your working arrays more often and keep them in
cache between iterations.

I'm thinking

    
    
        for patch in patches
           for iter in iterations <-- currently your outer rendering loop
    

Might be a quick performance win worth playing with.

Hit me up at tom at gridspy (.co.nz) if you want to discuss further.

Amazing article, thankyou!

~~~
TeMPOraL
I don't get something. Isn't 1080p a 1920x1080 image, which would make it
2073600px * 4 bytes = 8294400 bytes = 7.91 megabytes?

------
Steuard
This is really cool! It's a nice explanation of the topic (including some very
effective diagrams), and the resulting visualizations are great.

[Side note: In discussing the distortion of the event horizon, the author says
"I suspect the punctured sphere → disk map is conformal/biholomorphic". There
_is_ a conformal map between the punctured sphere and the plane[0], but there
is no conformal bijective map between the open unit disk and the full
plane.[1] Thus, the punctured sphere and the unit disk cannot be conformally
equivalent.]

[0]
[http://en.wikipedia.org/wiki/Stereographic_projection](http://en.wikipedia.org/wiki/Stereographic_projection)
[1]
[http://en.wikipedia.org/wiki/Unit_disk#The_open_unit_disk.2C...](http://en.wikipedia.org/wiki/Unit_disk#The_open_unit_disk.2C_the_plane.2C_and_the_upper_half-
plane)

------
state
There's nothing better than something that looks beautiful _and_ is precisely
specified.

Really nice.

------
darkmighty
The image "inversion" effect you get near the black hole is very intriguing
... you get an infinite series of inversions with increasing compression
corresponding to the number of revolutions light took around the BH. So a few
photons getting to you might be really old (could be almost as old as the BH
itself!), it's a series of windows into the past...

~~~
wyager
Wow, I hadn't thought of that. I wonder what the "compression" factor is for
each orbit around the black hole.

Edit: Actually, I don't think you get any photons that do a full 360 degrees
around the black hole that subsequently escape the black hole.

~~~
darkmighty
If you look at the image of geodesics he shows an example of an almost 360
degree trajectory. Simple continuity arguments allow you to conclude you can
have an arbitrary number of rotations, I believe.

I would conjecture the contraction is roughly exponential, there's no obvious
contradiction with that but it's way over by knowledge to check it ...

~~~
wyager
By the time a photon has done a complete rotation, it necessarily has to be on
a path that takes it into the black hole (instead of outside of it). So yes,
you can have an arbitrary number of rotations, but anything that makes a
complete rotation or more will never leave the black hole.

~~~
darkmighty
It turns out that a photon can describe any real rotation angle around a black
hole (I've asked a physicist). The continuity argument I gave is valid: take
the critical energy E wherein the photon is attached to the photosphere, then
with an adequate E+eps, eps > 0, the photon will describe an according
monotonically decreasing angle.

------
scentoni
What I'd really like to see is how this would differ for a Kerr metric[1],
since it's assumed that most stellar or galactic core black holes will be
rotating. [1]
[https://en.wikipedia.org/wiki/Kerr_metric](https://en.wikipedia.org/wiki/Kerr_metric)

------
jimmcslim
Would be great if they coded this into Elite: Dangerous.

~~~
TeMPOraL
Now that _Interstellar_ brought this image of a black hole into popular
culture, I expect many other movies and games adopting it.

~~~
jacquesm
Interstellar? How about 'black hole'?
[http://www.imdb.com/title/tt0078869/](http://www.imdb.com/title/tt0078869/)

~~~
TeMPOraL
I haven't watched that movie, but I did look at screenshots, and what I see is
the bog standard black hole used by everyone everywhere. And I'm not really
surprised - after all, Interstellar _invented_ the black hole image this
article was talking about, AFAIR it was for this movie that such rendering was
attempted the first time ever - so for your reference to be relevant to my
comment, we'd have to be dealing with some really serious time travel stuff.
;).

------
tjradcliffe
Wonderful! The descriptions of the accretion disk images are particularly
good.

Recently for an abstract art project I wrote a simple gravitational lens
simulator to distort an image as if there was a 10 Earth mass black hole
between the viewer and the objects: [http://www.tjradcliffe.com/wp-
content/uploads/2015/03/test1....](http://www.tjradcliffe.com/wp-
content/uploads/2015/03/test1.jpg)

It was a quick hack to explore the idea, and I'm pretty sure important details
aren't right, but it was good enough for going on with. While doing it I
remember thinking, "I wish I had time to explore this whole process properly."
Now I don't have to!

------
fffrad
One thing I can't forget is a picture of a black hole from telescopes.

We should really call this an artistic rendition of a black whole, because
they look nothing like that. At least not as sexy.

I can't find the original but here:

[https://thetruthbehindthescenes.files.wordpress.com/2011/01/...](https://thetruthbehindthescenes.files.wordpress.com/2011/01/prtscr-
capture_65.jpg)

~~~
Lambdanaut
Is it fair to compare this low-res photo to the render? I think they'll be
prettier once we have better telescopes.

~~~
fffrad
it's not about fairness, that's what we see currently.

~~~
higherpurpose
What if "what we see" is not accurate of how it actually looks and works? I
think the math behind it would have a more accurate way to describe how it
looks and works, which is what the render does.

------
Fiahil
Very original! Congrats! It's better looking than the old Möbius strip, and
the maths are not that bad :)

------
taylorwc
This is stunning. Thank you for sharing.

~~~
txu
Very beautiful rendering

------
cabinpark
Nice introduction. My colleague works exclusively in raytracing around black
holes (although he uses the Kerr metric) and he has produced some really cool
images.

I highly recommend looking at the literature for really cool images with more
complicated black holes.

------
yoklov
Very cool. Sadly, the link to the interactive demo seems to be broken.

~~~
edwintorok
This one works:
[http://spiro.fisica.unipd.it/~antonell/schwarzschild/live/](http://spiro.fisica.unipd.it/~antonell/schwarzschild/live/)

------
yodsanklai
Also interesting, this video of visiting a black hole
[https://www.youtube.com/watch?v=T_TU6T4-0LU](https://www.youtube.com/watch?v=T_TU6T4-0LU)

------
cousin_it
Great work!

> _I suspect the punctured sphere → disk map is conformal /biholomorphic, but
> I have no sources for this_

It doesn't look conformal to me, some right angles become acute...

------
rasur
Very nice work, and the diagram wrt the PS was very instructive & helped very
much with visualising the bending of light. Thanks!

------
melloclello
I have to wonder if anywhere, in the history of the universe, a sentient being
has ever fallen into a black hole.

------
UhUhUhUh
Clear and beautiful (i.e. elegant).

------
mrsuprawsm
This is awesome!

