Closed slime73 closed 11 years ago
Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).
[[https://bitbucket.org/rude/love/changeset/0103d2f89e35|0103d2f89e35]] (from #353) increased performance of particle systems a lot, because they no longer re-bind their sprite unnecessarily for every particle being drawn.
Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).
I tested out a change which improves performance a fair amount with little code modification: using the changes and test .love attached below, frametime went from 16ms down to 12ms on my Intel HD 3000, and from 9ms down to 5ms on my AMD 6750m.
Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).
I improved performance even more by using a single vertex array to draw all particles in a particle system. I now get 8.6ms with my HD 3000, and 3.25ms with my AMD 6750m.
Some stats when using just 500 particles instead of 5000:
Intel HD 3000
0.8.0: 1.6ms doing nothing, 3.05ms drawing particles
my changes: 1.6ms doing nothing, 1.7ms drawing
AMD Radeon HD 6750m
0.8.0: 1.5ms doing nothing, 2.3ms drawing
my changes: 1.5ms doing nothing, 1.57ms drawing
Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).
Commit 77889bd applied my performance-improving patch.
Particle systems are tricky on framerate even in meticulously optimized AAA games. During my testing I found that rendering a scaled down particle system to a half-screen sized canvas, and then rendering the canvas scaled up to the screen improved performance a ton on large particle systems.
I went from 8.6ms per frame (using the latest performance improvements) down to 2.2ms with my 5000-particle test when using my Intel HD 3000, just by doing the aforementioned canvas optimization.
Original report by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).
The performance of particle systems in LÖVE is not on par with what I would expect - even having a few simple particle systems for weapon hit effects greatly impacts the framerate of my games.
I don't know much about OpenGL or how LÖVE uses it, but I'm fairly sure there is plenty of room for improvement in the particle system code (VBO's?)