I promised something cool this week. Time to deliver! 🚀
Meet Three.js Particle Fluids—a WebGPU-based library for simulating fluids, rigid/soft bodies, cloth, and gases.
Live demo 👉🏻
dgreenheck.github.io/threejs…
Source Code 👉🏻
github.com/dgreenheck/threej…
What makes PBFs so special?
Because *everything* is represented as particles, you can have fluids, soft-bodies and cloth in a single scene and they all collide and interact with each other.
This let's you create some really cool effects that are difficult to do with other methods:
- You can squirt water at a cloth and it will push back
- Cloth drapes around objects
- Soft bodies can float or mix into fluids
You can easily tune performance across devices by modifying particle counts.
I spent quite a few hours building and researching this a few months ago but it never really reached a level of quality I was happy with releasing.
Fast-forward to today, I was able to leverage Opus 5.5 to get the library to a more complete state.
Excited to see what people build with this!