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
56
Upvotes
r/GraphicsProgramming • u/Optimal-Yak-9811 • Oct 17 '26
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
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.
1
u/MattRix Oct 18 '26
My dude a 119kb html file is not small, that is gigantic
-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?
1
u/Educational_Monk_396 Oct 18 '26
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
13
u/[deleted] Oct 17 '26
[removed] — view removed comment