Forward Shader in Deferred Rendering Limitation

toureiro 6 months ago • updated 6 months ago 1

I'm not sure this is a bug or a hard limitation but basically I've been using a forward render path shader on a game that needs deferred rendering with zero issues up until now. 

However, I've bought Hx Volumetric Lighting and noticed the asset had a problem with the shader - it doesn't seem to take depth into account so the glow of a light always appears in front of everything. 

After some debugging I realized that if I use a shader with the deferred render path it solves the issue. 

The problem is that my shader is built around nodes like Light Attenuation and Light Color, nodes that aren't available in deferred rendering. This seems like a crippling limitation - I can't create the unique look of the game without them, I cant support it with HxVL with the Forward Render Path, and I can't switch the game to forward rendering because I use a lot of lights.

Is there away around it? Are there plans to support these crucial nodes in deferred rendering?

Here's a clip of the issue: gfycat.com/VagueSpectacularLacewing 

I think I found a fix: Using a script to turn on the depth buffer on the camera fixes the issue, although this fix seems to be incompatible with unity's new Post Processing Behaviour.