Unity 5 Fog not working on Standard Shader Objects

Objects applied with Standard and Standard_Specular shaders ignore fog in Unity 5 for me. Has anyone else had this issue?

Note: Fog seems to work with shaderforge shaders and some others.

alt text

You have to use the Global Fog shader in your camera, you can find it in the Standard Assets package. Then, your scene’s fog must be activated to work, more info here.

Thanks MikeLo. That unblocks me. Here’s what I did…

  • Added ‘Standard Assets\Effects\ImageEffects\Scripts\GlobalFog.cs’ to my cameras.

  • Specified ‘Standard Assets\Effects\ImageEffects\Shaders\GlobalFog.shader’.

  • Tweaked both the global fog settings (Lighting inspector), and the camera. Essentially, together they control the forward and deferred rendering paths WRT Fog. Bit messy, but it works.

Note: ‘Assets\Standard Assets\Image Effects (Pro Only)_Sources\Shaders\GlobalFog.shader’ appears to be different/stale, even after updating it.

Also, Marmoset support says, ‘All transparent materials have to render in forward mode so really this means forward fog is working, new deferred fog not so much.’ They are looking into it from their end.

  • again, appreciated

the problem with the Fog and defered rendering is that the fog only work on nvidia graphiccards …i have it testet today …on amd (ati) graphiccards it does not work with the standard shader and defered rendering.