Settings

Theme

Raytracing a Black Hole

rantonels.github.io

368 points by Ohtrahddis 11 years ago · 39 comments

Reader

pavlov 11 years ago

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.

gridspy 11 years ago

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 11 years ago

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

Steuard 11 years ago

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 [1] http://en.wikipedia.org/wiki/Unit_disk#The_open_unit_disk.2C...

state 11 years ago

There's nothing better than something that looks beautiful and is precisely specified.

Really nice.

darkmighty 11 years ago

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 11 years ago

    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 11 years ago

      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 11 years ago

        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 11 years ago

          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.

        • darkmighty 11 years ago

          Hmm I'm not so sure anymore. I'll have to ask a physicist I guess.

scentoni 11 years ago

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

jimmcslim 11 years ago

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

  • TeMPOraL 11 years ago

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

    • jacquesm 11 years ago

      Interstellar? How about 'black hole'? http://www.imdb.com/title/tt0078869/

      • TeMPOraL 11 years ago

        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. ;).

  • hughes 11 years ago

    Though not as precise as this implementation, there is an artistic impression of gravitational lensing in the game already[0]

    http://youtu.be/7txixfOI0tE?t=1m22s

    • AlyssaRowan 11 years ago

      Exactly! I wouldn't be too surprised if they do… it looks doable.

      Although you might not want to get your ship too close to one with an accretion disk - it'll burn up. (If you do, at least use an all-black paint-job and look stylish.)

tjradcliffe 11 years ago

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....

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 11 years ago

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/...

  • Lambdanaut 11 years ago

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

    • fffrad 11 years ago

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

      • higherpurpose 11 years ago

        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.

  • darkmighty 11 years ago

    Well it depends on the viewing distance of course. With a telescope you can only (barely) image the accretion disk, if the BH is not too far and not shrouded by dust. So it's more of an artistic perspective, but accurate rendition :)

Fiahil 11 years ago

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

taylorwc 11 years ago

This is stunning. Thank you for sharing.

cabinpark 11 years ago

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 11 years ago

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

yodsanklai 11 years ago

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

cousin_it 11 years ago

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 11 years ago

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

melloclello 11 years ago

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

UhUhUhUh 11 years ago

Clear and beautiful (i.e. elegant).

mrsuprawsm 11 years ago

This is awesome!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection