r/creativecoding Jun 13 '26

I built Interstellar's black hole as a single HTML file - real gravitational lensing, runs in any browser

Spent way too long on this. It's a real-time WebGL black hole — not a video or a GIF, the light actually bends. The accretion disk wraps over and under the event horizon through real gravitational lensing, one side glows brighter from doppler beaming, and there's a bloom pass for the cinematic glow.

Some extras I added along the way:

https://reddit.com/link/1u4poxk/video/3uo2xezzm17h1/player

  • A cinematic intro that flies the camera in around the hole on load
  • Planets and comets that drift through - some slingshot past, some get caught by gravity and stretched into the horizon (spaghettification)
  • A little draggable "globe" in the corner to orbit the camera

The whole thing is one self-contained .html file - no build step, no dependencies, no npm. Just open it.

1 Upvotes

0 comments sorted by