- Home /
ignore fog layer
Is there any way to disable fog from certain objects ? I have a scene where fog is enabled but I would like it so my clouds which are a game object don't receive the fog layer. Is there any way to get around this ?
Answer by Eric5h5 · Jan 01, 2012 at 11:21 PM
Use a shader which doesn't have fog. If necessary, you can use an existing shader and include the line "Fog { Mode Off }".
where in the shader code do I put this ? I tried a bunch of different sections but my shader just turns my object pink.
You can put it in the relevant Pass { }. e.g., if you were to use VertexLit as a base,
// Non-lightmapped
Pass {
Tags { "Light$$anonymous$$ode" = "Vertex" }
Fog { $$anonymous$$ode Off }
Answer by Eliot_L · Oct 15, 2015 at 11:59 PM
The method described in @Eric5h5's answer no longer works when applied to the Unity 5+ standard shader. Instead, you need to remove the lines that say:
#pragma multi_compile_fog
I've done this on the standard shader for 5.2.1f1 here: https://gist.github.com/fadookie/ea790779161b974536e7
Your answer
Follow this Question
Related Questions
Foggy Water? 1 Answer
How could I use two lots of fog? 0 Answers
fog masking 1 Answer
What is the best way to create volume fog effect for a space sim without compromising performance ? 0 Answers