Search Unity

Feedback Volumetric Clouds

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

  1. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    The HDRP Tests project within the github repo does have a couple of scenes that use the volumetric clouds and those work for me. I have not been successful at getting it working in my own project/scenes yet despite switching on many options, but I didnt previously post about my failure to get it working because I need to spend more time trying first.

    https://github.com/Unity-Technologi...Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog
     
    id0 likes this.
  2. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
    It's a little cumbersome to make them finally appear, as you have to enable them in 3 places.
    You have to enable them in your hdrp asset, then in the default frame setting in the lighting sub-section and then you finally have to add them to your volume overrides and enable them there too.
    https://github.com/Unity-Technologi...lumetric-Clouds.md#enabling-volumetric-clouds

    Also increase the far clipping plane distance on your game/scene camera to atleast a couple of kilometers in order to properly see them.

    If you still can't see them after all those steps, then it's likely a hardware/driver specific issue.
     
    Cyril_m and elbows like this.
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Yeah I reckon thats the one I was missing when I failed previously, because I forgot to change the 'Default Frame Settings For' dropdown to 'camera' when searching for all the places that had the Volumetric Clouds tickbox. When I first got this working a short time ago its because I basically achieved the same thing by different means - I ticked Custom Frame Settings on the Main Camera and then ticked Volumetric Clouds there.
     
  4. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Just download and run HDRP Tests. No clouds at all. Everything else is working.

    P.S. Switch on Vulkan and clouds appear. Switch back on dx11 - no clouds. I'm on geForce 1650.
     
    Last edited: Mar 29, 2021
  5. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    @pierred_unity still interested if there is a chance that planet position / radius parameters will be implemented for clouds system so it will be consistent with the PBR sky?
     
    Ruchir likes this.
  6. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, there is a cloud Earth curvature parameter. Set it to 1 iirc to get the clouds to follow the Earth's curvature.

    There will be improvements eventually to have more centralized settings for all these settings, but in the meantime, it's easy to simulate the Earth itself, or smaller worlds.
     
  7. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    So, if I will set Earth curvature parameter to 1, but will change planet position parameter in the PBR sky, clk
    So, I set planet center position in the PBR sky to Vector3(-6378100,0,0)

    This is what I get

    upload_2021-3-31_16-1-38.png

    Why I set planet center position to this value? Because in the space simulators you can fly to the side of the planet. And as I can see currently clouds support only flat world case.

    @pierred_unity so we should not expect, that this case will be implemented?
     
  8. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Also I set earth curvature to 1 and just zoomed out the camera and this is what I get:

    upload_2021-3-31_16-5-50.png

    As you can see atmosphere doesn't match with the clouds.

    @SebLagarde is this and not respecting PBR sky planet center position expected behavior?
     
  9. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    The PBR sky unit for the center of the Earth is kilometers iirc. This explains the big difference. By default (no override on the PBR sky at all), the curvature of the Earth and the clouds should match perfectly.

    Also, don't forget the system is not necessarily tuned for space scenarios. See it as a Horizon Zero Dawn or RDR2 equivalent, at least for now.

    Regarding the "sideway" Earth, that's something we could add in the future if we support these out-of-space scenarios properly.
     
    Last edited: Mar 31, 2021
    Ruchir and chap-unity like this.
  10. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
    No you have to set it to 0 to match the planet's curvature, anything above that will make the cloud sphere smaller than the planet.
     
    pierred_unity likes this.
  11. BATTLEKOT

    BATTLEKOT

    Joined:
    Oct 2, 2016
    Posts:
    179
    sound strange, have you tried to take a look render features in camera and HDRP Wizzard?
     
  12. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I don't know if it's a technical limitation, an artistic choice, or sensible performance settings in the examples I've seen, but the clouds do look a bit featureless and low-res to me compared to other solutions out there:




    (source)

    I think a lot of people will be wanting that amazing fluffy 3D cauliflower cloud look. But then again, I also have no idea how the cloud system from the gifs above performs so maybe it's not a fair comparison
     
    Last edited: Apr 2, 2021
  13. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
  14. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    But right now unity really glitches out when zooming out far enough for us to see some curvature of the planet
     
  15. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    What you shared takes 6ms on a high end pc with a Titan xp gpu, whereas the current solution in Unity takes only 2ms on a base PS4 (and by some rough extrapolations, that would probably be way under 1ms with a Titan xp).

    The focus has been on providing a solution similar to console AAA games for now. There will be some improvements to the quality in future updates. Step by step.
     
    Last edited: Apr 3, 2021
  16. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I gotta say, 2ms on base PS4 does sound excellent to me. I think having something like this is better for most cases than having "MS Flight Simulator"-quality clouds but having your game run like a slideshow
     
    SuperRaffles and NotaNaN like this.
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @pierred_unity in advanced mode, the Cumulus, Alto Stratus, and Cumulonimbus settings seems cannot be used together, only one of them can be applied. Is this intended?
     
  18. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
    I have some troubles authoring my clouds using the manual mode.
    The red channel in the cloud map is supposed to define the coverage of the clouds, but it just changes the density of those (e.g. a value close to 0 makes the clouds appear like thin fog).

    I would rather think that the density should be defined in the clouds LUT map, as this is the place where all cloud-type specific parameters are in.
    This would allow to set the density for each cloud type in the LUT directly.

    Currently I'm stuck to the cloud map's red channel in order to add density variation, but this has a major drawback since it applies the same density to all clouds at a given position (horizontal), so vertical density variation is impossible to achieve.

    As you can see in the picture below, I've set up some types of cumulus and stratus clouds which have their own specific density, but due to the fact that I can't control the density depending on height, I had to remove other cloud-types above or below. This leaves ugly gaps in the cloud layers;
    screen_1920x1080_2021-04-10_05-04-12.jpg

    I hope there will be a solution to this in the near future.
     
    Last edited: Apr 10, 2021
  19. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
    Ok, I fixed it myself in VolumetricClouds.compute by changing it's code to this;
    (starting from line 404, changes are marked with //MOD)
    Code (CSharp):
    1.     // Adjust the shape and erosion factor based on the LUT and the coverage
    2. //MOD start
    3.     //shapeFactor = lerp(0, shapeFactor * densityErosionAO.y, cloudCoverageData.coverage.x);
    4.     //erosionFactor = lerp(0, erosionFactor * densityErosionAO.y, cloudCoverageData.coverage.x);
    5.     float densityFactor = densityErosionAO.y * densityErosionAO.y;
    6.     shapeFactor *= densityFactor;
    7.     erosionFactor *= densityFactor;
    8. //MOD end
    9.  
    10.     // Combine with the low frequency noise, we want less shaping for large clouds
    11.     lowFrequencyNoise = lerp(1.0, lowFrequencyNoise, shapeFactor);
    12.     float base_cloud = 1.0 - densityErosionAO.x * cloudCoverageData.coverage.x * (1.0 - shapeFactor);
    13. //MOD start
    14.     //base_cloud = saturate(remap(lowFrequencyNoise, base_cloud, 1.0, 0.0, 1.0)) * cloudCoverageData.coverage.y;
    15.     base_cloud = saturate(remap(lowFrequencyNoise, base_cloud, 1.0, 0.0, 1.0)) * densityFactor;
    16. //MOD end
    17.     // Weight the ambient occlusion's contribution
    18.     properties.ambientOcclusion = densityErosionAO.z;
    19.  
    20.     // Change the sigma based on the rain cloud data
    21.     properties.sigmaT = lerp(0.04, 0.12, cloudCoverageData.rainClouds);
    22.  
    23.     // The ambient occlusion value that is baked is less relevant if there is shaping or erosion, small hack to compensate that
    24.     float ambientOcclusionBlend = saturate(1.0 - max(erosionFactor, shapeFactor) * 0.5);
    25.     properties.ambientOcclusion = lerp(1.0, properties.ambientOcclusion, ambientOcclusionBlend);
    26.  
    27.     // Apply the erosion for nifer details
    28.     if (!cheapVersion)
    29.     {
    30.         float3 fineNoiseSamplingCoordinates = AnimateFineNoisePosition(positionWS) / NOISE_TEXTURE_NORMALIZATION_FACTOR * EROSION_SCALE_FACTOR * _ErosionScale;
    31.         float highFrequencyNoise = SAMPLE_TEXTURE3D_LOD(_Worley32RGB, s_linear_repeat_sampler, fineNoiseSamplingCoordinates, CLOUD_DETAIL_MIP_OFFSET + erosionMipOffset).x;
    32.  
    33.         // Compute the weight of the low frequency noise
    34. //MOD start
    35.         //highFrequencyNoise = lerp(0.0, highFrequencyNoise, erosionFactor * 0.75f * cloudCoverageData.coverage.x);
    36.         highFrequencyNoise = lerp(0.0, highFrequencyNoise, erosionFactor * 0.75f * densityErosionAO.y);
    37. //MOD end
    38.         base_cloud = remap(base_cloud, highFrequencyNoise, 1.0, 0.0, 1.0);
    39.     }
    The red channel in the cloud map now only controls the coverage, just like the red channel in the LUT map does.
    The green channel in the LUT map now also controls the clouds density (this may was the intended behavior anyway but someone skipped it), so density variation is now possible at any horizontal or vertical position.
    screen_1920x1080_2021-04-10_22-12-33.jpg
     
    Last edited: Apr 10, 2021
  20. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Thank you. We'll look into it. iirc, the logic has been tuned for the Advanced mode mostly (for altostratus, cumulonimbus, etc.) to avoid artifacts around the clouds when multiple types try to blend together.

    For the "Manual" mode, it seems your method is better. We'll have to see how the erosion gets affected though.

    So this means we'd have 2 logics, 1 for Advanced (to prevent overlap, as designed), and 1 for manual that allows for overlap. Or we just keep 1 new updated logics for both Advanced/Manual. We'll investigate.

    No ETA for this change to land, but we'll certainly look into it. Thanks again!
     
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    also can we get separate tilling and offset settings for each cloud type? having one parameter to affect all of them kinda limited
     
    Deleted User likes this.
  22. Ciderhelm

    Ciderhelm

    Joined:
    Apr 25, 2017
    Posts:
    7
    Really enjoying this! Couple callouts:
    1. With volumetric cloud shadows enabled, there's a hard edge showing on the ground plane (image attached).
    2. Additive VFX graph particles are not affected by the clouds (maybe more) -- It'd be good to know if this is a technical limitation.
    +1 to point light support, +1 to "fly through" and "fly above" improvements. But this is already looking great!
     

    Attached Files:

    Ruchir likes this.
  23. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    37
    For those of us working on Technical Animations or interactive products that do not require VR framerates, we would love to see much higher quality clouds like overcloud or simul truesky. Blobby looking clouds are far too gamey for archviz or realism work.
     
    PutridEx and Ruchir like this.
  24. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    The cloud in unigine 2.14 looks good, hope unity could catch up them soon.

     
    andreyefimov2010 and Ruchir like this.
  25. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Hey, the hard edge is just a parameter you can control, to reduce costs shadows are only showed up until a certain distance and then a fallback value is just used. You can set those in the advanced parameters (by clicking on the 3 vertical dots in the override and showing advanced parameters)
     

    Attached Files:

    Ciderhelm likes this.
  26. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    They aren't really affected by transparency either afaik (You can see this in the HDRP template where the butterflies are unaffected by specular reflection on the glass of glass box)
     
  27. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Btw could you share the coverage maps/settings for this scene, I'm not really a technical artist so, haven't been able to achieve anything like this :(
     
  28. Ciderhelm

    Ciderhelm

    Joined:
    Apr 25, 2017
    Posts:
    7
    Hey I need to jump to my real job but I can give you a quick look at my settings (attached). The screenshot I posted earlier is pretty vague, but the clouds produced really came out amazing (moreso than I expected!). If I find time I'll throw a few texture maps together and post them here.

    This is using the Advanced setting. I first tried to go the Custom route but I am going to hold off for the Unite presentation to completely understand the textures.

    In my case, I used two cloud noise maps (coincidentally, that I was using for light cookies to simulate the lighting effects of clouds previously), and the cumulonimbus map is a third generic noise map. The two cloud maps are pretty generic photoshop noise generations with various gaussian level and brightness levels.

    The cumulonimbus map and slider produced these incredible vertical columns. I was aiming for something that looked incredible to move through, rather than look up at (or down on), so being able to generate these was great.

    This was set for a night-time scene, in a sprawling setting (large scale). I used a lower shadow opacity (0.33 and 0.33 respectively) for daytime. There are some issues w/ artifacts and edges showing up, so I mixed normal volumetric shadowing to get exactly the look I wanted. But fortunately it all holds up between drastically different lighting scenarios, which is what I'm always nervous about when getting this detail-focused on settings like this.
     

    Attached Files:

    Ruchir likes this.
  29. Ciderhelm

    Ciderhelm

    Joined:
    Apr 25, 2017
    Posts:
    7
    Following up @Ruchir here are some cloud textures I've been using in the Advanced setting. I don't know the relationship between texture size and the cloud map size in the settings, so it may be that these aren't optimized. Disable SRGB on import for these.

    The "Clouds 256 Cells Soft" is the cumulonimbus map. The blown out whites are what is bringing out vertical pillars between layers as far as I can tell. I would probably blur this out a little in the future.

    The "Clouds 256 Noise" Soft and Contrast are for the other maps. Contrast is what I choose for the rain map b/c it leaves more variation in the rain darkening.

    I was looking for something wispy that worked well when broken up with craggy mountain-like terrain, when flying and looking down. I leverage the shape and erosion heavily and am not looking to have fully opaque clouds here. So, these may not work well for a lot of other projects, but the worst case is you can try them out and if you don't like it, at least you have a couple more tiling noise textures that may be useful somewhere else. :)
     

    Attached Files:

    SuperRaffles, lilacsky824 and Ruchir like this.
  30. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Thanks a lot :)
     
  31. Deleted User

    Deleted User

    Guest

    Anyone knows how these clouds would promote realtime GI(Enlighten)?? If I want to create a day and night cycle with weather changes will enlighten realtime GI be able adapt those changes?
     
  32. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    If enlighten supports dynamic light cookies for directional lights, I don't see a problem with it
     
    Deleted User likes this.
  33. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Also give us a way to create and assign custom volume noise, i take it the default cloud noise was generated using this tools? https://github.com/keijiro/NoiseTools , integrate and improve it to hdrp
     
    SebLazyWizard likes this.
  34. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I have a question though,
    Shouldn't cloud rendering be independent of camera far clip, it should be a setting in the post-processing volume instead, because camera stacking is expensive in HDRP and to get satisfying result with volumetric clouds in any game they need to be rendered to quite a long distance, which will really kill performance on most hardware specifications if we were to just increase far clip of camera to get that :(
     
    sqallpl and Deleted User like this.
  35. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    We will be looking into a mode that will be purely camera-based. This means you won't need to increase the camera far plane at all, but this will have the downside that you will never be able to go into/above the clouds. It will have a similar behavior to an HDRI sky then, while still providing much better shading quality and moving clouds.

    If you want to go into the clouds, above them, and see them interacting with the world miles and miles away, you will need to increase the far clip though.

    Alternatively, you can keep a low-ish far clip distance, and instead increase the curvature of the clouds. This is already doable and mitigates the need to use several hundred kilometers for the far clip distance.
     
    Last edited: May 7, 2021
  36. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    No, the internal noise used was not generated using that tool. We'll eventually offer more control over the noise used for the cloud shaping and erosion.
     
    Reanimate_L, sqallpl and Ruchir like this.
  37. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Can anyone tell me what kind of noise function is used in UE4?


    The cloud noise looks much more natural here.

    Also, recently I found this asset, even this does have better cloud noise:


    Are there any updates in the works that improve upon this for the current volumetric cloud?
    (Also, the cloud light scattering in UE4 looks Amazing :p)
     
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Damn Expanse looks lit. . . .
     
    Ruchir and Deleted User like this.
  39. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255


    Soon you'll be getting these new controls on the simple/custom mode.
     
  40. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    The ghosting when flying through has been improved aswell
     
    bdb400, Kirsche, iamarugin and 10 others like this.
  41. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    @auzaiffe thanks for share. Really good things happening...
     
    Deleted User and Matjio like this.
  42. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    @auzaiffe

    Great to see the improvements.

    Do you plan to support reflection probes in the future? At this moment the documentation says that "Volumetric clouds do not appear in Reflection Probes".

    BTW. Do they work for visual environment lighting input at the moment? I mean are they included in the ambient lighting?

    Thanks.
     
  43. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    The new settings and being able to flythrough without temporal accumulation artifacts seem pretty exciting :)

    Also, one thing that could probably be useful in many cases is a halo effect for directional light, if I remember correctly Fog Volume 3 does it pretty well.
     
  44. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
  45. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Currently, I found two Bugs/Limitations in the clouds system:
    • There is a strange directional light present when I set the sun intensity to 0 or there isn't one present in the scene. When I increase the directional Light intensity from 0 to say 0.01 the clouds darken and behave as they should instead of having an imaginary White directional light point downward.
    • upload_2021-5-31_1-9-9.png
    • upload_2021-5-31_1-8-37.png
    • They currently don't take into account the Sky Emission or shy exposure value so, they look really odd. Black clouds in front of bright sky.
    • upload_2021-5-31_1-7-42.png
     

    Attached Files:

  46. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Well, the default cloud layer doesn't react to lighting changes at all for most part so, can't really use it either:
    upload_2021-5-31_1-10-34.png

    As you can see with having 0 directional light intensity and very low exposure value for HDRI sky, the cloud layer is overexposing the whole scene and the stars in the background are just not visible

    Even the clouds don't react to sky exposure values or color like they are always white no matter the skybox, They really standout during sunset and sunrise settings
     
  47. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Also the clouds are visible no matter my exposure settings for camera:
    upload_2021-5-31_1-16-52.png

    upload_2021-5-31_1-17-18.png

    This doesn't happen when I have a directional light with intensity > 0
     
  48. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, thanks for the feedback.

    That's right, the night sky emission texture doesn't contribute to the ambient probe, which has a big influence on the cloud shading. In the current implementation, this emission map is really meant to simulate realistic stars (for an "Earth scenario"). It will indeed fall apart if you use extremely bright stars. ;)

    For the bug regarding the intensity of the directional at 0, we'll look into this.
     
    Ruchir likes this.
  49. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    But it doesn't work with the exposure value for HDRI sky as well, which should work given I don't always want a sunlight in my scene, for example an gradient sky for a stylized look, where only the sky exposure value is used as ambient light.

    The cloud should look consistent in this case and not pitch black imo.
     
  50. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934