Smoothed-particle Hydrodynamics in Niagara

Thanks, Deathrey.

As I say, I have the fluid simulation working perfectly well now, and I’m getting 120 fps on my five year old computer (and that’s with four iterations of the simulation stage). There’s no need to separate the density loop and the forces loop into separate simulation stages.

Regarding the boundary-handling, using the built-in signed distance field-based collision module works just fine. However, since that doesn’t work on mobile shader models, I developed my own environment collision system which also works very well, albeit with a slight drop in performance.

Even with tens of thousands of particles I’m still getting 90+ fps. However, there’s never going to be more than a couple of hundred particles in the system for the purposes to which I need to put it; I’m not simulating buckets of fluid. Therefore, I don’t believe it really is a gross expectation for this to run on a mobile device. A mobile device would need be less than 1% as powerful as my old PC for this to be impossible performance-wise, and modern mobile devices are more considerably more powerful than that.

I can’t test it anyway because simulation stages aren’t supported. This is frustrating but since it appears to be possible in Unity, I’m going to try that.