Search Unity

Bug [FIXED] Why does not appear Local Volumeric Fog?

Discussion in 'High Definition Render Pipeline' started by sergsamixon, Mar 18, 2023.

  1. sergsamixon

    sergsamixon

    Joined:
    Jun 13, 2022
    Posts:
    5

    Attached Files:

    Last edited: Mar 18, 2023
  2. sergsamixon

    sergsamixon

    Joined:
    Jun 13, 2022
    Posts:
    5
    Corresponding 'HDRenderPipelineAsset' properties:
     

    Attached Files:

  3. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    146
    I see your Sky and Fog Volume is disabled in the scene.. For having local volumetric fog volumes, you also need global volumetric fog enabled, so check your scene volume's fog settings.
     
    sergsamixon and Deleted User like this.
  4. sergsamixon

    sergsamixon

    Joined:
    Jun 13, 2022
    Posts:
    5
    'Sky and Fog Global Volume' GO is disabled because I can control the same params by setup in HDRenderPipelineGlobalSettings.asset.

    Unfortunately, enabling Fog and its Volumeric Fog params didn't solve problem. It also look strange that activation Local Volumeric Fog require something from Global Fog.
     
  5. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    146
    That's true. Then you can check Quality Settings, maybe you have selected Low Quality HDRP Asset selected as Editor default, which has volumetric fog disabled? That's just my guess, because I cannot see any global fog in your scene..
    I am not even sure the global fog is required, having volumetric fog enabled in the HDRP Asset is necessary though, so better check all of them..
     
    sergsamixon likes this.
  6. Deleted User

    Deleted User

    Guest

    I am having the same problem. No matter what I do, Local Volumetric Fog will not show up in the Scene or Game views.

    Global/Local Volumes with a Fog override work perfectly fine though.

    Is Unity removing Local Volumetric Fog and replacing it with Global/Local Volumes with a Fog override?
     
  7. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Create a global post process volume in your scene hierarchy, add fog and make sure it's enabled (in the volume, as a post process override), and make sure volumetric fog is enabled there as well.
     
    sergsamixon and Deleted User like this.
  8. Deleted User

    Deleted User

    Guest

    Wow, that was easy. Thank you for the quick reply :)
     
    sergsamixon likes this.
  9. sergsamixon

    sergsamixon

    Joined:
    Jun 13, 2022
    Posts:
    5
    Looks like miracle but this works. =) Thank you very much.
    At the beginning, I didn't understand that a Volume (and therefore Box Collider) components were needed. Then I added them. But it didn't work anyway. Maybe I was tired and didn't notice anything. Because today it works.
    :):):)

    PS. Yes it's not works if Global Fog turned off.

    So question: How to hide Global Fog? Possible how to move it very high o very low?
     

    Attached Files:

    Last edited: Mar 19, 2023
  10. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    No worries!
    By the way I don't believe you need a box collider. All you need is a volume (should be on an empty object in the hierarchy), set it to global and add Fog override. Inside the fog override you can also enable volumetric fog.

    Local volumetric fog just needs "fog and volumetric fog" to be globally enabled, otherwise it will not work.

    See this global volume:


    All that matters in there is "state: enabled" and volumetric fog ticked twice.
    Volumetric fog distance also matters since after that number it will be stop rendering volumetric fog.

    In older version, "state: enabled" might just be a tick box for fog, similar to volumetric fog.
     
    sergsamixon likes this.
  11. sergsamixon

    sergsamixon

    Joined:
    Jun 13, 2022
    Posts:
    5
    OK. It's not problem: I can Set Fog Attenuation Distance at very large number 10000+ and player will not detect Global Fog presents.
     
    ElevenGame likes this.
  12. pablobandinopla

    pablobandinopla

    Joined:
    Jul 2, 2021
    Posts:
    98
    i had a similar issue, in my particular case, it was due to my scene being very high on the Y axis, and the fog component had the fog starting at 0. I had to modify the baseHeight property and increase it to my scene height. Same with maxHeight which obviously has to be baseHeight + some value.
     
  13. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    for any that end up stumbling here for curiosity

    Tiny Properties Cheat Sheet


    The Fog Basics is where you'll be spending a lot of time shaping the lighting of dynamics of the fog, be sure to understand these values and how they form around the scale of your scene as by themselves will really help you control your global fog as well as start expanding that into other volumetric lighting systems like Local Fog volumes too.

    Base Height for example would make sense to set either the Water Level of your project or the Base Level of your Land Mass (excluding any game design choices like an under-the-fog project)

    1. Fog Basics:

    • Fog Attenuation Distance: Density of fog at the base. At this distance, fog absorbs 63% of background light.
    • Base Height: Boundary between constant fog and exponential fog.
    • Maximum Height: Rate of fog falloff. At this height, density reduces by 63%. ( top to bottom fade like a black-to-white gradient at 63% position)
    • Max Fog Distance: Distance for applying fog to the skybox. For "best results", set > Camera's Far Clipping Plane, for physically based, set to scale. Be aware that smaller games and project scales need to update this significantly
    2. Fog Color Options:

    • Colour Mode:
      • Sky Color: Uses colour sampled from sky cubemap.
        • Tint: HDR colour x sky colour.
        • Mip Fog Near: Distance HDRP stops sampling lowest resolution mipmap.
        • Mip Fog Far: Distance HDRP starts sampling the highest resolution mipmap.
        • Mip Fog Max Mip: Maximum mipmap HDRP uses for mip fog.
      • Constant Color: Manually set fog colour.
    3. Volumetric Fog Options:

    • Volumetric Fog: Whether HDRP calculates volumetric fog or not (2023 has enabled states to make the comparison to Global SRP asset and Loval volume override begin)
    • Albedo: Fog colour. Only tints light behind or within the fog.
    • Ambient Light Probe Dimmer: Dim the intensity of the global ambient light probe.
    • Volumetric Fog Distance: Distance where the volumetric fog section ends.
    • Denoising Mode: Denoising technique (None, Reprojection, Gaussian, Both).
    • Slice Distribution Uniformity: Distribution of slices. 0 = exponential, 1 = uniform.
    • Quality: Presets for performance and quality.
      • Fog Control Mode: Control method. Balance = performance-oriented, Manual = direct control.
        • Volumetric Fog Budget: Performance-to-quality ratio. 0 = least intensive, 1 = highest quality.
        • Resolution Depth Ratio: Resource sharing between screen and depth resolutions.
        • Screen Resolution Percentage: Resolution of volumetric buffer relative to the screen.
        • Volume Slice Count: Number of slices for volumetric buffer ( SDF)
    4. Light & Scattering:

    • Directional Lights Only: Process fog only for directional Lights.
    • Anisotropy: Controls angular distribution of scattered light. 0 = isotropic, 1 = forward scattering, -1 = backward scattering. ( anything from 0 costs in volumetric lighting performance)
    Tips:

    1. For a seamless fog, ensure Max Fog Distance > Camera's Far Clipping Plane.
    2. Slice Distribution Uniformity set to 0 provides better fog details near the camera however this has a performance cost so profile for your project.
    3. If you observe unexpected colour behaviour, double-check Albedo and Ambient Light Probe Dimmer settings and use the HDRP render debugger,
    4. For dynamic lighting, consider using Gaussian or Both under Denoising Mode to help reduce Noise updates that may not have been caught if you're using TAA.
    5. Remember, fog is applied within a sphere around the camera, ensuring consistent visuals in every direction, if you need to fill a cube area 1.4x Cube scale.
    6. If you had to imagine volumetric fog, fill a sphere and fade the sides, along with transforming scale and up and down the only other part is opacity for the entire sphere, this covers all Fog Basic functionalities.
     
  14. UnitCubee

    UnitCubee

    Joined:
    Jul 12, 2023
    Posts:
    3
    Can volumetric fog been used in URP?
     
  15. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    URP doesn't implement volumetric fog, you will need to add this feature yourself or use a volumetric fog asset from the store.