mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.1K
active users

I'm in the middle of huge refactoring, so I decided to take a break and do some water sim again. This time using the virtual pipes model, it turned out to be amazingly simple.

Don't have time for a fancy 3D viz, but still this might be the best shallow water sim I've made :)

@lisyarus nice! Do you have a good reference for the virtual pipes model? I did shallow water equations using the discrete exterior calculus in my masters thesis but was disappointed by the "flow feeling"

@artificialmind I'm using this paper: diglib.eg.org/bitstream/handle (section 3.1 is the main stuff), without viscosity & without any multi-layer stuff, together with outflow scaling that they mention from this paper inria.hal.science/inria-004020

@artificialmind Here's the whole update code. bed is NxN array of terrain elevation, water is NxN water column height (so bed + water is the height of water surface), flowx is (N+1)xN of horizontal pipes, and similarly flowy is Nx(N+1) for vertical pipes.

The Seven Voyages Of Steve

@lisyarus assigning to flowx / flowy functions weirded me out at first but they both return references I guess? I haven’t really seen that pattern before but I guess it’s better than raw array access (assuming inlined)

@sinbad Oh, that's my N-d array class with overloaded operator() (because multi-argument operator[] is only in C++23), and yep, it returns a reference!