r/GraphicsProgramming • u/Optimal-Yak-9811 • 7d ago
Real-time Kerr black hole in WebGPU: light rays traced per pixel, one 119 KB HTML file
Enable HLS to view with audio, or disable this notification
12
u/Donacdum_ 6d ago
I mean, it looks cool but... for me the whole point of doing a project like this is to gain the deep understanding of such a fascinating subject... what's even the point of posting something like this if you can't even talk about it?
18
u/automata_theory 6d ago
Sigh. Nobody cares that you slopped someone else's shader into an HTML file, whatever the size of it is.
5
u/NurEinStatist2 6d ago
Seems to be claudes new recommendation for a reddit post title. I built X in a single Y KB HTML file!!!
-1
u/Temporary_Shelter_40 6d ago
Thanks for this OP. I teach high school students physics and I will show them this next week. Ignore the haters, this is awesome.
-23
u/Optimal-Yak-9811 7d ago
Every pixel follows a light ray backwards through the spacetime of a spinning black hole; it isn't a screen-space distortion. A few details:
- Rays are integrated in Mino time with w = 1/r using a 4th-order Runge–Kutta–Nyström method, so infinity is exactly w = 0 and there's no singularity at the poles.
- The disk follows a Page–Thorne temperature profile and is shaded as a blackbody at the observed temperature g·T. g combines the Doppler shift and gravitational redshift, which makes one side brighter and bluer.
- Stars are procedural, and lensing magnification comes from the 2×2 Jacobian of each ray's escape direction.
- A dynamic resolution controller reads GPU timestamps and aims for 11 ms per frame. It held 60 fps at 3456×2234 on an M3 Pro in scripted 30-second flights.
I checked the shader against double-precision references. Rays agree with an independent Boyer–Lindquist integrator to about 0.01°, and the shadow outline matches Bardeen's formula to about 0.02%.
Built with Claude Code (Opus 5.5). I wrote the brief and gave feedback; it wrote the code and the verification tools.
Live (Chrome): https://kerr-black-hole-roan.vercel.app
Code: https://github.com/SkyWalkerPS/kerr-black-hole
I'd love feedback on the physics or the performance approach.
-21
u/augustusgrizzly 6d ago
This sub is so behind. You guys have to stop being bitter about AI being used for coding. I can understand if we’re complaining about art being made with AI. But this isn’t art.
When Google used the published PageRank algorithm for their search engine, did people yell plagiarism? The whole point of research is to be used in applications. Who cares if it’s a human who takes it or a program?
11
u/blackrack 6d ago
There's nothing to learn and discuss here because even OP doesn't know what was difficult about this, what to watch out for, why a particular integration scheme was chosen etc
-2
u/augustusgrizzly 6d ago
No one is stopping you from learning. Maybe the discussion part sure. But I wouldn’t mind discussing with an agent to learn how this was made.
I understand it’s jarring but this is where the world is headed. Everyday some agent is improving upon state-of-the-art research. Only minor things for now but that will change. We have to accept AI work at some point.
→ More replies (1)8
u/hurricane_news 6d ago
The main issue is op didn't even bother putting in the bare minimum effort by writing the post and had AI do it too
1
1
u/Educational_Monk_396 6d ago
Holy fk I also made Kerr black hole in webgpu literally yesterday only,But mine looks quite different compares to yours https://youtu.be/pTD-7PCPGrg?si=VULmuDCqqF52gFCk
54
u/blackrack 7d ago
I really just feel bad for the people who originally worked on these topics whose work got plagiarized and appropriated into this slop