Delayed light shafts because this was easier. Soft particles are done by fading parts of the particle that are close to solid objects. This is done by comparing the depth of the scene with the depth of the particle. By doing deferred rendering i already got the depth buffer in a texture (how convenient 😀 ) so no extra work done there. So the only work i had to do really was to ammend my old particle shader with the comparison and clipping functions (i have to do my own depth testing here). If the depth of the particle is greater than that of the scene at that pixel then the ‘discard’ statement discards the pixel.
the fading out part is done by a nifty little line of code i found here.
Here are comparison images:
Probably doesnt seem like much, so i did it with a solid texture so you can get a better look at what’s going on
I think its more than obvious that i didnt sort the particles, i’ll do it later. I can get soft particles with only a few extra lines of code. I actually didnt think it would be this easy at first. Turning it on and off is just a matter of me toggling a boolean value in the shader, its that simple 😀
That’s all for today