Are you simulating the powder on the GPU or the CPU? I couldn't find any shader code that looked relevant to the sim, so I'm guessing it's the CPU. Any plans on making a GPU version? Seems loke you'd be able to overcome the perf issues and finally make that 3D version.
Everything's on the CPU right now. Since the interactions between particles is incredibly complex and is designed for serial execution, the best place to start is rendering visuals like fire and blob effects. However, on my machine there is little difference in performance when toggling this feature on/off.
I have serious doubts a 3d version would be better. It would be hard (if possible at all) to make an equally simple interface that conveys the same information and is equally easy and fast to use while allowing free 3d interaction.
Maybe that becomes a lot easier once virtual reality and 3d input devices become common, but until then I think there are better ways to use extra computation power
I should have been clearer, I was referring only to the last part of the last sentence
>Seems loke you'd be able to overcome the perf issues and finally make that 3D version.
Which I interpreted as "once GPU simulation makes things fast, why not make a 3d simulation"
Apart from that part I agree with the ancestor comment, the code seems to do CPU simulation and GPU simulation is likely to be faster. On the other hand GPU simulation would likely mean rewriting the entire simulation engine from scratch, so I'm not holding my breath.
There was commentary in the FAQ that he was not going to try to make a 3D version because of the perf issues. I assumed that meant figuring out GPU sim would mean he'd try to make a 3D version.
This looks nice. But, ideas are more important than code. So to be honest, I would enjoy a description of how this works more than actually playing with this program.
From a quick look at the code it seems to be coded as a fairly standard particle system. Modern processors are fast, if you have a million particles, a 2GHz processor, and do 20 simulation steps per second you can spend 100 clock cycles per particle on simulating it. On modern processors 100 clock cycles usually translates to over 100 instructions.
Of course the ~100 clock cycles latency for fetching from main memory has to be avoided, so you code in a language like c++ (like this project) and pack your data in big arrays in the order it's accessed in. Then processor caches and prefetching do the magic.
Particle interactions that usually imply quadratic runtime can be made fast by mapping particle positions to a grid and either looking up neighbouring particles in the grid or calculating large scale effects directly with the grid.
Personally, I think for this project the working whole and the value it provides as a fun educational tool is a bigger deal than architectural or development ideas that went into it (but I'm happy to be proven wrong)
https://www.youtube.com/watch?v=TbSmrjmP85Q
https://www.youtube.com/watch?v=e0zHiVw-c7k
https://www.youtube.com/watch?v=h4eHgnLFk9k