- Home /
How do I use the Global Fog image effect for deferred rendering in unity 2018+
OK, so I am using the deferred rendering path because through testing I have found it to be the best solution for performance for my project.
I also want to add simple fog to mask the clipping plane. So I went to lighting and turned on fog. Only that doesn't work. It gives me a warning telling me "Fog has no effect on opaque objects when using Deferred Shading rendering. Use the Global Fog image effect instead, which supports opaque objects."
Sounds great! so I googled that. All the unity manuals for this however are for old versions (Unity 5 etc...) AND the documentation just tells me what it does. It creates fog. Looks great! Except it doesn't explain anywhere how to actually use the thing! It's just like. "Look! this is what fog would look like in your game if you used it. Have fun figuring out where this tool/script/setting is because we won't tell you what it is much less how to find it!"
https://docs.unity3d.com/550/Documentation/Manual/script-GlobalFog.html#:~:text=The%20Global%20Fog%20image%20effect,sophisticated%20effects%20(see%20example).
Further googling took me through trying to find the "Standard Assets Effects package" where the Global Fog Effect theoretically lives. Except it doesn't seem to exist? It was maybe renamed "Post Processing Effects" before vanishing into the ether entirely?
I have wasted so much time on this already so sorry if I come across a little... aggressive. But I really feel like unity is burying the lead on this one. Like... "Add Fog" should be a simple checkbox. Not a 32 step process.
Please? Can anyone walk me through how to actually implement a simple global fog to hide the clipping plane in Unity 2018 when using deferred rendering?
Sooooo... this is not the first question about global fog for deferred rendering that I have seen gone unanswered. Is this some sort of catch 22 issue? Did unity remove global fog while still saying the deferred rendering path can only use the global fog they removed? Because that's what I am starting to suspect...
Answer by Namey5 · May 21, 2021 at 12:00 AM
The Standard Assets package was deprecated a long while ago, along with the Legacy Image Effects which were hosted separately on the asset store (they used to be included with the engine, so in theory you could download an old version of Unity and extract the files from there). There are still versions in circulation on the internet however - here's a link to someone that re-hosted the package on dropbox;
https://www.reddit.com/r/Unity3D/comments/jacohw/where_can_i_download_the_image_effects_standard/g8otoo2/
https://www.dropbox.com/s/6uk1p0sv8z71ncb/Legacy%20Image%20Effects.unitypackage?dl=0
As far as the 'official' solution, Unity just kind of expects everybody to be using the Post-Processing stack now which has deferred fog built in, so if you are looking for the modern way to do that then you should use that package;
https://docs.unity3d.com/Packages/com.unity.postprocessing@3.1/manual/Deferred-Fog.html
Your answer
Follow this Question
Related Questions
New deferred lighting path vs the legacy one 0 Answers
orthographic camera with deferred lighting 2 Answers
Particles not rendering correctly when fog is enabled. 3 Answers
How to increase frame-rate in the game (for iOS) 2 Answers
Turn On Fog In Script? 1 Answer