Faked Volumetric Particle Lighting
Faking volumetric particle self-shadowing using a single flat 64x64 ARGBFloat render target. The basic idea is this: given a single ray through a material, we can easily encode the point where the ray enters the material, the point where the ray exits the material, and the accumulated density between the entry and exit points. Since we can calculate the ray start and direction on the fly, we only need to actually encode normalized T values of entry and exit, and with density this is only 3 float values. During shading, each pixel uses it's depth in light space to figure out how far along the ray the pixel is, and based on entry/exit/density calculate how much density to accumulate at that depth. In still shots the effect is fairly convincing. In motion, some popping artifacts are visible, which can be reduced by lowering density values. In this demo I also shade the particles using spherical harmonics lighting plus diffuse wrap lighting for the main directional light, taking advantage of Unity 5.5's new support for particle tangent values.
Alan Stagner (Jet Fist Games)
Freelance General Developer - Programmer