Saturday, September 15, 2007

Soft Particles

one of DX10 features is the ability to read from depth buffer, in DX9 you can't do it unless you are generating it by yourself and pass it as texture.
in my ambient pass i'm using multiple render target, one for color buffer and one for depth, after that i'm setting it as texture and use it when needed in the pixel shader.
for soft particle effect, i'm reading the depth value from depth buffer rt and compare it with particle depth, then i'm compute new alpha value based on the difference between those values, (closest particle to level surfaces = more transparent).
here is few screenshots of the effect.
i marked in red the area the particles intersect with level surfaces.

No comments: