Founder, Forge Labs
I wrote a real black hole ray tracer that runs in the browser (open source)
I built <black-hole>, a web component that ray-traces a Schwarzschild black hole live in the browser. Light paths are integrated step by step (RK4), so the Einstein ring, the lensed accretion disk and the bent stars come out of the physics instead of being painted on.
- Drop-in: one script tag, then
<black-hole> - Disk colour comes from blackbody temperature plus Doppler beaming (the side moving toward you is brighter and bluer)
- Fixed pixel budget, so it stays smooth on Retina screens
- Drag to orbit, scroll to zoom, MIT licensed
Demo: milesgurule-png.github.io/event-horizon Code: github.com/milesgurule-png/event-horizon
Built it with Claude Code. The hardest bug was the whole image rendering upside down from one sign in the camera's up vector. Feedback on performance on your machine is very welcome.






Comments2
One script tag to put a working black hole on any web page means a science teacher or a planetarium website could use this without hiring a developer. Because the side moving toward you glows brighter and bluer straight from the physics, students get something real to point at instead of just a pretty picture.
I hadn't thought of classrooms, but that's a great fit. The Doppler side is the kind of thing that's hard to picture from a textbook. I might add a mode that labels the parts.
2 comments
One script tag to put a working black hole on any web page means a science teacher or a planetarium website could use this without hiring a developer. Because the side moving toward you glows brighter and bluer straight from the physics, students get something real to point at instead of just a pretty picture.
I hadn't thought of classrooms, but that's a great fit. The Doppler side is the kind of thing that's hard to picture from a textbook. I might add a mode that labels the parts.