Ball Pit (codepen.io)

by memalign 46 comments 178 points
Read article View on HN

46 comments

[−] verytrivial 51d ago
For some context, I think this is by mr.doob of three.js fame.
[−] nojvek 51d ago
Originally of Flash-ActionScript frame.

He’s been an inspiration for me, his demos got me into coding.

[−] TacticalCoder 51d ago
I have fond memories of visiting a university in the early 90s on a demo day and there was a (physical) sphere in a Cornell box:

https://en.wikipedia.org/wiki/Cornell_box

And next to it was a super beefy computer doing a 3D rendering of a similar scene.

35 years+ later I've got "many spheres in a Cornell box" rendering in my browser, love it : )

[−] p1necone 51d ago
This runs pretty smoothly on my middling laptop CPU while looking like a typical raytracing demo. I assume there's some smoke and mirrors involved?
[−] h4ch1 51d ago
No, it's using the newish SSGI and TRAA webgpu nodes. The three team has been making great progress with SSGI and webgpu in general and i'd recommend checking it out if you're interested.

There's also a denoise node in three (not used in this example), but SSGI still looks kinda blurry.

Work though is still going on: https://github.com/mrdoob/three.js/issues/31892

[−] chrysoprace 51d ago
What a time to be alive. It runs surprisingly smooth on Firefox/Linux and doesn't appear to put much strain on my 9070 XT.
[−] simlevesque 51d ago
Beware: this might totally freeze your computer like it did for me.
[−] __turbobrew__ 51d ago
Runs fine on my iphone
[−] ivanjermakov 51d ago
WebGPU moment (have same issue on Firefox/Linux).
[−] amelius 51d ago
Works fine on my phone, Firefox+GrapheneOS.
[−] daemonologist 51d ago
Had to break out Chromium for this one - Firefox+Linux does not like webgpu (my whole DE started flickering).
[−] themadturk 51d ago
Works great on my M3 MacBook Air under Safari. GPU core temps got into the 130-160 degrees F. range. Fun demo!
[−] RankingMember 51d ago

> The babies look unhappy

> Add more balls

Fun simulation. The novelty of stuff like this still hasn't worn off for me in this era where we've got ray tracing in-browser.

[−] hermitcrab 51d ago
I'm a C++ programmer and only passingly familiar with web/JS stuff. What libraries/technologies is this using, apart from Javascript and three.js?
[−] Rendello 51d ago
Beautiful, this must have been an excellent learning experience to make.

I've done some very basic rendering code in C from a rendering internals course, and at the same time I'm learning about perspective from the drawing/art side. I wonder how much learning one would help the other, in a practical way.

[−] rbosinger 51d ago
I opened that on a Pixel 9a and was impressed on how well it worked. There's something neat about this.
[−] slopinthebag 51d ago
It's cool but shockingly slow for an SSGI implementation, especially without any denoising.
[−] CodeWriter23 51d ago
I was able to get all the balls stuck on the 'ceiling'. Bug or feature?
[−] nerptastic 51d ago
Man. Runs like butter on an iPhone 15 (Non-Pro). Impressive!
[−] fuzzfactor 51d ago
This does work good with Linux and Firefox on older PCs too.
[−] petermcneeley 51d ago
[−] appstorelottery 51d ago
Runs great on MacBook Air M1! Super!
[−] artursapek 51d ago
that's amazing. it runs so smoothly on my M4 Pro
[−] chirau 51d ago
No offense, and please pardon my lack of knowledge, but what exactly is so special about this?
[−] newobj 51d ago
path tracer?
[−] jessepasley 51d ago
Is this marketing for the Shape Store? It's cool but I still don't know when my area is getting a Shape Store.