Show HN: Floaty – Multithreaded Fluid and Soft Body Simulation for Browsers

1 matsuoka-601 0 8/13/2025, 7:36:04 AM floaty-fluid.netlify.app ↗
Hi, I implemented a real-time physics simulation optimized with multithreading. The simulation runs on your browser, so check it out if you're interested!

You can drag the soft bodies, and change the simulation boundary size by resizing the window.

Demo: https://floaty-fluid.netlify.app/

Repo: https://github.com/matsuoka-601/Floaty

I'll briefly explain how it works under the hood.

For simulating fluid and soft bodies, a method called Position Based Dynamics (PBD) is used. This method is often chosen when real-time performance is required. Fluid and soft bodies interact with each other, and buoyancy is simulated based on a paper "Unified Particle Physics for Real-Time Applications".

The most time consuming part of the solver is optimized with wasm-bindgen-rayon. Since PBD is relatively easy to parallelize, multithreading greatly improves the performance of the solver. Thanks to this, the simulation runs smoothly on relatively weak devices I guess.

Comments (0)

No comments yet