#gWater 2D
1 messages · Page 1 of 1 (latest)
Now that's interesting.
It makes me wonder how optimized it could be made
@brazen mica did some performance benchmarking around particles using multiple tables for each particle and referencing them by a common index across those tables and the results were pretty noteworthy
I wonder if that same technique, and others, could be used to make this run faster
At this timescale, any speed-up could potentially make a large difference in the total processing time
Also, consider using IVideoWriter to more directly output the rendered frames
https://gist.github.com/ZehMatt/d8b2e06db56a6e396dc5da92b7cc82c2 here is an updated version that packs the 3 components into same table
in the video I followed along with, each particle is tracked in a grid the size of the particles "smoothing radius" and only neighboring particles in a 3x3 grid around it are tested
if that makes sense
idk if that's similar to the optimization you're interested in. I implemented it already but I think Lua is just slow compared to C#
Let's try to convince a bunch of particles to behave (at least somewhat) like water.
Written in C# and HLSL, and running inside the Unity engine.
Source code:
https://github.com/SebLague/Fluid-Sim
If you'd like to support me in creating more videos like this, you can do so here:
https://www.patreon.com/SebastianLague
https://ko-fi.com/sebastia...
this is the video I followed along with, the math goes over my head
I'm looking at this now, interesting... I wonder if it could help
I will say, I didn't implement this optimization exactly how he did it. I opted to use nested tables for ease of coding it in but I wonder if that's killing performance
Nested tables are bad for performance
ok, a major part of the performance loss was because I forgot to implement the grid optimization when calculating the density 🤦
but i reckon moving away from nested tables will help too, along with this
I gave up trying to do complex simulations in gmod, can't also use multithreading so that takes a good chunk away of what could be possible
im only doing this for the experience, I want to move away from gmod but so far it's the only thing I know well
I don't want to have to familiarize myself with an engine or new language to try this stuff
i get that, however you will eventually realize the limitations 😛
and yeah gmod is a good playing field to try stuff
neat, altho I thought its 3d 😦
i tried this in 3d but its vastly more complicated and much harder to do
Well that's cool
Can you make the particles impart force on the cube?
It would be cool to have them slosh around and move the cube like liquids do in containers