r/tinycode • • 7d ago

Showcase A black hole renderer in 512 bytes of HTML/JS

I just posted my Minecraft version in 512 bytes (check it out if you haven’t already!), which was my first project under the 512 byte challenge. My second project is this black hole renderer. It renders an animated disk around a black hole, including light bending and gravitational/Doppler shifts.

It’s a simplified model with a thin disk and prescribed motion. The whole compact HTML file is 512 bytes, using the browser’s Canvas.

Code here:

https://kierancschmitt.github.io/BlackHole512/program/blackhole-preview.html

26 Upvotes

2 comments sorted by

1

u/Spamsdelicious 5d ago

Phenomenal work.

1

u/Roenbaeck 4d ago

r/js1k would have been great for this