Unity Compute shader + instancing drawing
GPU Compute and Instanced Particles
Using compute shader and instanced indirect drawing to create 500k runtime particles.


Demo scene with Unity standard assets

Unity's shuriken particle system is wonderful, but it still count on CPU to do most of the particle calculations and it often spend a lot of CPU resources and drag the performance. Direct compute shader offers a GPGPU solution to put the great amount particle data calculation into GPU pipeline Unity 5.6 offers a very simple GPU instancing method to draw with the particles' data buffer from the compute shader.
This demo is trying to create a particle afterimage effect with compute shader and Graphics.drawmeshinstancedindrect function.

Problems & Challenges:

1. Should implement multiple compute shader kernels and structure data buffers to emit particles and simulate particles' behaviors.

2. Have to get the vertices' actual world position and normal directions from the skinned mesh.

3. Need to make the particle's start color same or similar to mesh's materiel color.


This demo only shows the basic usage of compute shader to emit and manage particles.
There're more potentials to explore, please check my website later for more examples. ~

Decal and destruction test demo.