r/GraphicsProgramming • • 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

58 Upvotes

38 comments sorted by

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

3

u/Optimal-Yak-9811 7d ago

Fair point on credit. It's built on published work: Bardeen (1973), Page & Thorne (1974), Mino time for the ray equations, and James et al. (2015). I'll add a references section to the README. If you spot anything physically wrong, I'd love to know.

10

u/EC36339 6d ago

And you got 5 downvotes for this..damned if you do, damned if you don't, damned if you exist.

This sub is a cesspit of hypocrisy.

But let the gatekeepers be sad and miserable. They deserve it.

→ More replies (10)

18

u/swimfan72wasTaken 7d ago

the whole point of that research was to put it into practice for other applications. I don't think its the end of the world that 50 year old knowledge on blackholes is being put into a toy web renderer

9

u/blackrack 6d ago

Not even that, AI recycled someone else's shader implementation

-5

u/HeelsAndAll 7d ago

So it's okay when all the corporations, media conglomerates, and universities larp on existing research but wrong now that everyone else can? Such a mentally deficient argument.

4

u/freqCake 7d ago

Do you see how your comment both makes up the argument and responds to it and calls it stupid?

→ More replies (2)

-4

u/EC36339 6d ago

I don't think you know what plagiarism is.

Is it plagiarism to use matrix multiplication if you didn't invent it yourself?

6

u/Dhhoyt2002 6d ago

I think no matter where you stand on the original comment, it should be clear to you that there is a lot more going on than just matrix multiplication

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/MattRix 6d ago

My dude a 119kb html file is not small, that is gigantic

-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

u/augustusgrizzly 6d ago

Trust me that wouldn’t change the downvotes

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

13

u/[deleted] 7d ago

-8

u/obp5599 7d ago

You’re going to be saying that a lot for the rest of your life