r/GraphicsProgramming • u/Optimal-Yak-9811 • Oct 17 '26
Real-time Kerr black hole in WebGPU: light rays traced per pixel, one 119 KB HTML file
12
u/Donacdum_ Oct 18 '26
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 Oct 18 '26
Sigh. Nobody cares that you slopped someone else's shader into an HTML file, whatever the size of it is.
5
u/NurEinStatist2 Oct 18 '26
Seems to be claudes new recommendation for a reddit post title. I built X in a single Y KB HTML file!!!
1
-1
u/Temporary_Shelter_40 Oct 18 '26
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 Oct 17 '26
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 Oct 18 '26
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?
12
u/blackrack Oct 18 '26
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 Oct 18 '26
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.
8
u/blackrack Oct 18 '26 edited Oct 19 '26
Discussing with an AI agent copying someone else's work is really no substitute for the kind of real expertise and deep understanding that comes from building it yourself.
Also graphics programming is all about making tradeoffs between what's expensive/accurate and what looks good perceptually, AI is not good at making these tradeoffs because it doesn't have our perception, but it will recycle existing known ones.
8
u/hurricane_news Oct 18 '26
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
13
54
u/blackrack Oct 17 '26
I really just feel bad for the people who originally worked on these topics whose work got plagiarized and appropriated into this slop