Been implementing this particle-based fluid simulation from Sebastian Lague’s Coding Adventure: Simulating Fluids over the past week. I’ve dropped some vids here
fluidsim_2d_3d.toe (52.6 KB)
I’ve added some improvements like SDF-based bounding and a hit restitution parameter. There is also a collision for boxes vs regular SDF since you don’t want the normals to go to the center. Should probably make that a selectable toggle from the params rather than an automatically scripted thing.
At this point it is all separate glsl POPs for my own organization but there were significant portions that I did in mathmix at one point just to play around with those techniques. Will probably move some of the things into one bigger glsl POP for performance as i’m curious how much speed I’m losing for this design pattern. If anyone has any insight here that’d be great, but I’ll eventually do my own tests and see.
The 3D one is currently quite unstable. Just finished it today and haven’t had a chance to tweak the parameter ranges. the network is also way less cleaned up. Will probably get on that later this week.
2D simulation has unstable ranges for parameters but is far more stable.
Would love any feedback or feature suggestions if anyone plays around with it.
Might do a tutorial on the workflow as I saved every step of the video in different files. I learned alot about manipulating pops and had alot of fun along the way!