-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
200+ FPS (on an simple laptop) #86
Comments
Great job looking forward to it 👍 👍 💯 |
It is not working for me |
yes. I'll try to make something mergeable with the main project, and independent of oneAPI. |
it took me a while. the code is unfortunately much slower on MSVC than on intel compiler. But still faster than the previous version of course. i also removed the dependency to intel TBB so no 200FPS (it can still be seen in commented code however) |
Hi! I want to set different particle sizes depending on their type. For example, red should be 1.0 pixels, green 1.2 pixels, blue 1.4 pixels, and so on. I saw in the code that a size is defined for all particles in ofApp.h. How could I condition this particle size with an "if"? I would like to define something like: |
i assume your are referring to old codebase. Can you post a link to your code ? the easiest way to do this would be to add a radius property to the point struct. and then you would just ofDrawCircle(x, y, radius) |
Here is my last version of the code. |
I tried the new code, but it works extremely hard. I couldn't get more than 8 fps at 8 colors of 1000 particles each. Then, another shortcoming of the new code is that the particles look extremely small, like little dots where you can't really distinguish the color shades. The structures formed don't look good at all because of this. |
I also tried to insert a fullscreen button but it didn't work. I used ofToggleFullscreen(), but the screen kept blinking without showing anything. |
I'll take a look at your code, and also patch my code to allow drawing circle. |
I'll check the fullscreen problem as well. |
I took your exact code and just added more colors and those extra buttons. And after compiling, the code worked extremely hard. I had to set a small number of particles (under 1000 of each color) to go at 10 fps. Here is your code with my additions in it in old way, that works fine with 17313 big particles at 61 fps: Here is your code with my additions in it but in new way, that works slow and particles are very very small (near dots) with 9600 particles at 4 fps: |
i'm still busy refactoring and i'm currently relying on intel's oneAPI and TBB for multithreading.
But you can check the code here https://github.com/ker2x/particle-life/tree/oneapi-dpl/particle_life/src , and perhaps backport the modification to a normal compiler and normal lib. (or i'll dot it myself some day i guess).
It's not fully optimized yet but, notable change :
it should also allow to add more color more easily (i hope)
major cleanup of interaction code
i still have some crap to clean :)
this is me slowly learning to use oneAPI and SYCL in order to offload all the parallel code to the GPU in the future (in a new project)
The biggest performance improvement come from the use of SOA and VBO.
The text was updated successfully, but these errors were encountered: