Hacker News new | past | comments | ask | show | jobs | submit login

Fantastic read! Not to diminish the original contribution here, but I got curious and started looking for similar projects on the native (in my case iOS / Metal) side that aren't part of the usual suspects like game engines.

These two are kind of fun to play with: https://github.com/andreipitis/FluidDynamicsMetal https://github.com/hagmas/MobileFluidSimulation

Both based on this approach, detailed here by Nvidia: http://developer.download.nvidia.com/books/HTML/gpugems/gpug...

The technique this is based on doesn't create those satisfying tension effects but is more similar to paint flowing on a surface of water, so from a tangibility perspective I'd still love to find something closer to this post's work that runs natively.




You might find this post by Jamie Wong interesting: http://jamie-wong.com/2016/08/05/webgl-fluid-simulation/

Doesn't seem to work on mobile though


There are two difficulties you'd encounter adapting those techniques to this simulation:

1. The curved boundary is somewhat annoying to handle when your simulation is done using square grid cells.

2. Empty space introduces some really annoying boundary conditions. You'll notice that those two examples fill the entire region with fluid.

It's entirely doable, but the boundary conditions probably triple the implementation effort when compared to a square box entirely full of fluid. As a wise man once said, "90% of the work in fluid simulations is dealing with boundary conditions."


https://github.com/mmaldacker/Vortex2D

It should work on macOS/iOS via MoltenVK, but I haven't tested it extensively.

It's a hybrid simulation with particles for the advection and a grid to ensure incompressibility.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: