Show HN: Physically accurate black hole you can put in your room (blackhole.plav.in)

477 points by aplavin ↗ HN
We have a black hole at home — with actual relativistic physics, live in your browser.

I'm Sasha (Alexander) Plavin, an astrophysicist at Harvard's Black Hole Initiative studying quasars and black hole environments. I work with raytracing/radiative transfer simulations professionally, and wanted to make one anyone can play with — so I built this app.

Put the black hole onto your screen (any browser), or directly into your room with AR or VR (requires WebXR, for example Chrome on Android, or any VR headset). When looking around, pay attention to unintuitive relativistic effects: rays bending around the black hole, and special relativistic "Doppler boosting" changing brightness depending on the viewing angle — zoom out to see the fast jet where the latter effect is especially pronounced. Faint markers show where other viewers are standing right now.

Alternatively, put the black hole in front of your camera and watch it lens your actual surroundings. Light winds around the hole, so you see both what's in front of you and what's behind you at once (when the device and browser allow both camera feeds). The closer to the black hole, the stronger the bending — and the longer the light-travel delay: wave at it and watch the changes propagate inward. (unfortunately, WebXR restrictions make AR passthrough and the camera feed mutually exclusive)

No signup, basic features work on every device, no data uploaded — the camera feed never leaves your device. Source code: https://github.com/aplavin/blackhole.plav.in.

Enjoy having a black hole in your room, or use it for education/outreach — any questions, feedback, or suggestions are welcome!

48 comments

[ 5.0 ms ] story [ 129 ms ] thread
(comment deleted)
(comment deleted)
First time I have AR'd. That was cool. How does it keep the hole in the same point in space as I walk about?
It’s fascinating how things that were inverted seem to become corrected when I point this at the pre-existing black hole in my room.
The singularity is near.
Very cool, and very mind bending. Very faithful to the Event Horizon Telescope rendering. A decade ago I got really into black holes for like a few months, and I read Kip Thorne's book called "The Science of Interstellar", talking all about black hole simulations. Have you read it? I wonder how the simulation tech has evolved, as 10 years is a lot. I do wonder if you do like, size estimates of a black hole in my room. Suppose I have a black hole in my room, I'd be curious to know what the mass of that is, like a fun fact, tidbit somewhere.
> I do wonder if you do like, size estimates of a black hole in my room. Suppose I have a black hole in my room, I'd be curious to know what the mass of that is, like a fun fact, tidbit somewhere.

Forgot to answer this first!

Basically, ~1 cm radius black hole has the mass of the Earth – really, Earth would need to get this small to become a black hole. I've made a very simple demo for a kids lecture I gave recently, https://plav.in/outreach_demos/squeeze-earth-v2.html. Also see https://xkcd.com/1680/ of course :)

I remember like 10 years ago when Occulus first came out there was that space simulation demo where you could go around the solar system in VR. You could also "fast travel" by zooming in towards a planet, moon, blackhole.

Yeah, that was the day I learned I have a deep, crippling phobia of large objects. And Melanoheliophobia, which is fear of black holes. The only other time I've felt that way was snorkeling once near a giant 3 story tall bait ball of swirling fish, which was so disorienting and panic inducing that I vomited.

I can't play Outer Wilds specifically because of this. Specially because of the black holes.
Please correct me if I'm wrong, but it feels like the leading edge of the accretion disk (coming towards the viewer) should be significantly brighter than it is shown here, and the trailing edge (going away from) should be significantly dimmer?

Or could the brightness shown be a result of it being Kerr vs Schwarzschild?

Wouldn't physically accurate turn your entire screen black? I would expect it to suck in way way more light than the example shows.
Them: you can’t see what’s on the inside of a black hole

Me: zooms in

If anyone's interested in the accuracy, this is very 'visualisation grade' software. Its a bit of a pet peeve of mine that people present these sims as being very physically accurate, when they contain major inaccuracies, some of which are very obvious and/or deliberate. This one has some serious physical limitations

I wouldn't mind at all if it didn't say that this was a *physically accurate* black hole specifically, but this now falls under misleading science communication in a way that often gets hand waved away as if it doesn't matter, so we've got to clear some things up!

1. The accretion disk shouldn't be red, people just expect it because it looks cool. Black hole accretion disks are near universally hot enough to be blue. Interstellar did this too, and tried to handwave it away very unconvincingly

2. This is a non/low (?) spin black hole, which isn't super duper realistic

3. It ignores the position of the camera (which affects the lorentz shifting)

4. The doppler shifting isn't terribly accurate

