Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pk274

Pages: [1]
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.

2
Window / Re: Precomputing and storing render-information efficiently
« on: April 04, 2023, 04:31:53 pm »
Alright, I'll look into both options, thanks a lot :)

3
Window / Re: Precomputing and storing render-information efficiently
« on: April 04, 2023, 10:40:43 am »
Thanks for the quick answer.

If I do it in real time, the performance drops because of the calculations, which is why I implemented a way to do the calculations first, export the positions. Later when I want to view the results, these positions are read and images are created from them in real time. I think this is what you refered to as playing back the information. Sadly (I think it's the reading process, not the rendering itself), for large amounts of particles, this method of rendering too gets pretty slow, as for every update several thousands of positions have to be read and drawn. So I think I'm looking for the second strategy you mentioned, which involves exporting images in the process.
So my SFML-related question would be "Is there a way to create a video from the frames my program creates within SFML or, if not, can you recommend a compatible library for that?".
Your previous answer hinted at ffmpeg for that, is that it?
Or of course if you have a good idea to optimize the procedure which I described above, I'm also grateful for any suggestions.
Thanks :)

4
Window / Precomputing and storing render-information efficiently
« on: April 02, 2023, 03:10:41 pm »
Hello,
I recently started using SFML for my university-project and I'm very happy with it.
I'm working on a two dimensional simulation that uses a lot of particles.

Since the computation of the particles' positions can take a lot of time and therefore my simulation does not run smoothly in real time for a high amount of particles, I need the simulation to be able to precomute all the particles' positions and then, after several hours of parsing, show me a video of the simulation result.

Currently in the precomutation phase I store the particles' positions and then, when I want to watch the result, this information gets read and images are then drawn and displayed in real time.

I am pretty sure that this is one of the dumbest ways to do this, but I also could not find many resources for how to improve on it, so I thought I might as well ask here. Thanks in advance for your help :)

Bonus points for methods that are rather simple, I absolutely dont get graded for the performance of the rendering, so I dont want to spend an excessive amount of energy on it, but I'd still at least want to know what would be the proper way to do it and implement it if possible.

Pages: [1]