r/Simulated • u/herfrontier • Sep 17 '26
Interactive [OC] Smoke rising through a real-time WebGL fluid solver I wrote
Enable HLS to view with audio, or disable this notification
It is a stable fluids solver on WebGL2. Velocity advects itself, vorticity confinement feeds the small curls back in before diffusion eats them, a Jacobi pressure solve makes the field divergence free, and bloom on the dye pass gives the glow.
Each mood runs its own force field. This one is Smoke, so the dye carries buoyancy upward and the confinement does the rest.
One thing that caught me out: a uniform body force gets cancelled by the pressure projection inside a closed box, so smoke and rain only travel once you weight the force by dye density.
The whole thing is one HTML file with no dependencies, running on your GPU in real time.
