Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Fog that doesn't affect procedural skyboxes?

Discussion in 'Editor & General Support' started by miklelottesen, Feb 17, 2018.

  1. miklelottesen

    miklelottesen

    Joined:
    Mar 7, 2015
    Posts:
    19
    I'm making a 3D game where I need the fog to change color based on the player's position on the map. I've implemented that just fine, but my problem is that the procedural skybox gets affected as I hit Play, turning into the same color as the fog.

    I've tried using the built-in fog system from the lighting panel, and I've tried disabling that and using the Global Fog script on my camera instead. The latter approach didn't turn the skybox into the fog color, but it did darken the skybox colors significantly.

    The fog-script that I made also executes in edit mode, where it works perfectly; changing the fog without affecting the skybox. The problem only happens during Play mode. Also, if I set a fog color and density but disable my script, then hit play, the fog works as it should, without affecting the sky.

    Anyone knows how I can make the procedural skybox completely independent of fog?