Search Unity

Question Remove or reduce fog when walking inside

Discussion in 'High Definition Render Pipeline' started by mrwillt1986, Aug 9, 2023.

  1. mrwillt1986


    Mar 26, 2021
    I have a global volume with fog. When I walk into a building, I want to reduce this fog as much as physically possible. Ideally remove it.

    What would be the best way to go about doing this? Its important the global fog remains in view outside, as players will be looking out of windows, and the fog should be used for "cover".
  2. HIBIKI_entertainment


    Dec 4, 2018

    Newer unity versions ('22 +) have the ability to change from additive behaviour to others like multiply and subtract, but if you're on an older version a workflow could be something like this.

    Older version LFVs are Additive only so you'll typically have to use volumes and LFVs to control the fog that you're in, or looking through/towards.

    You could approach it like this
    - Build your outside looking in LFV as you normally would encompassing the building or however you have this.

    - Create a trigger or some event that switches from a single to a multiple LFV system that shows each facing of the building that when you're approaching or you're in the building.
    These volumes only need to be outside so your internal will be based in globa fog or a separate volume where you has less fog density over all, but typically you'll want LFVs near all windowed walls so when you look out you get the look you want.
    Additionally you can cull these by distance and or frustum to keep performance happy.

    In newer versions you just create two LFVs overlapping with one the bounding of the building and the other however large to give the looking in or out/through depth.

    You then set the 'bounding size' one with some fall off for blending and a larger fog density ( potentially the size of your global one if using) or just tune to liking and set it to subtract multiply.

    Attached Files:

  3. miinoy


    May 27, 2019

    Not OP but Had no idea this was a thing in 2022 LTS! Thank you
  4. Jack_Martison


    Jun 24, 2018
    This is ex-density volume, OP asks about global fog which sometimes not including volumetric fog, and placing Local Volumetric Fog, might be overly expensive on large scale