Unity 5 Global Fog issue. Can't get it to show up above the terrain / in front of the skybox?

Images for reference: Global Fog Issue - Album on Imgur

I’ve tweaked just about every setting possible between the fog settings and the global fog effect. Am I missing something basic here? I’m new to unity so please let me know if I’m missing something stupid haha.

I just want the fog to extend above the character’s head and cover up the skybox so that it looks like the snow in my scene is coming out of a haze of fog / low cloud. Like this:

Thanks!

To clarify:

I’m not trying to apply the fog to the skybox directly, I’m trying to create a global fog effect on the player camera so that the fog appears in a sphere around that camera. You can see the effect working in this link:

Notice how he is able to apply the fog in a sphere that occludes the skybox. Is this effect just broken in unity 5?

Anybody? Is this just broken in Unity 5?

Bah just realized that this forum wasn’t keeping my youtube time stamps in place. The place to get a good look at what I want is around the 4 mins 5 seconds mark onward in the video in the first two posts.

Update: I just tested it with the default and a few other skyboxes and have the same result. Here’s a video I just recorded of how the height / global fog wont go over my skybox and creates an ugly look:

In the video I’m adjusting the global fog height, and height density settings.

So I guess my real issue isnt that global fog doesnt work, but that rather it wont show up in front of the skybox.

Any ideas?

YESSSSSSS found a solution via reddit / here: Reddit - Dive into anything

Solution:

Indeed, the fog works as it should by the video
Go in the GlobalFog.shader and find the line “// Do not fog skybox”
Remove the height check there or play with its value to see if you can get the effect you want

YOU ARE A GOD!
commenting out / removing these lines did the trick:
//if (rawDepth >= 0.999999)
// fogFac = 1.0;

Thanks so much!

Ok new problem :slight_smile:

Just ran into another issue with this shader regarding particle effects. Any idea how to get the fog to apply the proper value on top of the particle effect? Tried searching the shader for ‘particle’, ‘effect’, etc with no luck. Thanks!

Image: Imgur: The magic of the Internet

I was having the same issue, and also another in which the SpeedTree billboards that have nothing but the skybox behind them are not affected by Global Fog whatsoever. They pop in and out very badly as a result. Any thoughts?

EDIT:
I forgot to include that it is very similar to the problem in this other thread, but using the default Unity SpeedTree shaders Billboard trees not showing fog. - Unity Engine - Unity Discussions