Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Massive Clouds Atmos / Massive Clouds

Discussion in 'Assets and Asset Store' started by mewlist, Nov 9, 2018.

  1. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Report.

    I am testing ScreenSpaceShadow.
    I continue to research and try it.

    upload_2019-3-15_15-29-50.png upload_2019-3-15_1-19-51.png
     
    Last edited: Mar 15, 2019
    mons00n and r3ndesigner like this.
  2. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    I have captured Clouds Shadow prototype movie.

     
  3. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    124
    let me know when this version ll be at asset store, i want to buy it ^^
     
  4. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Probably it will be released on late March
    I post working progression at here.
     
    r3ndesigner likes this.
  5. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Shadow of Clouds feature.
    Implementation is almost finished.

    Next I prepare documents and Demo Scene.



    thanks.
     
  6. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    72
    How could I get this working with the valve renderer? Or basically, the custom shader that the valve renderer uses. It works just the clouds are rendered in front of all objects.
     
  7. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Thank you for your post.
    Is VALVE renderer this asset?
    https://assetstore.unity.com/packages/tools/the-lab-renderer-63141

    I have never use it, I will test it.
    Please wait result of test
     
    Last edited: Mar 18, 2019
  8. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    I have found solution for this.
    Massive Clouds or some image effects depends on Camera Depth Texture.

    Depth Texture is built in Z-PrePass of Pipeline, and it requires ShadowCaster pass in shader.
    (https://docs.unity3d.com/2018.3/Documentation/Manual/SL-CameraDepthTexture.html)
    I found Valve Renderer shader "vr_standard" does not have Shadow Caster Pass.

    So, try to add this code into vr_standard.shader

    Code (CSharp):
    1.  
    2.         Pass
    3.         {
    4.             Name "ShadowCaster"
    5.             Tags { "LightMode" = "ShadowCaster" }
    6.  
    7.             ZWrite [_ZWrite]
    8.             Cull [_Cull]
    9.  
    10.             CGPROGRAM
    11.             #pragma vertex vert
    12.             #pragma fragment frag
    13.             #pragma target 2.0
    14.             #pragma multi_compile_shadowcaster
    15.             #include "UnityCG.cginc"
    16.  
    17.             struct v2f {
    18.                 V2F_SHADOW_CASTER;
    19.                 UNITY_VERTEX_OUTPUT_STEREO
    20.             };
    21.  
    22.             v2f vert( appdata_base v )
    23.             {
    24.                 v2f o;
    25.                 UNITY_SETUP_INSTANCE_ID(v);
    26.                 UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
    27.                 TRANSFER_SHADOW_CASTER_NORMALOFFSET(o)
    28.                 return o;
    29.             }
    30.  
    31.             float4 frag( v2f i ) : SV_Target
    32.             {
    33.                 SHADOW_CASTER_FRAGMENT(i)
    34.             }
    35.             ENDCG
    36.         }
    Below image is render result with fixed shader.
    upload_2019-3-19_2-48-36.png
     
    Last edited: Mar 18, 2019
  9. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    23
    Im very interested in a new clouds solution for my project. But i do have a couple of questions first.

    1) If i draw a plane behind the clouds, can i see it coming through the clouds, when the plane passes the clouds and gets closer? In Enviro, you cant draw anything behind the clouds, because they are rendered immediately after the skybox.

    2) Can i manually set the cloud coverage? (how much of the screen is covered by clouds)

    3) I understand that the clouds are in screen-space. If i render with multiple cameras side by side (like having 4 cameras rendering 90 degree FOV each to build a 360 image), will the clouds work ok, will they draw continuously by the cameras, or will they "reset" for each camera?

    4) can i change the clouds height ? They're starting point on Y axis?

    Thank you!
     
  10. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    72

    AWESOME! worked like a charm. Do you happen to know if adding the shadow pass will significantly reduce performance? I am a shader idiot but I know the valve renderer uses its own method of making shadows and basically has you turn of unity shadows.
     
  11. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Depth pass will cost small, because it only renders depth.

    But I see FrameDebugger and found unused shadow map is rendered.
    To disable this Unity internal pass, could you set Shadows option to "Disable Shadows" in "Quality Settings" window.

    Then it will be rendered only depth pass correctly.

    upload_2019-3-19_8-35-27.png

    Thanks.
     
    Last edited: Mar 19, 2019
  12. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    1) It can be drawn behind clouds. Objects need to be set opaque render queue. Transparent mesh will cause rendering order problem.
    https://mewli.st/MassiveCloudsDemo/v2.3.0/CloudsDemo/ (WebGL Demo)
    In this demo, "Foggy" or "Inner Clouds" presets realize rendering objects behind clouds.

    2) Density parameter controls the coverage. If you want to set coverage dynamically, some scripts are needed.
    (I have plan to prepare dynamic controller tools in future version, but currently not)

    3) Not reset, because clouds are draw in world space. It need to set same presets on each camera.

    4) Height is controlled by From Height and To Height parameter.

    upload_2019-3-19_8-51-29.png

    Thanks.
     
    Last edited: Mar 19, 2019
  13. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    72
    Yep I already have shadows disabled. Thank you so much for the fix. Looks great in VR.
     
    mewlist likes this.
  14. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    23
    That's really awesome news!

    One more question. Right now we are using skyMaster for the clouds, and i had to modify some of the code to suit our needs.

    Does the asset come with the C# code, or is the code compiled?
     
  15. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Yes, all scripts and shader codes are included in package.

    Thanks
     
  16. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    23
    Thanks for all the replies. We bought the package :D Can't wait to start working with these clouds! I barely got 5 minutes to test it out, but it looks really nice, it even seems to work with SSMS Global Fog, which is awesome.
     
    mewlist likes this.
  17. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    mons00n likes this.
  18. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Version 2.3.0 has released!

    Asset Store URL: http://u3d.as/1mtr

    New Features
    • Shadow casting (Screen Space Shadow)
    • Add Dissolve Parameter
    • Fix: Height Fog was distorted
    • Fix: Scroll velocity unit is changed to [km/h]
    In this version finally clouds cast shadows on scene!


    Thanks.
     
    Bartolomeus755 likes this.
  19. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    248
    Amazing, thx for the update. :)
     
    mewlist likes this.
  20. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    23
    Nice update!

    Is there any chance for the clouds' shadows to be a part of the normal shadowMap? so the shadows cast by objects in the scene do not overlap / add up with the clouds' shadow?
     
    Last edited: Mar 22, 2019
  21. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Thank you very much

    Currently It is difficult to render in shadow map.
    But I think it may be able if cloud is set up as regular as gameobject and shadow caster pass given.

    I don't know if it could be, but I will try that.
     
  22. ayrton2389

    ayrton2389

    Joined:
    Oct 25, 2013
    Posts:
    23
    It would be really great if you could do this somehow. It would definitely look a lot more realistic.
     
  23. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Massive clouds is developed transparency clouds as a concept
    And next, I start to think about more solid, opaque and detailed rendering mode.
    Prototype of new lighting calculation image.
    upload_2019-3-25_0-45-36.png
     
    r3ndesigner likes this.
  24. paweechinagarn

    paweechinagarn

    Joined:
    Jan 7, 2019
    Posts:
    7
    Hi @mewlist ,

    First of all, this is such a great asset! I'm using this with HDRP and it looks amazing.

    I have one question. As it is a post processing effect using in HDRP project, it can't be added twice into post processing stack. I wonder if I can have multiple layers of clouds in different heights eg. low clouds at height 1000-2000 and high clouds at height 4000-5000?

    Thanks
     
  25. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Sorry, currently It is not assumed for multiple layer in post processing stack

    Multi layered clouds need many changes for codes.
    I try to plan adding this feature in next major version up

    thanks
     
  26. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    I am struggling with new lighting module.
    It will change shading quality of solid clouds.

    I want to finish it in April if i could.

    thanks
     

    Attached Files:

    Bartolomeus755 likes this.
  27. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    118
    Is there a VR demo available?
     
  28. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
  29. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    118
    The reason I ask is I would like to demo the effect of the clouds before I decide on purchasing, I’m currently building my own flight simulation and I would need to have the ability to fly through the clouds
     
    mewlist likes this.
  30. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    32
    Hello there mewlist,
    first of all thanks for making this really nice Massive Clouds Shader! :)
    I used it sucessfully in HDRP with PP v2. Out of curiosity I also tried integrating it with the latest HDRP(6.7) from github with it's PP stavk v3. I managed to get the controls to show up in the Volume Settings, but failed to integrate it with the compute shader so far. Can the current version of the shader even be used that way?
    I know those things aren't officially supported yet and still need manual changes in the PostProcessingSystem, but since a lot of people will make that move to PP v3 eventually, it would be interesting to know.
     
  31. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Sorry I have not check newest HDRP and PPS v3.
    It will be supported in future.

    I am interested in PPSv3.
    Could you tell me what version of Unity do you use?
     
  32. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    I have read PPSv3 and HDRP6.7 code.
    But I do not understand how to integrate for that yet...
     
  33. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    https://forum.unity.com/threads/hdrp-new-post-processing-extending.624166/
    I found this thread, PPSv3 will support custum effect in future version.

    When it is available, I will integrate for PPSv3.
    Thanks
     
    Last edited: Apr 11, 2019
  34. paweechinagarn

    paweechinagarn

    Joined:
    Jan 7, 2019
    Posts:
    7
    @mewlist I'm checking High/Rich profile with camera looks down from over the cloud. It seems like I have shadows on top of clouds which directional light should cast on. Is there any parameter I need to change according to how my camera works to make it looks like shadows appear under clouds instead?

    upload_2019-4-11_11-46-46.png
     
    Last edited: Apr 11, 2019
  35. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    When "Solidify check box" is on, could you try to adjust "Shading" parameter. It can be adjust shade position..
    When "Solidify check box" is off, shade direction is difficult to adjust.

    Rich profile is not set solidify.

    In next version, I am planning to add new lighting mode.
    It will be able to adjust easy over and under shading of clouds like attached image.

    Thanks.

    upload_2019-4-12_0-37-8.png
     
    paweechinagarn likes this.
  36. Catabtr23

    Catabtr23

    Joined:
    Mar 15, 2018
    Posts:
    3
    Hi newlist,

    Firstly, I want to say that this is an awesome asset and thank you for sharing him with us!

    Right now, I use Massive Clouds in a VR application. Also in that application, I use CTAA Cinematic Temporal Anti-Aliasing asset from the store. The problem is that these don't work together. If I try to use Massive Clouds when CTAA SPS is enabled, CTAA stop work. I tried to change in Massive Clouds script Inspector the property Camera Event and the CTAA worked when I had chosen "After Image Effects", but still the objects in the scene became to have blurry edges. I am trying to make it work with "After Skybox" camera event. It would be awesome if you know better what I am trying to resolve.

    Thanks. :)
     
    Last edited: Apr 15, 2019
  37. WuceBayne

    WuceBayne

    Joined:
    May 19, 2017
    Posts:
    3
    Last edited: Apr 15, 2019
  38. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Thank you for reports !

    I investigate problems with CTAA and HxVolumetric Lighting.
    Please wait for a moment.
     
  39. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    In next version, Dual layered clouds will be supported.

    upload_2019-4-22_0-39-15.png
     
  40. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    I found MassiveClouds incorrectly change DepthTextureMode.
    To fix this, modify MassiveClouds.cs.

    Original code At Line 75
    Code (CSharp):
    1.   TargetCamera.forceIntoRenderTexture = true;
    2.             switch (TargetCamera.depthTextureMode)
    3.             {
    4.                 case DepthTextureMode.None:
    5.                     TargetCamera.depthTextureMode = DepthTextureMode.Depth;
    6.                     break;
    7.                 case DepthTextureMode.Depth:
    8.                 case DepthTextureMode.DepthNormals:
    9.                     break;
    10.                 case DepthTextureMode.MotionVectors:
    11.                     break;
    12.                 default:
    13.                     TargetCamera.depthTextureMode = DepthTextureMode.Depth;
    14.                     break;
    15.             }
    Remove them and write this Fixed Code.
    Code (CSharp):
    1.  
    2.             TargetCamera.forceIntoRenderTexture = true;
    3.             if ((TargetCamera.depthTextureMode & DepthTextureMode.Depth) == 0)
    4.             {
    5.                 TargetCamera.depthTextureMode |= DepthTextureMode.Depth;
    6.             }
    Sorry for your patience.
     
  41. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    In next version, this will be fixed.
     
  42. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Hi. I bought Hx Volumetric Lighting and try to reproduce.
    But, I can not reproduce the situation.
    Could you please describe detail to reproduce? I use Unity2018.3.13f1 and PPSv2.
     
  43. WuceBayne

    WuceBayne

    Joined:
    May 19, 2017
    Posts:
    3
    Hi mewlist,

    I did some additional tests today on a brand new project, and I was able to reproduce the issue simply by adding a 3D object with a transparent/fade material anywhere in the scene. As soon as there are a light and a transparent object on sight, the sky looks weird. The Hx Volumetric Lighting asset is actually not in cause here.

    Image 1: transparent object is on sight.

    bug1.png

    Image 2: I moved my player forward, the transparent objet is not on sight anymore. The sky looks normal again.

    bug2.png

    Image 3: The same scene without any light. The sky looks good.

    bug3.png

    The bug occurs in both Editor and Play modes. But this is only happening with the PPSv2 version. On the other hand, the camera component works fine.

    Hope that helps!
     
    mewlist likes this.
  44. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    Thank you very much!
    I try to reproduce and investigate !
     
  45. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    I found PPSv2 Clouds render after transparent objects.
    Could you change MassiveCloudsEffectSettings.cs Line11 to
    Code (CSharp):
    1. [PostProcess(typeof(MassiveCloudsEffectRenderer), PostProcessEvent.BeforeTransparent, "Mewlist/MassiveClouds")]
    2.  
    This will fix in next version.
    Thank you for your support!
     
    WuceBayne likes this.
  46. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    121
    So if i have a lake or river which is a little bit transparent, if i am above the clouds and looking down will i be having problems with the water surface and the clouds?
     
  47. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    At clouds on the sky case, it has almost no transparent problem.
    If setup inner clouds scene, it will cause rendering order problem.

    I think your situation is works fine.
     
  48. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213

    With LWRP, I noticed that PostProcessEvent.BeforeTransparent is not working.
    I see the LWRP(5.7.2) source code, and BeforeTransparent pass is not set into the SRP queue.

    I change the LWRP code, and BeforeTranparent event works.
    But it should be fixed officially.
     
  49. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    121
    I'm not sure if I understand you. I'm making a flight simulator and I'll want players to be able to fly above, below and through the clouds .
     
  50. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    213
    If you can keep Camera => Clouds => Transparent Object rendering order
    Set CameraEvent to BeforeImageEffect (Default is AfterSkyBox), it will be correct result.

    If Camera below clouds, Transparent Object is not affected from clouds.
    If Cmaera over or inner clouds, clouds render after all transparent and opaque objects.

    upload_2019-5-3_11-11-37.png

    But Transparency object is placed inner clouds, it is difficult to resolve rendering order automatically.
    This case, it will be required custom shader and adjust the render queue manually.
     
unityunity