8 ms·
Show HN: Physically accurate black hole you can put in your room
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 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!
- hahahaa 2mo agoFirst time I have AR'd. That was cool. How does it keep the hole in the same point in space as I walk about?
- dmd 2mo agoThe app doesn't have to do this itself, phones do it for you. ARCore on Android, ARKit on iOS.
- hahahaa 2mo agoOh yeah I mean how do the phones do that. I guess it uses dead reckoning with visual cues and some machine learning.
- dmd 2mo ago"SLAM" is the term to google.
- deleted 2mo ago[deleted]
- boothby 2mo agoYour phone has an accelerometer, which can be integrated twice to result in slightly accurate dead reckoning; just keep accumulating 3-vectors with every time-slice. That's a helluva lot easier than visual cues.
- addaon 2mo ago"slightly accurate" is the correct description, though -- dead reckoning on a cell-phone-class IMU accumulates drift too quickly to keep objects anchored in space for more than seconds at a time. You need something (visual odometry, SLAM) that provides long-term stability, even if it has short-term noise or poor availability, to fuse in.
- gregsadetsky 2mo agoWhen this topic comes up, I'm always happy to share this incredible lecture from many many years ago about sensor fusion and dead reckoning and how you _cannot_ integrate acceleration twice: https://www.youtube.com/watch?v=C7JQ7Rpwn2k&t=1401s https://www.youtube.com/watch?v=C7JQ7Rpwn2k&t=1401s (the whole video is incredible, but this timestamp is the magical bit)
- pezezin 2mo ago
- deleted 2mo ago[deleted]
- deleted 2mo ago[deleted]
- Waterluvian 2mo agoIt’s fascinating how things that were inverted seem to become corrected when I point this at the pre-existing black hole in my room.
- quijoteuniv 2mo agoQuite amazing when crossing the pre-existing blackhole and looking back to the room while using this app!
- api 2mo agoThe singularity is near.
- aizk 2mo agoVery 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.
- aplavin 2mo agoThe technology has come a long way indeed! The first simulations of how a black hole would look like are from 1979, by Jean-Pierre Luminet – take some time to find and look at them, it's super impressive what they achieved using that era tech! Now, we can get much higher-resolution ones in real time on any smartphone. I work in the Event Horizon Telescope, studying jets accelerated by black holes, and immediate black hole surroundings as well. I do ray tracing / radiative transfer simulations, and this app is an adaptation of those simulations – with the primary focus on being physically accurate under reasonable assumptions. And totally, I enjoyed listening to Kip Thorne's lectures and talking to him, he gives them in a very approachable style while remaining honest!
- aplavin 2mo ago> 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 https://plav.in/outreach_demos/squeeze-earth-v2.html. Also see https://xkcd.com/1680/ https://xkcd.com/1680/ of course :)
- dluan 2mo agoI 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.
- efilife 2mo agoSame. Especially with circular objects. Placing the black hole in my room using the AR mode was very distressing for me
- dluan 2mo agoIt was actually after that VR experience with large black circle that now when I look at photos of the inside of Hagia Sofia I get a little heeby jeeby creeped out lol.
- chamomeal 2mo agoIf somebody feels no fear while zooming towards a black hole, their brain has some strange wires crossed. Strongly recommend Outer Wilds. Falling into the black hole the first time was one of my most scared moments in gaming. I was totally panicking lol
- aplavin 2mo agoLooks interesting from the first glance! I should probably try that game – having both the artistic and realistic pictures in mind :)
- wffurr 2mo agoOuter Wilds is a great work of sci-fi but it's not especially physically accurate. I really enjoyed playing it through with my son, and the ending made me weep. The end credits music still gets me a little when I hear it. Excellent soundtrack.
- csmoak 2mo agoPlease 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?
- deleted 2mo ago[deleted]
- aplavin 2mo agoOne side of the accretion disk is indeed brighter than the other – in the default view in the app, the bottom part is brighter. The effect appears quite clearly visible to me, although the exact contrast depends on the colorscale mapping. Here, I tried to find a colorscale that works well for both the disk and the jet, which naturally means the leading/trailing edge contrast can be less than in the linear mapping. Hope it explains the visual effect! Kerr vs Schwarzschild (static vs rotating black holes) is a much smaller effect visually – that's why it is so hard for us to measure black hole spins (= how fast they are rotating) observationally, even with the Event Horizon Telescope.
- csmoak 2mo agoI think the contrast between the two sides is typically greater with an optically thick disk, and it looks like you are rendering an optically thin disk. I think that's the main difference from what I was expecting when I saw it. Very cool demo! Thanks for sharing! (For reference, my experience rendering black holes is recreating Luminet's rendering from the late 70s: https://www.ioccc.org/2025/cesmoak/index.html https://www.ioccc.org/2025/cesmoak/index.html )
- aplavin 2mo agoTrue, the disk is rendered optically (and geometrically) thin. This is done so that real-time performance is attained on devices like phones – volumetric GR rendering would be significantly more expensive. The jet (zoom out to see it) is rendered with full volumetric effects, because it's just special relativity there. Fortran punchcard style to render black holes?! That's really going full circle to the origins, I really enjoyed reading about Luminet's work some time ago.
- ninjahawk1 2mo agoThem: you can’t see what’s on the inside of a black hole Me: zooms in
- charcircuit 2mo agoWouldn't physically accurate turn your entire screen black? I would expect it to suck in way way more light than the example shows.
- aplavin 2mo agoIf this app turns the entire screen black, this probably means WebGL is not supported :) Black holes don't really "suck in" light. Whatever falls onto the black hole itself gets deleted, of course – but otherwise, it bends light rays towards its center. That's why the app shows distortion + black circle in the in middle in the camera mode.
- charcircuit 2mo agoThe event horizon for even the smallest black hole is in the scale of kilometers. If the user is a meter away from the black hole light isn't going to move away from the center of it to your camera.
- aplavin 2mo agoNow I think I see what you meant. There actually are no upper/lower limits on the black hole size (in classical physics – ignoring quantum effects). Compressing the Earth to ~1 cm in size would give you a black hole, and its event horizon size would be ~1 cm, not kilometers. And even black holes this small are stable, according to our physics knowledge.
- defrost 2mo agoThis is recent conjecture? I grew up with micro black holes being a possibility, with conjectures such as primordial black hole evaporating down to Planck dimension stability, etc.
- 20k 2mo agoIf 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/2f004bfeca670d4dfdaf24dc5c34af862f5f867b/src/raymarch.frag#L379 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/2f004bfeca670d4dfdaf24dc5c34af862f5f867b/src/raymarch.frag#L47 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/2f004bfeca670d4dfdaf24dc5c34af862f5f867b/src/raymarch.frag#L140 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
- nomilk 2mo agoFrom a certain angle it looks like an eyeball https://imgur.com/a/Dam3XT0 https://imgur.com/a/Dam3XT0
- rgovostes 2mo agoSee also: Black Hole Vision for iOS from Vanderbilt University. https://apps.apple.com/us/app/black-hole-vision/id6737292448 https://apps.apple.com/us/app/black-hole-vision/id6737292448
- aplavin 2mo agoYes, linked in the readme! They simulate light bending, but ignore time delay effects. I think the earliest of these black-hole-camera renderings is https://dominic-chang.com/bhi-filter/ https://dominic-chang.com/bhi-filter/ though (also linked in readme) – a direct inspiration for the camera mode in my app!
- ButlerianJihad 2mo ago"It really brings the room together" https://m.xkcd.com/1680/ https://m.xkcd.com/1680/
- drivingmenuts 2mo agoGood work! Gimmer two, chief! Two black holes at once?!?!?? Yeah, I'm crazy like that.
- JsonDemWitOster 2mo agoIf you're not careful sooner than later you will have just one black hole or, worse, no black hole! In the latter case your neighbor down the street might end up with one. --- Reminds me of my favorite Spongebob Squarepants gag. Spongebob and Patrick Starfish were tasked to paint the house of Mr. Krabs, Spongebob's exacting boss at the Krusty Krab. Because of course this is a cartoon, they have to paint with all the furniture and bric-a-bracs still in the room. They are just somehow expected to paint around stuff. Because Patrick is dumb as a starfish (go figure) they end up with a big paint bubble threatening to burst and cover _everything_ with a layer of paint. Spongebob (panicked): Eeeek! Patrick what can be worse than one big paint bubble in Mr. Krabs' living room? Patrick: laughs oooh I know... He proceeds to blow another big paint bubble Patrick: two big paint bubbles!
- antonvs 2mo agoI tried this, and now my cat is missing!
- runtime_lens 2mo ago[flagged]
- arianvanp 2mo agoThe 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?
- viciousvoxel 2mo agoSame on pixel 10
- aplavin 2mo agoYes, as said in the text, unfortunately this is a limitation of browser APIs. You either get AR and no access to the camera feed (this is the AR mode here, black hole floating in your room, simply overlaid on top of the camera feed) or get access to the camera feeds but no AR (this is the camera mode). I didn't find a way around it...
- kamaal 2mo agoWell 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.
- hrnnnnnn 2mo agoAccording to this calculator [1] it would take 11.274 times the mass of the earth to create a black hole with a radius of 10cm. [1] https://www.omnicalculator.com/physics/schwarzschild-radius https://www.omnicalculator.com/physics/schwarzschild-radius
- kamaal 2mo ago0.0001 km, or 10 cm would take 0.00003385 suns, or 6.72857 × 10²⁵ kg Obviously that's not possible by today's physics. But lets say it was possible, by placing it some where space, how would one make it ?
- JsonDemWitOster 2mo agoI'm less ambitious and I just want a 1 cm blackhole for display purposes, cool thing to show off to my guests. Imagine my disappointment at finding out that I'm gonna need about 10^47 chonky house cats to make a 1cm blackhole! Where could I find that!
- hrnnnnnn 2mo agoIf you make it 0.887cm you get a nice round one-earth-mass :D
- wayknow 2mo ago[dead]
- picafrost 2mo agoVery neat! Love seeing immediately grok'able simulations like this that you can just browse to. There are a few neat black hole shaders[1][2] on Shadertoy as well. [1] https://www.shadertoy.com/view/tsBXW3 https://www.shadertoy.com/view/tsBXW3 [2] https://www.shadertoy.com/view/lstSRS https://www.shadertoy.com/view/lstSRS
- nnevatie 2mo ago> https://blackhole.plav.in/ https://blackhole.plav.in/ The lines in the demo look upscaled and aliased for some reason.
- aplavin 2mo agoCould you please share a screenshot so that I investigate what actually happens? I tested on a few different devices, but far from anything extensive.
- nnevatie 2mo agoThis is on Chrome/Win11: https://snipboard.io/W8SXYm.jpg https://snipboard.io/W8SXYm.jpg
- aplavin 2mo agoHmmm 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?
- nnevatie 2mo agoSetting 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', })
- aplavin 2mo agoWould 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.
- VoodooJuJu 2mo ago[dead]
- lmf4lol 2mo agowould be nice to have a “make foto” button for mobile
- pal9000i 2mo agoCan i make an analogue version of this somehow? That would be ultra cool
- aplavin 2mo agoYou 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 https://www.youtube.com/watch?v=PviYbX7cUUg for a classical wine glass experiment, or https://sites.google.com/view/jeansurdej/gravitational-lenses/gravitational-lens-simulator 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.
- toddm 2mo agoThis is lovely, great to see science like this! Many thanks to you and your colleagues!
- steve1977 2mo agoI'm both disappointed and relieved that this is virtual.
- aplavin 2mo agoEagerly awaiting WebGravity API support to control your device's builtin gravity field generator!
- ck2 2mo agoFor a split-second thought they meant a Kugelblitz (black hole that in theory can be made from concentrating photons from lasers) https://en.wikipedia.org/wiki/Kugelblitz_(astrophysics) https://en.wikipedia.org/wiki/Kugelblitz_(astrophysics)
- aplavin 2mo agoThat would be fun indeed! Not sure I would literally want to put this into my room though.
- hmokiguess 2mo agoI tried following the instructions and use it for education/outreach, and somehow I got educated by the past while receiving outreach from the future.
- tantalor 2mo agoCan you post a demo video of the AR/VR with the effects? Apparently it is not working correctly on my device, so it would be nice to see the intended effect.
- aplavin 2mo agoSure, see https://blackhole.plav.in/ar_example.mp4 https://blackhole.plav.in/ar_example.mp4 for an example. Should work on most Android phones, even old ones (mine is 7 years), the Chrome browser is generally best for AR. Interestingly, Firefox seems to be better for the camera mode – for me, Chrome only gives one camera feed at a time, while Firefox allows both front & rear cameras. And AR + camera warping don't work together, unfortunately – browser API limitations.
- tantalor 2mo agoOkay either I'm stupid or not seeing the "relativistic effects". This looks the same as on my device. I was expecting some distortion or bending of the background?
- deleted 2mo ago[deleted]
- aplavin 2mo ago> AR + camera warping don't work together, unfortunately – browser API limitations. So, you either choose AR and see the simulated emission from around the black hole, properly warped/boosted – but the camera feed remains flat, the browser itself does the overlaying. Or, alternatively, choose the camera mode, and see the warping of your camera feed. Not both at once!
- guardiandev 2mo agoThis reminds me of a filter on my mac from the mid 2000s
- KinetiNode 2mo agothis is so cool!
- YVoyiatzis 2mo agoThis reminds me of a funky Windows screensaver, back in the day. Pretty cool.
- mncharity 2mo ago> unfortunately, WebXR restrictions make AR passthrough and the camera feed mutually exclusive It looks like Chromium-based browsers might be doable?[1][2] Meta: About a decade ago, I rolled my own WebXR-like stack with passthrough, and played with an XR Powers of Ten zoomer. Here we are years later, and it's apparently still not something which might be deployed. In some sense, we are progressing so sloooowly. [1] https://caniuse.com/wf-webxr-camera https://caniuse.com/wf-webxr-camera [2] https://immersive-web.github.io/raw-camera-access/ https://immersive-web.github.io/raw-camera-access/
- aplavin 2mo agoHmm, interesting! I saw that it's a draft, and didn't investigate further. Maybe it does work indeed on some browsers. Generally, the compatibility story turned out more fragmented than I expected. Eg, on my phone, Chrome can do AR – but cannot do two camera feeds at once; while Firefox is the exact opposite – no AR but can do both cameras at once, so that you see both front and rear lensed around the black hole properly (in the camera mode).
- echoscarrie 2mo agoThe web-based real-time rendering is insanely smooth, and the visual quality is stunning! Quick question: How close is this visualization to what a real black hole actually looks like in real life? I’m planning to show this to my daughter, so I'd love to tell her a bit of the science behind it! Super cool project!
- utopiah 2mo agoVery cool use of WebXR!