- Home /
Stop a GameObject being affected by fog unity 5
Hi, is it posible?
I've tried This with no luck .. Thanks.
I'm using this shader ..
But is there a way to use a layer because I'd also like to use the Unity 5 standard shader on some GameObjects that I'd like to see through the fog and some I wouldn't want to see, so a layer would be the best solution?
Depends on the shader you are using. You could also set the object's material queue to 3000.
Edited my post to include the shader ....
But is there a way to use a layer because I'd also like to use the Unity 5 standard shader on some GameObjects that I'd like to see through the fog and some I wouldn't want to see, so a layer would be the best solution?
Please post the uncompiled shader. The two suggestions that first come to $$anonymous$$d are disable writing to the depth buffer, or render the unfogged object with a separate camera.
Well, because you are using one of the built in shaders, you could do one of the following;
Download the original shader from the Unity archive, and modify that not to render fog. Then simply use that substitute shader on the objects you don't want to render with fog.
Like I said earlier, changing the material queue may also do it. From memory, the transparent queue overrides fog, so what you can do is run the Editor in debug mode (right click the inspector tab>Debug), select the material and change the queue to 3000.
Is it possible to change the material your using to an fx or a particle for the specific object?
Your answer
![](https://koobas.hobune.stream/wayback/20220612085701im_/https://answers.unity.com/themes/thub/images/avi.jpg)