Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Volumetric Fog for URP (Forward+)

Discussion in 'Assets and Asset Store' started by LanguageDic, Nov 17, 2023.

  1. LanguageDic

    LanguageDic

    Joined:
    May 21, 2021
    Posts:
    1
    Hi community,
    I made a volumetric fog package for URP, specially designed for forward+ rendering considering performance. It's basically copied HDRP code to work for URP.

    It includes exponential height fog, and volumetric lighting as HDRP fog behaves.
    Note that while fog in HDRP requires local volumes to show volumetric lighting, you don't need to place any local volumes unless you want ground smoke volume in this package. The volumetric lighting for local lights is only working for forward+.

    One of the main differences between this package and HDRP fog is while HDRP can specify the volumetric lighting intensity for each light, URP lights do not have that property. So I created a new parameter 'localScatteringIntensity' to control the scattering intensity for all local lights(= point, spot). There's no option to control only the local light volumetric scattering intensity unless you change the intensity of each light.

    Tooltips might not be sufficient yet though, the algorithm follows HDRP fog properties so if you know how to use and customize HDRP fog settings then it would not be an issue.

    Limitations
    1. XR not supported
    2. Additional Directional & Local(point & spot) lights are only available in Forward+
    3. DiffuseGI does not contribute to lighting
    4. Noise texture is not supported
    5. The number of LocalSmokeVolume is 4 at maximum.
    6. Volumetric lighting is only enabled in a scene view in edit mode. If playing, only enabled in a game view.
    You can download the package here.

    Please feel free to give me any feedback.
     
    Trigve and CodeSmile like this.
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,108
    Just found this by accident, looking for how to simulate fog with URP. The package looks nice enough to give it a try ... but not without a LICENSE. This means the repository is restricted content and it would be illegal to use it in any form without your express permission.

    Please add a LICENSE file of your choice to the repository if you wish others to use it.
    Personally I would recommend MIT License, it's unrestrictive and has a disclaimer that you cannot be held liable for anything.