Fluid Simulation and Web Assembly

The author watched a video about creating a fluid simulation in Unity and decided to give it a try in C++ using Smoothed Particle Hydrodynamics (SPH). This method requires estimating fluid properties for each particle, such as density, and moving particles in the direction of the density gradient. Optimization involves implementing a grid-based system to only calculate interactions for nearby particles, resulting in a significant speedup. The next step would be to parallelize the simulation using CUDA or OpenGL, but technical limitations prevented this. The author used SFML for rendering but switched to SDL for web assembly compatibility. Emscripten was used to compile the project.

https://ehayes.page/posts/fluid/

To top