Alex Dunn - Particle Turbulence


This particle system uses directX 11 technology, most notably the compute pipline, to move and render up to one million particles. The particles are subject to turbulent forces, which come in the form of perlin noise. For my noise implementation I have directly ported ken perlin's original implementation, to a compute shader, without any permutation gradient textures like you would commonly see in other GPU implementations.

Particles are stored in a structured buffer on the GPU, compute shaders have read/write access, and the rendering pipeline has read only access. Each particle structure holds; position, velocity, time alive and a random seed. Particle positions and velocities are updated the compute shader, each thread indexes an address in the buffer. The noise is calculated based on current position, one noise function for each component (XYZ), and added to the velocity before updating the position.

Once the particle has been updated, the rendering pipeline takes over. Each particle begins as just a single vertex and at the vertex shader stage, the vertex positions are updated using the SV_VertexId symantic to address the particle buffer, and grab the position stored for that particle. This position is then passed into the geometry shader stage. It is at this stage the vertex is expanded into a triangle strip of 6 vertices. The reason for using 6 vertices over using a quad of 4 vertices is that this enabled me to add a trail onto each particle which can be lengthened or shortened based on it's speed, and rotated based on it's direction of travel, without stretching the UV's over the whole particle, but only stretching the rear half.

Features: