A simple particle system implemented in OpenGL 4.6.
(Also project for Zhejiang University 2022-2023 Spring Computer Animation master course)
The application contains a single particle emitter, and some settings of the particle system can be set through the 'Particle System' panel.
CMake is used to build this project.
C++20 is needed.
glslangValidator should be in PATH.
There are 4 main parts in the particle system:
- emit - Particles will be emitted every
emit_intervalframes. Each new particle has an random initial position and velocity, and the initial accelerator is zero. Seeemit.comp. - update - Update particles using Verlet method. A force input from UI, gravity and drag force are considered. See
update.comp. - compact - Compact array of particles due to dead particles every
compact_intervalframes. A two-level scan on GPU is performed to compute the new indices in the array for each particle (seescan1.comp,scan2.compandscan3.comp), and then living particles are copied to the new position (seecompact.comp). - draw - Render each particle as a billboard using instanced draw call. See
draw.vertanddraw.frag.
