Post FX is ignoring transparent shader

I’d like to get a custom fog gradient in my scene and I’m pretty new to shader coding. I followed this tutorial: AVA: Stylistic fog from Firewatch with Unity's PostFX v2 and the post FX is working great! Only problem is that it’s not affecting any transparent shaders.

Here are some things that I’ve tried:

  1. Set PostProcessEvent to BeforeTransparent (that prevented the background object from rendering over my transparent shader, but the transparent shader was still unaffected by the PostFX fog.

  2. Set up dithering on an opaque shader. This kind of worked. The dithered shader was getting affected by the PostFX fog, but the shadow pass (i think) was rendering on top of my dithered shader.

Any thoughts? Thanks!

Unfortunately as it is, transparent objects don’t write to the depth texture. Seeing as this effect is reliant on the depth texture (as it’s the only information about the scene the shader has), it physically can’t see transparent objects. The dithering approach you mentioned is a fantastic workaround to this problem, and the problem you are facing with that shader is very fixable. If you can post your dithering/discarding function, then we can create an appropriate shadowcaster pass for said shader. Alternatively, you could use a custom transparent shader that includes the fog function within it.