Particle Systems & Compute Shaders
- Gary Yang
- Dec 31
- 2 min read
Updated: Mar 5
This is very simple particle system I set up in a 2D Custom Game Engine
It supports very basic functionality like simple vectors, orbits and vector fields
Current Architecture Summary
Particle Emitters are an entity component on the C++ layer of the project. (Engine is C++/CLI C# based) Particle emitters interface with a singleton system that store all the particles of each emitter as well as a buffer for relevant global modifiers to each emitter. figure 1
Each emitter is a component that handles the emit logic. That includes its position in world space and any other relevant information shown in the particle struct. figure 1
On the CPU side, we only keep track of life time. When a new particle is emitted, a particle that has a life timer of 0 or less gets selected and pushed to the GPU with new emit conditions as a sub buffer update. The system only pushes to the GPU when new information is needed. While on there, particles are updated via compute shader, and then drawn via an indexed draw call based off a transform given by the compute and a mesh color by the particle.
A Diagram of the Particle System

Things to change
Emission needs to be moved to the GPU I'd like to modify it to follow the framework of turanszkij's wicked engine (https://wickedengine.net/2017/11/gpu-based-particle-simulation/)
While I did have the data structures needed for vector fields set up, I never set up a client to send them from the GPU
Polar Vector Support
Polar Equalized Emission
While I do have a polar emitter, it dose not account for distance from center when finding random points, this causes more particles to be near the center and less to be farther out.
Comments