Loading video...
Video Failed to Load
Tried to use reintegration tracking for simulating something "shallow water equation" like. Curiously it was simply enough to put an ideal gas in a potential field of the terrain shape. In that case the density is proportional to the height of the water. (but you do need to find... show more
18,859 views • 2 years ago •via X (Twitter)
6 Comments

It can be derived by stating that the height of the fluid + terrain must be constant H = h + rho = const grad(h + rho) = 0 -> grad(h) = -grad(rho) So if the gradient of the density (which is our force here) is equal to the negative gradient of the terrain height then their sum should be flat.

In the simulation this can be done by adding the negative of the terrain gradient to the SPH pressure (which for an ideal gas is just the density). Since the simulation will tend to 0 net force, the surface will tend to flatness.

Also, initially I've implemented the "Trivial Algorithm for Interactive Water Simulation" paper, but I didn't like how handwavy it was and didn't have actual fluid inertia, but it does produces much nicer waves.

I still wonder if I can make the reintegration one less "viscous" Also a potentially interesting extension would be to try to add additional layers of the heighfield(density) to try to emulate a 3d liquid (2.5d). Tho no idea how exactly the algorithm will look like.

Comparing trivial water to reintegration tracking:

Comparing the surface quality: first is trivial water then reintegration