5. It doesn't model the accretion disk temperature distribution or colour with any kind of accuracy. Usually you model accretion disks as a blackbody radiator, shift it by the doppler, and to display this convolve this against the human eye response (LMS), go to XYZ, then RGB, do a physical tonemapping step, before an sRGB conversion. This instead does none of that - no step of this is done with any physical accuracy. Its not even illustratively correct as we'll get into

6. The actual radiative transfer is very simplified compared to what you'd use for realsies, and isn't based on any real numbers, with very simplified equations. The opacity and emissivity of the disk is arbitrary, as is the size, and it does not correctly incorporate brightness or extinction, eg here https://github.com/aplavin/blackhole.plav.in/blob/2f004bfeca... is super simplified

7. The wrong equation is used for the doppler calculation. They use the I^3 variant, whereas the data you get out of a disk sample is *radiant flux* which is actually F_obs = F_emit / (z+1)^4. This is a very common mistake in image processing, which means that the doppler shift and observer brightness isn't correct. Surface brightness over here https://github.com/aplavin/blackhole.plav.in/blob/2f004bfeca... is *not* a spectral radiance but instead a radiant flux

Stuff like the brightness -> colouring conversion is particularly inaccurate. Eg if you check out the source:

https://github.com/aplavin/blackhole.plav.in/blob/2f004bfeca...

It maps the pseudo brightness completely arbitrarily to colour. The resulting colour/brightness here then doesn't correspond to anything remotely physical. It also performs a *linear* mapping of a linear quantity (brightness) to sRGB (which is a nonlinear process!!), which means that it doesn't even retain any of the underlying physical characteristics of the brightness simulation, which itself is quite inaccurate. Its vibes all the way down

This is all fine if you're doing visualisation, but this isn't an accurate simulation. I wish this was just called a visualisation of a black hole, but its being communicated as if this is super hard science with credentials and all

but why was the picture taken of black hole have accretion disk yellow?
The vast majority of scientific images, be it in papers on press releases, are using an arbitrarily-chosen colormap to map whatever numeric values are there to actual visible pixels. For the Event Horizon Telescope speficially – it is a radio telescope, so what it sees has no intrinsic "color" as perceived by a human eye at all. Same with this simulation here.
You know, I am interested in the accuracy.

I like what OP has created, but out of curiosity, where might I find the most physically-accurate, browser-based black hole simulation?

Good work! Gimmer two, chief!

Two black holes at once?!?!?? Yeah, I'm crazy like that.

I tried this, and now my cat is missing!
I wonder how much of that is scale rather than danger. Really large objects can feel unsettling even when you know they're harmless. VR seems especially good at triggering that response.
The distortion effects dont work for me on pixel 8 when using AR mode

I just get a flat floating image of a black hole. Am i holding it wrong?

Well I thought this is a real black hole.

Forgive my ignorance.

But what would it take to put a fist sized black hole in your room.

> https://blackhole.plav.in/

The lines in the demo look upscaled and aliased for some reason.

Could you please share a screenshot so that I investigate what actually happens? I tested on a few different devices, but far from anything extensive.
This is on Chrome/Win11:

https://snipboard.io/W8SXYm.jpg

Hmmm I think I see what's happening here. Basically, all devices I tested (laptops/phones/tablets) seem to have small pixel size, and to save on compute power for weaker devices I decided to render with half as many pixels as the screen has, letting the browser upscale the result. In your case, pixels are probably quite a bit larger, and half-res rendering has these prominent artifacts.

Can you try if increasing "render scale" in params->display helps?

Setting render scale to 1 definitely helped - the aliasing from the lines is gone.

The rest of the circular aliasing could likely be fixed by requesting MSAA, so e.g.:

renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true, powerPreference: 'high-performance', })

Would MSAA compute more samples, effectively multiplying shader computation? Ideally, it should be something adaptive, to the number of pixels/device compute power, eg compute 2x smaller resolution on phones/retina, compute 1x resolution on larger-pixel screens, and maybe even 1x + MSAA beyond some pixel sizes... Just wanted to avoid reinventing these heuristics.
would be nice to have a “make foto” button for mobile
Can i make an analogue version of this somehow? That would be ultra cool
You mean, without a camera and a screen, out of pure physical objects? You can actually reproduce gravitational light bending quite accurately with a properly-shaped lens (some wine glasses are surprisingly close!), see eg https://www.youtube.com/watch?v=PviYbX7cUUg for a classical wine glass experiment, or https://sites.google.com/view/jeansurdej/gravitational-lense... for purpose-made lenses. It only reproduces the so-called "weak field" bending, not light that makes half a turn (coming from behind you) or more.