Particles are used everywhere in games for transparent objects like smoke, fog, dust etc; they can potentially add a lot of extra detail and polish. If you’ve ever added particles to your game you’d notice that one major problem is that they produce ugly artifacts and unnaturally sharp edges where they intersect the rest of the scene ( see below ).

Implementing soft particles is a way to alleviate the harsh collision that occurs between particle sprites and existing geometry. If you are doing deferred rendering you probably already have some way of retrieving your scene’s depth buffer. While rendering the particles into your scene, alpha blend out fragments who’s depth is close the the existing scene’s depth. You can make a simple fade out function such as:
D = clamp( ( Zscene – Zparticle ) * scale, 0.0, 1.0 ).
Nvidia’s article on soft particles, however, recommends using a piecewise function or a smoother function to create a nicer fadeout. Here is my soft particle using a smoothing curve.






0 Responses to “Soft Particles”