Themperror

Game/Engine Programmer

Back to Home.

GPU Particles

Link to the Github.

Type

Tech Demo

Language

C++

API's

D3D11

Libraries

"Dear ImGui"

Comments

Uses DispatchIndirect for Compute and DrawInstancedIndirect for rendering.

After a successful first interview for a job application, I got send a programming test, this involved creating a GPU Particle simulation using indirect drawing, compute shaders and geometry shaders. I hadn't done anything with compute before so I had to learn it while creating this, in 3 days time I was able to create this and send it in.

I know the basics of how multithreading works and how one could approach a few issues, but after doing some more research and while discussing with some other programmers I found out that applying CPU multithreading techniques to the GPU wasn't that great. After this revelation I reworked my code a bit to optimise it for the way the GPU likes it, it quickly became more stable (those TDR's crashing my GPU driver weren't fun).
Now I could run over 5 million particles at ~70 fps, I didn't push it too much as I had enough TDR's and hard reboots during the initial creation.

I limited it to 2 million particles to make sure it stays on the safe side and this runs at an easy (limited) 150 fps. The simulation itself uses 1 gravity point with N-Body physics and Verlet Integration.