- Home /
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.
I'm having the same issue. The only thing in my scene which is working with Fog is using the Legacy Transparent Diffuse Bump shader.
Please bump and perform non-answer activities with comments. Doing otherwise reduces the chances of the question being viewed.
There was a thread about this issue not long ago on the forums, in the shader section I think, but I can't find it right now.
Hi everyone, there was a work-around on my end. Try setting your rendering path to forward. Fog misbehaves when using the deferred rendering path.
This is not an answer, but a temporary solution.
Good Luck
Answer by mikelortega · May 04, 2015 at 04:14 PM
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.
I can't use the Global Fog post FX - adding it to my camera makes the head tracking in VR mode lag nauseatingly.
Answer by Paul_Bronowski · May 05, 2015 at 03:13 AM
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
This is only a post-processing workaround. $$anonymous$$armoset support just tried it and says 'it looks like in the latest build (5.0.1), all deferred fog is broken, even for the built-in Standard and Standard (Specular) shaders. $$anonymous$$armoset shaders are written as surface shaders and in theory should not require any special treatment for built-in fog to just work.
Glad to hear GlobalFog is a suitable work-around for you. I think that is implemented as a post-effect and independent of any rendering modes.'
I'm filing a bug/issue against Unity 5.0.1.
Answer by turritom · Jun 20, 2015 at 05:27 PM
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.