Rendering particles

In this recipe, we will implement a simple particle system on the GPU. Compute shaders will be used to generate and update the particles within append/consume buffers, and we will use the vertex shader input semantics, SV_VertexID and SV_InstanceID, to generate billboards from the particle points.

We will introduce blend states to deal with the alpha blending of particles. In order to render the particles without regard to the order, we will also disable writing to the depth buffer.

Getting ready

Let us start with one of the previous rendering projects used in the recipe, Animating bones, of Chapter 4, Animating Meshes with Vertex Skinning. In this recipe, we will make use of a modified version of the CreateBufferUAV C# function ...

Get Direct3D Rendering Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.