Simulating water over terrain
41–50 of 60 posts
Re: Simulating water over terrain
#42That's Creeper World for you.
Re: Simulating water over terrain
#43This is super, super cool! I was experimenting with a similar idea recently with the help of o3-mini-high. I talked it through my idea for an algorithm, and it implemented and rendered it in 3D with no manual intervention (although I did prompt it a number of times): https://3d-water-sim.netlify.app/ It's not perfect yet because I stopped playing with it, but it was improving significantly with each iteration. Fun fa…
Curious, when you do these exercises, is for entertainment or learning? If the latter, do you find it still worthwhile to read the blog post of this thread, since you didn’t implement anything yourself? It’s a journey versus destination question.
Re: Simulating water over terrain
#44Re: Simulating water over terrain
#45Re: Simulating water over terrain
#46The waves when the water is first entering the area is called numeric dispersion, it's a consequence of discretizing. It can be mitigated somewhat by smoothing the entering wall of water so that there's not a sharp discontinuity.
Re: Simulating water over terrain
#47This brought back memories of implementing my own GPU-based fluid dynamics in 2011 for my thesis. It was also for fluid (blood) across a surface (tissue) and was simulated in 2D but projected across the mesh with considerations for gravity and surface inclination. Even put a short video of it on YouTube: https://youtu.be/4vGrNc-GGW8
Re: Simulating water over terrain
#48What the author implemented is a specific case of Saint Venant shallow water equations (in case you want to know where it comes form).
Re: Simulating water over terrain
#49> Of course, this model isn't perfect. One of the most obvious problems is that it doesn't have inertia and velocity diffusion. A fast water stream entering a lake won't propagate further inside the lake, but will instead spread out in all directions, ignoring all accumulated inertia. Two parallel water streams going in opposite directions can exist and not interact with each other (provided the water levels are equa…
Re: Simulating water over terrain
#50NOTE: you need to change the model values in the bottom toolbar to see big effects.
It is a cell-based simulation that uses WebGL to calculate cell values based on adjacent cells. The shader that does that is here:
https://github.com/concord-consortium/flooding-model/blob/ma...