Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

HDRP Atmospheric Scattering

Discussion in 'Graphics Experimental Previews' started by Zipe92, Oct 8, 2018.

  1. Zipe92

    Zipe92

    Joined:
    Mar 5, 2015
    Posts:
    27
    Hello,

    few days ago I started working with the new HDRP, I'm trying to reproduce the same atmospheric scattering that can be found in the Book of the dead demo (https://blogs.unity3d.com/wp-content/uploads/2018/06/image18-1.gif), but I have not been able to find it in the new HDRP.

    Is it possible to use it in the new HDRP or this feature is not already public yet?

    Thanks in advance.
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Atmospheric Scattering isn't in the main branch of HDRP yet. There's volumetric fog but that won't get you the same result as the Atmospheric Scattering in the demo.
     
    Zipe92 likes this.
  3. Zipe92

    Zipe92

    Joined:
    Mar 5, 2015
    Posts:
    27
    Thank you for the answer, I hope it will come soon
     
  4. lucasmnribeiro

    lucasmnribeiro

    Joined:
    Oct 17, 2018
    Posts:
    3
    I'm trying to somehow import that to my own project for the past 5 hours but I had no success yet. I mean, even if its not a supported feature yet, with their modifications to the default HDRP they managed to use it so i guess that it's possible to replicate that.
     
  5. Zipe92

    Zipe92

    Joined:
    Mar 5, 2015
    Posts:
    27
    I tried quickly to do the same thing, but without success. The HDRP in the demo seems to be heavily modified. I did only a fast experiment, so I cannot tell how much is difficult, it's not one of my priorities now, so I will wait for the official release.
     
  6. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  7. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
  8. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Oh, the code changes were only in HDRenderPipeline.cs for the SRP itself? Well, this makes it easier to maintain at least.
     
    Last edited: Oct 25, 2018
  9. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    148
  10. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    There definitely is Atmospheric Scattering setting on HDRP 4.x.x, and it does work but I have no clue if it's doing the same thing as the one on BOTD or is it some simpler version.
     
  11. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    The word "Atmospheric Scattering" is confusing here in the docs while a complete solution for this is to have both exponential/linear & volumetric fog/lighting at the same time in the scene just as it is in BOD.

    The current system is the same old fog which used to be in Render Settings for years with some minor improvements.
     
  12. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    148
    What could they have used here at 24:46?

     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I use the volumetric system for scattering and it works fine, same as book of the dead. Maybe it's just me but I tweaked the settings and was good to go.
     
  14. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    @hippocoder That's what is meant as a complete Atmospheric Scattering compositing:


    No Fog
    No_Fog.JPG


    Exponential Fog
    Exponential_Fog.JPG


    Volumetric Fog (exaggerated density)
    Volumetric_Fog.JPG


    Exponential + Volumetric Fog (Atmospheric Scattering)
    Exponential+Volumetric_Fog.JPG


    P.S. In the screenshots, the exponential fog is a 3rd party fog effect in Post Processing Stack which gives the ability to be merged with the stock volumetric lighting.

    Now we need stock Exponential & Volumetric Fog types being present alongside each other.
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    They are combined in 4.1. You get height and distance in the volumetric fog... with uncharted 4 style mip. You are asking for what is already provided :p
     
  16. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @TerraUnity just like hippo said, it was combined in 4.1.0
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    In 5, it is gone again. I assume they're still tinkering.
     
  18. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ooh thank fully i haven't jump ship into the alpha yet, my only problem with the current beta is the fbx animation bug. But the rest, it's all great suprisingly.
    And i really love the 4.1 combined Fog
    you can create and eerie scene
    eerie.png
    or a fresh foggy morning
    foggy.png
     
    TerraUnity and Elecman like this.
  19. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,

    Regarding the comment about in 5.0.0 the volumetric + exp is gone.

    Don't be confuse by version number (they are very confusing :p).

    2018.3 binaries is using 4.x.x version and 4.1.0 is the latest out (note: debug material mode are broken in this one)
    2019.1 binaries is using 5.x.x version but there is no relationship of feature, 5.0.0 is older than 4.1.0. I know it is confusing, but it is because Unity give you access to early alpha version that wasn't suppose to be use. So when what is suppose to be the official beta for 2019.1 out, the 2018.3 should have been release, and then you will have start to use latest 5.x.x series... So what is confusing is that now people have access to alpha :). What really matter is what is describe in the changelog rather than version number.

    Note that in 2019.1 realtime reflection are currently no working. This is the problem when we use alpha version, don't know what can happen.

    So currently 5.1.0 for 2019.1 is equivalent to 4.2.0 for 2018.3 and 4.1.0 is a subset of 5.1.0 but more recent than 5.0.0.
    Confuse enough ? :)
     
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hahaha :) yes I'm confused but you can guide us out of the fog...
     
  21. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    @hippocoder @Reanimate_L Thanks for bringing that up. Ok so now it is combined but the volumetric lighting and rays are broken and fog does not take scene depth into account! @SebLagarde

    Current Volumetric Fog in HDRP 4.1.0

    volFog_0.JPG


    Added SunShafts FX as a post processing which was already included in V-Fog itself

    volFog_1.JPG

    Unity version is 2018.3.0b9
     
    imaewyn and jjejj87 like this.
  22. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    @TerraUnity : I know that we missed the [FormerlySerializedAs] attribute for the "Support Volumetrics" and/or "Enable Volumetrics" settings at one moment, and this caused the settings go back to unchecked when updating the HDRP version.
    Have you double checked that they are enabled ?
     
  23. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    @Remy_Unity If you mean the settings in the HDRP asset, yes it is enabled:

    SupportVolumetrics.JPG


    Indeed the vol-fog and 3D textures are present inside density volumes only and not global as it was controllable from Scene Settings before; but even if they are there in volumes, they seem improper and have no lighting and rays involved in them!

    Guess I've seen the same behavior when used HDRP 5.x in a 18.3 version which was not compatible but here the HDRP comes directly from the Package Manager which guarantees compatibility!
     
  24. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    @TerraUnity That's strange. Would you mind sharing a minimal repro-project ?
     
  25. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    @Remy_Unity Seems like the 3D texture were the problem and using it on density volumes seemed broken lighting/shadows; firstly used the texture from your great post HERE but made a new one with a filled cloud shape and rays started to show up, so it is actually working as it should.

    But the volumetric shadow effect and rays are so weak especially after the new blending with the expo fog that's why I was not able to see them at first place after upgrading HDRP to 4.1.

    Our scene is a bit complex because players can travel the scene from both on ground and while flying, so setting the right parameters for a global atmospheric scattering is challenging, where we have areal perspective fog at far distances by using expo fog and volumetric lighting and fog scattered with density volumes with 3D textures blending around the character at the same time.

    For this purpose I could edit the "volumetricDimmer" range in line 112 of the "HDAdditionalLightData.cs" to be more than 1 in order to exaggerate the volumetric shadows and rays in directional light's settings; this gives us the ability to have more shadowing on volumetric fog going on while having lower density volumes. Do you have any plans to officially support more than this range?
     
  26. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    Nice to see someone is taking care about important stuff. Does your port work with Unity 2018.3 ?
     
  27. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    The port only works on the specified version of HDRP since it involves adding code to the pipeline itslef. You should try version 4.9.0. I think most of the atmospherics if not all have been properly integrated by unoty themsleves at this poimt.
     
  28. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    Is there any uncomplicated functial version of atmospheric scattering with light shafts, that runs under Unity 2018.3 ?
     
    Flurgle likes this.