1
Window / Re: Precomputing and storing render-information efficiently
« on: April 05, 2023, 04:04:22 pm »
I'm doing a fluid simulation where I iteratively have to find all neighbors of each particle (done with spatial hashing) and solve a system of equations to calculate the pressure per update. So while there certainly is a lot of room for minor improvements, the general order of magnitude of my calculations' speed is about what is expected.
I'm using std::vector as a container for the particles and move a single shape around the screen and draw it repeatedly for rendering. But the actual update of the values and rendering are negligible compared to the neighborhood search and pressure computation when computing in real time.
When computing beforehand though I'm now certain that the bottle neck is reading the stored particle-positions from disk to then draw them. Therefore the advice which eXpl0it3r gave hits the target pretty well.
I am of course grateful for any additional advice concerning optimization of these kinds of simulations.
I'm using std::vector as a container for the particles and move a single shape around the screen and draw it repeatedly for rendering. But the actual update of the values and rendering are negligible compared to the neighborhood search and pressure computation when computing in real time.
When computing beforehand though I'm now certain that the bottle neck is reading the stored particle-positions from disk to then draw them. Therefore the advice which eXpl0it3r gave hits the target pretty well.
I am of course grateful for any additional advice concerning optimization of these kinds of simulations.