正在加载视频...
视频加载失败
This one took me almost 2 years to master, soon every Threejs dev will master it with a simple Import: Smoothed Particle Hydrodynamics Simulation, 2D and 3D, optimized with Spatial Hashing and Compute Shaders. Optimized for WebGPURenderer with complete TSL compatibility!!
131,159 次观看 • 1 年前 •via X (Twitter)
61 条评论

Whoah, nice!! Could you add a Torus with a spinning spiralled profile? Plz. 🙏😁

Ouch, last time I implemented rigid bodies in a fluid simulation it was for MLS-MPM and it was quite an adventure. This one might take a while but ultimately I hope so yes! 😁

It can be 'easier' by making SPH particles rigid (perhaps by adding post-solve constraints), see in this example where you can still see the particles clearly, but rigidly packed.

Did some experiments a while back for “pre-fetching” the neighbouring tiles, helps quite a bit with performance when using spatial hashing. Might be of interest to you possibly:)

Nice!! Is it some kind of octree optimization? I will definitely take a look thank you!

It’s using sparse tiles, which in turn point to 4x4x4 cell blocks. So not really an octree, rather a shallow hierarchy.

I’m actually using that same data structure to run Marching Cubes and generate a triangle mesh efficiently:)

It's sph though. Do people use it for anything except "I'm gona try implementing it"?

Sometimes I feel like SPH gives a smoother result compared to MLS-MPM for fluids. Also, the explicit neighbor search in SPH can be quite helpful for handling foam or other fine surface effects. That said, I’ve only worked with MLS-MPM and SPH so far, maybe there is better 😁

My main concern about SPH is it feels like a gas with a density range too wide. While PIC/FLIP acts more naturally, with stable density and distinct air/fluid border, which is good for practical use in games. Though, I didn't try MLS-MPM to compare.

But every one of those Three.js devs will have a hard (close to impossible) time reading, understanding, and updating the code to make it do exactly what they want it to do because they don't know the terminology, the ideas and concepts behind it. People with deep knowledge will dominate the software engineering field. Hardcore developers will always have a job. You're one of them.

Spot on! I'm building Three.js Blocks to simplify these complex concepts so that even non-developers can create a these kind of 3D experience. So a prompt like "Add 50k+ particles in a box I can touch with my mouse" becomes as easy as "Add a sphere to the scene." with AI!

@onirenaud is Three.js Blocks a website? Or something that's not public yet?

I'm working intensively on it right now. It should be released in a few weeks. I still need to clean up a bunch of things and ensure a safe launch.

Looking forward to it!

so cool! how can we try this?

Thank you!! I’m still preparing the launch, hopefully in a few weeks 🙏

@threejs is amazing!!

Can see this one being huge 😊 look forward to seeing it implemented everywhere 😇

Contact Page on any Creative Studio at the end of the year: *insert logo instead of a sphere particles in the background with simulation in full screen* -> *user interact with the background and things moves in the window* -> Wow Award Site of The Day gg

This is definitely happening haha

Can you share the threejs blocks site link, I can't find it or it's not released yet?

@28_Jahid I will try to release it in the upcoming weeks! Still a lot of things to prepare.

Waiting!!!

This is awesome! I was trying to do something like this for the tldraw shader starter kit but couldn't get the bots to do it. Can the particles interact with geometries?

Thanks! I saw this on my feed, really cool! Not yet. I prefer starting with a clean base and adding features based on community needs, but it's usually straightforward to implement, I mean it's already interacting with the boundaries that is a box. 😁

Any chance it's distributed or we can try ourselves? (Slightly different design but I've been a big fan of grant kot's integration here

I plan to have a license to cover this kind of case. Threejs Blocks won't be open source as I strongly believe in it and want to maintain and improve it for a long time but the price range will be very reasonable. It should be available in a few weeks!

Let me know! We’ve done a bunch of iteration around tldraw’s license (it is also not OSS). If there’s a way to include properly I’d love to try

@juancazala

Hi, I'm very interested in this.

Nice! It will be available in a few weeks! Still working on it. 😊

this looks amazing

Thanks for your work, and make it easy for us 💙

the collapse is super rad

awesome!

Beautiful!

🔥

Loved!

no 4d??? 🥺👉👈 we need fourjs already...

I wanted to do stuff like that. I spatial hashing is what I think it is. This is about as far as I got (webgl)

Awesome! I can already see some cool things made with this.

Whoa nice work!

Thank you!! 🙏

I will never comprehend how people can make this stuff

CPU fan goes brrrrr

No CPU was harmed! All runs on the GPU! 😁

That's very smooth ! nice.

In 2050 JavaScript will be the only remaining programming language

Does this work for complex boundaries?

Not yet, but that's not a really difficult feature to implement if needed!

Thank you! Solid work 💪

Hell yeah. Well done.

Wow wow wow great.

Thanks!😊🙏

This is art and math shaking hands. Incredible work.

Thank you!! 🙏

Nice!

Incredible 🤩

What to do with it?

Wait, is this the one that was previously a Turing-complete Primordial Essence of Doing Something due to a bug?

