- Home /
Is There A Way To Render Fog On Top Of The Skybox?
I was wondering if there was a way I could get the fog to render over top of the sky box? It produces undesirable results when the camera's view distance isn't long enough to capture enough objects to block the horizon.
Answer by tanoshimi · Oct 22, 2016 at 08:49 AM
Yes. If you look at the Hidden/GlobalFog shader you'll see some lines in the ComputeFog function that looks like this:
if (rawDepth >= 0.999999)
fogFac = 1.0;
Simply comment them out/delete them.
I can't seem to find any compute fog method. I was looking in the RenderSettings class but I don't see raw depth either. So I'm not really sure where you're talking about.
Do you think you could point me in the right direction?
Oh, I see. I'm not using the global fog standard asset but I'll give it a try, thanks.
You really should be using the global fog image effect - the old Fog in the Lighting window is the mostly broken pre-5.0 legacy fog which was only left in for backwards compatability.
Could you help me out with that i dont know which fog to use. I use now Assets\Standard Assets\Effects\ImageEffects\Shaders but this has no such line
only : float rawDepth = SA$$anonymous$$PLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoTransformScreenSpaceTex(i.uv_depth)); float dpth = Linear01Depth(rawDepth);
Your answer
Follow this Question
Related Questions
Particle system, no fog. 1 Answer
On Trigger Enter Change Fog 1 Answer
How do I use the Global Fog image effect for deferred rendering in unity 2018+ 1 Answer
Skybox always black on MacOS 0 Answers