Specialization
VFX Particles with compute shaders
In the realm of graphics programming, especially when creating visually stunning effects such as smoke, fire, or various forms of VFX, one encounters numerous challenges. These challenges, while daunting, also serve to test our technical abilities and capacity for innovation. I chose to focus on VFX particles as a means to both utilize and learn about compute shaders, and this choice also provided me an opportunity to delve into ImGui. By developing a tool for particles, I made it possible to alter them in real-time and also to save them for use in different contexts.
The main challenge often lies in computing effects, such as particles, which are traditionally handled by the CPU. Although the CPU is powerful, it has its limitations when managing a large number of calculations, which can restrict the look and feel of the particle effect.
By using compute shaders, we leverage the GPU to perform calculations in parallel. This approach significantly increases our capacity, enabling us to manage millions of particles instead of being limited to, for example, 25,000.
I started researching compute shaders and challenges that can arise because of them. After some research, I looked into how to create and bind different resources to the compute shader. I also explored which different particle effects I would like to recreate using the knowledge gained during this time.
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.
Wanting to make my code more flexible, achieved by adding more values to the constant buffer. Doing this made it possbile to create a more diverse particle effects. By making the particles compatible with the editor and by updating it with new values that could be altered. Additionally, I experimented with my editor and the compute shaders I had at the time, to see what was possible with one million particles.
I updated the editor by enabling particles to be saved and loaded during runtime, then I
began exploring collision detection with the depth buffer for an inexpensive yet visually appealing effect.
To learn more, I experimented with different effects and quantities of particles to determine what I could showcase in my portfolio. This led to the creation of the first GIF, displaying 10 million particles on screen in a simulation.
I was abel to add a type of depth buffer collision with my particles to achieve an cheap yet visually pleasing effect.
During this time, I primarily devoted my efforts to writing my CV and website.
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.