Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Lighting Environment Fog on/off no effect on built.

Discussion in 'General Graphics' started by jo82, Dec 31, 2021.

  1. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    Hi,

    I have this problem where I disable the fog from the lighting environment panel and the fog stays on when I play the built. It can on/off in editor but for some reason it has no effect on built the result is always turned on.

    Any idea?

    I also tried the fog "custom mode" in player setting and no change.

    Thanks and happy new year!
     
  2. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    I should add that even changing the skybox material to none has no effect. It keeps the "sunny 2 skybox" on built.
     
  3. joeld42

    joeld42

    Joined:
    Oct 3, 2016
    Posts:
    22
    It might be missing ShaderVariants for the fog-off version, try making a ShaderVariantCollection (https://docs.unity3d.com/ScriptReference/ShaderVariantCollection.html) , Go under Project Settings -> Graphics, and use the "Save to Asset" under shader loading after playing the game in editor to make sure both the fogged and unfogged shaders have been captured.

    The automatic shader variants can only find shaders that are used in your scene, so if you're toggling shader features at runtime they might not be included.

    Just a guess though, it could be a lot of things.
     
  4. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    Hi and thank you for your help.

    I tried what you wrote and it didn't worked and then what I did was retry the Fog Modes "custom" under graphics settings and clicked on "import from current scene" and now it works.

    Simply changing the fog on/off from the lighting panel doesn't work for me.