Search Unity

Feedback Volumetric Clouds

Discussion in 'High Definition Render Pipeline' started by SebLazyWizard, Mar 20, 2021.

  1. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Here's a GIF showing the improvements @auzaiffe made to the sunlight sampling. Now the lighting is more exact for those low sun scenarios. It's quite impressive on very large clouds, like cumulonimbus.

    sunset.gif
     
    OCASM, ArchVizPRO, NotaNaN and 12 others like this.
  2. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Can you share the post processing volume settings you used for these screen captures?
    It does look pretty good :eek:
     
  3. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    In the latest Unity beta it looks like this:
    upload_2021-8-15_10-58-6.png
    Maybe something was changed in the latest github or I am missing simething?
     
    Ruchir likes this.
  4. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, why are you offsetting the center of the earth on the X-axis?

    By default, the Y axis in Unity indicates the "altitude".

    upload_2021-8-16_14-9-9.png

    So the center of the earth must be underneath the origin of your level (which should be the sea level, if you want to keep things easily under control). That's why the center of the Earth is at 0, -6..., 0.

    There will be eventually improvements to how this is set (similarly to how the "Global wind" parameters are now set in the Visual Environment), to improve the consistency between all these systems that rely on a specific planet size and certain altitudes. In the meantime, don't offset things without a very good reason. ;)
     
    Ruchir likes this.
  5. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    This looks super awesome, but makes me jealous now that Unity doesn't have a proper gizmo for light direction like UE has.
     
    Gokcan and Ruchir like this.
  6. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    https://github.com/Unity-Technologies/Graphics/pull/5354
     
    Ruchir, LumaPxxx and Rowlan like this.
  7. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Maybe it's too early and too greedy to ask it for now...

    Could we have the second layer control of the shape noise and erosion noise?
    Or better one: two layers of density curve control and erosion curve control we can randomly blend them.

    for now it's so easy to notice the clouds are loops as there is no second layer noise to reduce it.

    i can so easily make loop gifs with these clouds....:D


    GIF 2021-8-17 1-25-56.gif

    GIF 2021-8-17 1-27-32.gif

    2W{2SIODUJHNJA}P6(R~N}1.png
     
    PutridEx, AydinDeveloper and Ruchir like this.
  8. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    That would be really good, water shader are a good example for this as well :)
     
    LumaPxxx likes this.
  9. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    With the vertical wind we've introduced recently (available in the Master branch of the github repo), you shouldn't need that, as you not only get X-Z movements in the shape noise, but also Y movement. Now, if the horizontal and vertical speeds aren't the same, it will take a very, very long time for the clouds to "loop". Try numbers that aren't factors of one another to reduce the frequency.

    If then, on top of this, you blend in randomly a volume that slightly alters the shape factor and the altitude of the cloud volume, you can do endless cloudscapes that will never repeat.

    The thing is, timelapse with ultra-fast clouds are fun, but in general, during gameplay or normal scenarios, the clouds will be fairly slow, so seeing a repetition after 30min is really not the end of the world for many types of projects. With the vertical wind we've added, you can probably go for many hours without seeing a repetition.

    And with the (pending) change that massively reduces ghosting, you can now have clouds that move many times faster than the speed of sound without any ghosting.;)

    (I'm talking about "scrolling clouds repetition", not "high altitude visible tiling")
     
    LumaPxxx, Ruchir and ElevenGame like this.
  10. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Does it handle transition between cloud types well enough or it's just the motion of camera/clouds part?

    Because currently volume system doesn't really support interpolation between animation curves causing abrupt changes instead of smooth transition when having different density curve (which could be done by simply interpolating between the values evaluated by all the curves at a point) or even the default presets, with the default presets I think many people will expect smooth transition when moving between volumes (sparse to cloudy or stormy, etc)
     
  11. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I have a question, How is the point for sampling cloud-HDRI (the non-local mode) determined?
    Because moving camera doesn't really affect it at all (in y-direction or any other direction)
     
  12. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    One more thing that stood out to me was how would you add support for something like Depth of field or any other effect relying on depth information?
     
  13. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    upload_2021-8-17_10-33-40.png
    Soon in a PR, no new noise needed.
     
    NotaNaN, LumaPxxx, PutridEx and 5 others like this.
  14. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    How did you achieve this though?
    Something like Stochastic sampling? :eek:
     
    Deleted User likes this.
  15. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    positionPS.y += (positionPS.x / 3.0f + positionPS.z / 7.0f);
    such simple touch:D
     
    Ruchir likes this.
  16. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Some irrational ratio might have been better though :rolleyes:
     
  17. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Using an irrational ratio doesn't change much given the low resolution of the noise texture.
     
    Ruchir likes this.
  18. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Hey, I know. I am making a space simulator (https://store.steampowered.com/app/890520/How_do_you_like_it_Elon_Musk/) and Earth (so its planet center and its atmosphere) could have any offset. Because you could fly to the planet from any direction and side (and I am using a floating origin).

    Atmosphere is supporting this why not clouds? Is this very hard to add?

    I have a feeling, that if this feature will not be added now, it will never be implemented. Like PBS devs promised to implemented a PBS atmospheric scattering "later", and two years later we still don't have it.

    So please, please, please, at least consider adding this parameter to the clouds system.
     
    Last edited: Aug 17, 2021
  19. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I guess they are just focused on getting the visuals and technical things correct at this point.
    I don't think that it's very hard to implement those things so maybe after a couple of iteration they will focus on QOL stuff.
     
  20. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    It maybe true, but everthing that will not get into Clouds system before the 2021.2 beta ends, will appear only in 2022.2. This is more than year and a half of waiting for no reason (if it is not that complicated to implement.) Also it is not just a QoL feature. Without planet center parameter Clouds simply will not work for a space sims.
     
  21. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    This may be of use then

     
  22. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    What about 2022.1?
     
    Ruchir likes this.
  23. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I guess he was talking about something close to an LTS version
     
    iamarugin likes this.
  24. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    Oh I see, thanks.

    Are you sure that there is no PBS atmospheric scattering implemented? Documentation says it uses Bruneton, Eric, and Fabrice Neyret. 2008 - “Precomputed Atmospheric Scattering.”

    Or maybe you are talking about 'space' point of view and not just planet/ground perspective.
     
  25. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Btw, one thing that just stood out to me was that if someone going after a particular cloud profile (I'm talking about height based cloud shapes), then it would be impossible after the fix proposed here:
    This will be good enough in most cases where devs aren't going for a specific look, but say they want Thicker clouds always at higher level and small clouds near the surface then we would be able to see visible patterns with this implementation (more visible when shape scale would be tweaked given the coefficients aren't really dependent on scale somehow) and also, it won't be consistent with what was initially intended. (most of the stylized scenarios will have some kind of problem with this I think)

    Although, If adding second noise could cost significant performance then you could provide it as an optional feature alongside the current fix(as it would solve most of the simple cases) just like we have option for two cloud layer in the 2D cloud layer or the noise option in custom mode. :)

    Also, Some people may want the pattern to be loopable (for creating GIFs :p) so you should make these fixes optional as well
     
    Last edited: Aug 18, 2021
    LumaPxxx likes this.
  26. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Yes, I am sure. It is calculated for the sky, but it is not applied to opaque/transparent geometry in the scene during the fog pass.
     
    sqallpl and Ruchir like this.
  27. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    We really need some fixes for PBS sky.
    • It not being optimized for dynamic time-of day cycle, I tested it with moving sun and the performance was pretty bad. ( I always use OnChanged update mode)
    • The sunset scenario looks pretty bad (angle between -5 and -11 degrees)
    • Height based fog doesn't really have spherical mode, which also is quite visible when zooming for a full view of volumetric clouds.
    • In general we don't have spherical fog (even volumetric fog don't have a spherical shape and blending option in local fog doesn't approximate spherical shape at such a scale)
    But we don't have anyone currently working on these systems like we have for volumetric clouds unfortunately.:(
     
  28. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    What I was suggesting was this:
    Code (CSharp):
    1.  
    2.     // We reduce the top-view repetition of the pattern
    3.     const piInv = 1/Mathf.Pie; //I don't know math library for compute shader :P
    4.     positionPS.y += (positionPS.x * piInv + positionPS.z);
    This would reduce no. of math operations and future proof this for any resolution and scale :p
     
  29. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Totally agree. And I am afraid that the development of clouds will be stopped in the same way after 2021.2. That's why I am pushing adding the planet center to clouds in this release.
     
  30. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Agree.
    second noise layer is important.

    for now, the shape noise is used for the huge basic shape,
    so you can not set the erosion noise too small as you need it to give cloud more mid sized detail.
    or the basic shape of clouds will look like cartoon.
    then you lost the ability to add small detail so the clouds will look blur.

    To me,all pics showed by Unity team lack mid sized detail,
    as they are using erosion noise for more smaller detail.

    But it's personal art feeling, i can not talk it in a convinced way.
     
    Ruchir likes this.
  31. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Unreal engine's volumetric cloud do give us a reasonable goal given they look particularly good and honestly they really match real world clouds, even the wispy upper layer clouds for which Unity currently recommends 2D cloud layer which as mentioned in a previous post just aren't good (at all)
    upload_2021-8-18_22-47-31.png
    The sky in this image really look so much better than Unity's implementation somehow :eek:(maybe post-processing difference):
    upload_2021-8-18_22-47-48.png

    Also, This part is really crucial for large project and small teams also tbh (I think so at least, given this would be system in unity for quite a few years from now on):
    upload_2021-8-18_22-49-23.png

    I really hope they are to implement these features in this release cycle otherwise it would become like all the other HDRP features which have just the most annoying limitation in place forcing me to change quite a bit of source code and stopping me from upgrading main project to newer versions.
     
  32. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    From what I saw Unreal also implements two sets of shape and noise layer:
    upload_2021-8-18_23-5-51.png

    Also, they seem to have implemented sun halo, it give really good rainbow effect in sun/moonlight through the upper cloud layers.

    FogVolume3 from Asset store also implements sun halo.
     
    Last edited: Aug 18, 2021
  33. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Maybe unity needs something like this:
    :p
    upload_2021-8-18_23-9-3.png

    (They support multiple planets too, which I can't imagine having currently in unity considering how it's set-up and volumetric cloud system is also not going to support that if I'm correct)
     
    LumaPxxx likes this.
  34. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Are there any more updates planned for this @pierred_unity , because I didn't find any pull requests for volumetric clouds either and now the focus seems to have shifted towards HDRP 13 (unity 2022.1).
    Things like more quality settings (full res option and such) as well as planet center/radius options are still not implemented currently :(.

    Also, some feedback from my side would be to make Tilling and offset a vector3 instead of vector2. :)
     
    Deleted User likes this.
  35. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    RIP planet center position
     
    Ruchir likes this.
  36. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, we were on more-than-needed holidays, so there haven't been any updates recently.

    Like said several times in this thread, the volumetric clouds in HDRP 12 support mostly "under or inside clouds" scenarios. And initially, only "under clouds" scenarios were actually in focus, but we greatly improved the situation for "inside clouds" scenarios too, after the feedback we received in this thread.

    The global control for the planet center will be done at a later time, as well as higher quality settings and even more flexibility for setting up independent layers of clouds. We haven't forgotten about these. I think we have a pretty good track record for listening to your feedback, so there is no need to "RIP". :)
     
    NotaNaN, teutonicus, LumaPxxx and 8 others like this.
  37. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    I'd really love if you'd guys give focus on this nontheless. It does look quite good

    irval clouds.jpg
    Problems I noticed: There's grain and motion drag when the dragon is flying, but I guess that would be solvable. I also noticed that when you move along, then the cloud shape disappears with hard edges instead of fade.

    Example: Check the wings. Left one has the motion drag, right one has some grain.

    example.jpg

    Other not so high use cases would be eg mountain fog.
     
    m0nsky, Ruchir and Lex4art like this.
  38. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I have a suggestion for inside rendering of volumetric clouds, like for close-up scene in RDR2 where we are inside the cloud, (I don't know if this could be viable) could you somehow feed the density data from volumetric clouds to local volumetric fog system? (It could handle small scale volumetric scattering quite effectively compared to volumetric clouds) (but you would need to add support for low resolution volumetric lighting if we want things like storm scenes or maybe UFOs ;))
     
  39. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Do the volumetric clouds move correctly in scenes with floating origin for large distance worlds?
     
    LumaPxxx likes this.
  40. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    Here's a vid to show the effect I meant in the post above. Is there some way to

    * fade the cloud edges instead of having a hard cut?
    * not have the clouds disappear in front of an obvious clipping plane. I tried using camera near clip adjustment, but that didn't help

     
  41. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    These things are already addressed in the latest HDRP version. :)

    You have option for density fall-off and also Ghosting reduction(which works quite well honestly):
    upload_2021-9-7_11-16-54.png
     
    DrSeltsam likes this.
  42. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    One thing I'd like to add: This should be the end goal. Or rather a milestone.

    @Fewes correct me please, but you made this in Unity afaik

     
    Lex4art, m0nsky and Ruchir like this.
  43. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    Thank you. Do you have steps about how to install that? I have to try :D
     
  44. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Try adding these packages from git(in the same order) using package manager:
    Code (CSharp):
    1. https://github.com/Unity-Technologies/Graphics.git?path=/com.unity.render-pipelines.core
    2.  
    3. https://github.com/Unity-Technologies/Graphics.git?path=/com.unity.shadergraph
    4.  
    5. https://github.com/Unity-Technologies/Graphics.git?path=/com.unity.visualeffectgraph
    6.  
    7. https://github.com/Unity-Technologies/Graphics.git?path=/com.unity.render-pipelines.high-definition-config
    8.  
    9. https://github.com/Unity-Technologies/Graphics.git?path=/com.unity.render-pipelines.high-definition
    upload_2021-9-7_11-29-7.png

    Note: since development of main graphics branch moved to HDRP 13 now, you would need 2022.1 alpha to to get packages using this method or else manually find the last revision on git that was on HDRP 12.
     
    DrSeltsam, PutridEx and Rowlan like this.
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    Thank you very much, that helped! :) There's so many settings to toy around with :D

    ic2.jpg
    ic1.jpg
     
    Thermos, Lex4art, Ruchir and 4 others like this.
  46. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Should help with the issue
    https://github.com/Unity-Technologies/Graphics/pull/5556
     
    m0nsky, Ruchir, teutonicus and 2 others like this.
  47. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
  48. DrSeltsam

    DrSeltsam

    Joined:
    Jul 24, 2019
    Posts:
    101
    I love the volumetric clouds, the current implementation is really impressive so far, great job! :)

    But I'm running into the same issue @SebLazyWizard mentioned in his initial posts: Clouds are only affected by one directional light. This makes it almost impossible to create a proper day-night-cycle (which is needed in so many types of games nowadays).
    I understand that changing HDRP's "unique sun" approach certainly involves some work, but Unreals Volumetric Cloud system explicitly supports 2 directional lights (which covers almost all use-cases out there, either sun+moon or 2 suns), so it would be a pity if Unity decides to stick to a single directional light only... :(

    Are there any plans to have at least up to 2 directional lights affecting the clouds?
     
  49. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    Sometimes you really wish Unity would finally implement that play mode settings won't get lost after you exit play mode while toying around in it :)

    crest clouds.jpg

     
    Last edited: Sep 8, 2021
    m0nsky likes this.
  50. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136

    Realism aside, look at that. The github version is miles ahead of the latest 2022 alpha, looks much better.
    Few Issues though. First is, how do I get volumetric clouds to work on scene's camera? It doesn't render in scene, only in game view.

    Second is, how would I get godrays? Frankly I'm not sure if shadows are working at all. Maybe it's just a problem with the github version.