16
Nov
09

Soft Particles

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.

Advertisement

0 Responses to “Soft Particles”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.