Return to main page

Soft particles

A soft particles demo. Traditionnal particles effects "cut" particle when they collide with the environnement due to Z test. With the soft particle effect, you get nice attenuation against the environnement and better looking quality with density control.

My particle effect is more like a volumetric effect because each particle have a sphere based density and shape. We can also consider it more like and "half-volumetric effect" because each particles are still a billboard.

Each particle's pixel density is computed using the view direction vector and sphere depth, then we use the density to compute how each particle's pixel contribute to the scene. To simplify sphere intersection computation, I use only one view direction : the principal direction of the camera. Thus,
I can compute in a simple and not time consuming way sphere depth for each pixel in a fragment shader.

All depth interactions are handled in the fragment program so depth test and depth write can be disabled.

Download source and executable

Z-buffer articaft of traditionnal particles effects
Soft particles

 

Correct attenuation with environment

 

Soft particles superposition

Return to main page