Based on Codemaker4 Raylib Particle Toy but with performance improvements.
demo-particles.mp4
This is a little project playground to mess with particles.
In Codemaker4 implementation, every particle is drawn with the DrawPixelV()
function, which causes 1 draw call per particle. So I decided to experiment and improve it with the method of drawing pixels on the texture, resulting in only 1 draw call and a nice performance improvement. It doesn't call a texture draw on particles that are outside the screen. The texture in which particles are drawn can be of lower or higher resolution than the screen.
You can move the camera with WASD and zoom using the scroll wheel. Pressing the scroll wheel will reset the zoom. It is easy to change and play with parameters. So go for it!
The entire repository is a Visual Studio (Community Edition 2022) project, so you can open and compile with it.
Raylib 5.0 library is included in the project.
Feel free to contribute to this project and suggest some ideas for it.
Under the MIT license. Feel free to use it. Never lose your smile :)