
Show HN: Black-hole.js – Visualize black hole gravitational lensing in WebGL - cliffcrosland
https://github.com/cliffcrosland/black-hole.js
======
coffeedoughnuts
May be of interest: Posts from Double Negative, the VFX company that did
Interstellar: Blackhole:
[http://dneg.com/dneg_vfx/blackhole/](http://dneg.com/dneg_vfx/blackhole/)
Wormhole:
[http://dneg.com/dneg_vfx/wormhole/](http://dneg.com/dneg_vfx/wormhole/)

~~~
pavel_lishin
I'd love to see the wormhole simulation implemented someplace I could play
with it.

~~~
jaquers
[https://sirxemic.github.io/Interstellar/](https://sirxemic.github.io/Interstellar/)

------
cturhan
I did once the same thing[1] with canvas. However, this demo warps the whole
picture instead of circular region which seems unnatural. Other than that, you
did great job.

[1] [http://cihadturhan.com/lab/gravitional-
lensing/](http://cihadturhan.com/lab/gravitional-lensing/)

~~~
mholt
Yours is really cool, too! Thanks for sharing, since lately I've been doing a
lot of reading/learning about black holes. But where is the hole in your demo?
I see the distortion but I also can still see stars within the event horizon,
if there is any.

~~~
cturhan
I kept radius of blackhole very small ( ~3px) because many demos do so[1][2].
If you look into the code you will see it's a faux effect. It's canvas so you
can imagine performance when comparing with WebGL :) It just replaces
positions of pixels according to an effective radius and some simple mirror
algorithm. Also to smooth effect I used smoothstep function.

[1]
[https://www.youtube.com/watch?v=FCoxYlpJq9s&t=1m13s](https://www.youtube.com/watch?v=FCoxYlpJq9s&t=1m13s)
[2]
[http://upload.wikimedia.org/wikipedia/commons/d/d6/BlackHole...](http://upload.wikimedia.org/wikipedia/commons/d/d6/BlackHole_Lensing.gif)
[3]
[http://en.wikipedia.org/wiki/Smoothstep](http://en.wikipedia.org/wiki/Smoothstep)

------
sherlock_holmes
Came across this some time back:
[http://blender.stackexchange.com/a/23574](http://blender.stackexchange.com/a/23574)

------
Roboprog
I can haz black hole, pleez?

Love the cat, visible over and under the focal point.

------
hugentobler
Would be fun to turn this into an art project.

