0.5b will feature a few more entities to mess with! Including a laminar flow emitter and drain.
Now for some technical talk:
gwater2 now has particle lifetimes, which can be very expensive if not programmed correctly. Each particle position up to this point has been managed in a 1D array with an active length equivalent to the particle count. Now, because particles can be removed, we cannot use this approach without shifting around lots of data. An active buffer now manages which indices in the position array are valid, and during each physics frame, each active particle is looped over and the deltatime is subtracted from each particles lifetime. when this value reaches zero, we take the last index in the active array, and replace it with our current, then subtract the active count by 1, which appears to remove a particle in a solely 1 dimensional array despite only changing 1 value. This makes particle removal an O(1) complexity, unlike in gwater1, where it was O(n)
The downside to this approach however is that when adding new particles, you must find a valid index in the active buffer to place the newly created particle. Buffers from the GPU must also be mapped to avoid data from being asynchronously overridden by FleX. This unfortunately makes particle creation extremely expensive, and is why the framerate in this video is lower than previous showcases. I have a solution which can asynchronously add particles into the solver, however, it comes with a few visual bugs that I have yet to fix, since as previously mentioned, FleX is asynchronously overriding the particle data
I hate programming these new features which ultimately end up hindering performance in one way or another. It's for sure something that everyone wants, but nearly halving framerate during particle creation is something that makes me feel a slight sense of.. dread? I guess? like I hate the idea of someone going, "oh yeah, 0.4b had better performance" even though I worked really hard to optimize this the best I could.
maybe I should have stuck to cloth. much easier than water...
Workshop Link: https://steamcommunity.com/sharedfile...
discord: / discord
Releasing for free in Q1 2025