
Specialization
VFX Particles with compute shaders

When creating a particle system one will encounter many different problems. Such as computing the effects or how many particles can be shown at once without taking a big performance loss
One way to solve the computing of the effects is to make it so the GPU does it instead of the CPU.
This is accomplished by using compute shaders in DirectX11.


I started creating buffers for the particles so I could use different data in the compute shaders. I was also exploring how to use ImGui for my project to create a basic particle editor. Using this editor, I could adjust gravity, velocity, size, etc., of the particle system.
To make my code more user friendly I also created a particle editor. Where the user can change different values and how the particles should behave. But also making it possible to load and save this data.


To see what my editor and particle system could handle. I tested with many millions of particles at once. This worked extremely well thanks to compute shaders.
​
To make my system even better. I added depth buffer collision making the particles collide with the scene for a better effect if wanted.

I was very excited that I managed to implement a sort of depth buffer collision. It works by using a texture of what's in view of the player, then projecting the particles and the z axis value of the buffer to screen space. Comparing viewspace of the particles and z axis and a thickness value, creating an apperens of the particles colliding with the environment of the game world.



