Search Unity

Question Local Fog Volume color

Discussion in 'High Definition Render Pipeline' started by dgoyette, Jan 30, 2024.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I want to have some areas darked with a Local Fog Volume, so that players can see the darkened region from a distance. For example, here's a Local Fog Volume:

    upload_2024-1-30_14-42-15.png

    The issue is, I can only get it to be tinted black, never any other color, unless I allow some serious drawbacks.

    I tried using "Single Scattering Albedo" color on the Local Fog Volume. This applies if either 1) A Volumetric Light hits the fog, or 2) The Fog Volume is inside some kind of "Sky". The problem with the second option (using a Sky to allow the "Single Scattering Albedo" to work) is that either I need to apply that sky globally (and I only want it applied inside the Fog volume), or I apply the sky only to the Fog Volume, in which case it only has color when I'm inside of the fog volume. Looking at it from the outside, it's pure black.

    I tried messing around with various other Fog options, but I haven't found a solution that let's me drop a tinted Fog Volume into a scene, without affecting the rest of the scene.

    Any ideas on this?
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    So far the only approach I've found that seems half-way reasonable is to use a Directional light with Volumetric lighting enabled. Interestingly, I can set the Light Layer to some unused layer, which means the directional light won't affect any other geometry, just my fog volume. This isn't great, as it means I need to enable Volumetric Lights, so I'll have to make sure this isn't a big performance issue just to get the fog to be visible. But it's something.

    Ideally the fog volume itself would have some kind of independent radiance. I get that that's not physical accurate, but it seems very typical to me for games to have fog be different colors.