Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Massive Clouds Atmos / Massive Clouds

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

  1. b1gry4n

    b1gry4n

    Joined:
    Sep 11, 2013
    Posts:
    146
    Another extreme example where the min and max height is very large, the min distance is far from the camera. This gives an interesting shape upload_2020-2-3_18-25-28.png

    The downside to my method is the minimum draw distance literally cuts away at the clouds leaving a somewhat visible cutaway depending on cloud thickness. I am not skilled enough in ray marching and shaders in general to figure this out. I would assume the same method applied to the softness of the cloud bottom/top could be applied to the minimum distance cutaway

    upload_2020-2-3_18-30-59.png
    An exaggerated cloud shape showing the problem
    upload_2020-2-3_18-39-10.png
     
    Last edited: Feb 4, 2020
  2. b1gry4n

    b1gry4n

    Joined:
    Sep 11, 2013
    Posts:
    146
    I spoke too soon. I figured I would give it a try and I did exactly as I thought. I made my own softness function, almost identical to the current
    ClipHorizontalDensity
    except I test against distance rather than Y position. After adding my own near clip softness and figure parameters to the profile this is what I ended up with.

    These clouds are fading out at a minimum distance without the "cut" from the previous post.
    upload_2020-2-3_20-35-31.png
    Here I am just in distance to cut a small hole in a 100% dense cloud formation, just to see how it handles.
    upload_2020-2-3_20-44-48.png
    These clouds are tall enough to surround the scene, but since we are cutting a minimum distance away + the bottom, it almost acts as a dynamic skydome that you could also have over an ocean
    upload_2020-2-3_21-15-10.png
    Next Im going to try to make the "lod" system a bit more streamlined so its easier to use. These clouds would be really great as a background far distance LOD. I want to modify it so I can take advantage of the layers of clouds at different heights as they currently are, but also sort the draw order/rendering pass to accomodate different resolutions. This way you could have a layer of clouds rendering different resolutions in the distance while also having another layer of clouds higher above them
     
    Last edited: Feb 4, 2020
    awesomedata and mewlist like this.
  3. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Apologies for delay I was sick.

    I'll upgrade to the official release of 2019.3 and I will let you know if issues persist.
     
    mewlist likes this.
  4. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    I have started working on HDRP ready version.
    If it will be done, I want to new features for future version!


    Currently I am coding on Unity 2019.3.0f6 + HDRP.
    I use HDRP CustomPass feature and I got it :)

    Please wait for this work will be done!

    Thanks

    upload_2020-2-4_22-38-5.png
     
    ftejada and jamespaterson like this.
  5. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    182
    To clarify, does that mean it'll eventually be on SRP version as well?
     
  6. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    When the support for HDRP is completed and released (as Version4.1.0), consider the functions to be implemented next.
    There are many needs, such as those that control distribution and the performance improvement of existing functions, so I would like to work on them.
     
    Last edited: Feb 4, 2020
  7. b1gry4n

    b1gry4n

    Joined:
    Sep 11, 2013
    Posts:
    146
    An update on the LOD setup. I think I have it mostly working. I contain the LOD settings in a "core" profile. This might not be the most elegant way, but it works.
    upload_2020-2-4_17-12-9.png

    The only way I could get this working is by creating dedicated mixers for each lod material. Trying to reuse the same mixing material from the core profile did not work with the rendering pass. So...when the mixers are updated based on the core profile, I also update a new struct I made called LODMixer. When mixers remove, LOD removes. When mixer updates, LOD updates.

    Code (CSharp):
    1. struct LODMixer
    2.     {
    3.         public MassiveCloudsProfile currentProfile;
    4.         public List<MassiveCloudsMixer> mixer;
    5.         public LODMixer(bool setup)
    6.         {
    7.             mixer = new List<MassiveCloudsMixer>();
    8.             currentProfile = null;
    9.         }
    10.         public void ChangeTo(MassiveCloudsProfile p, bool lerp)
    11.         {
    12.             currentProfile = p;
    13.             UpdateMixers(currentProfile);
    14.             Change(p,lerp);
    15.         }
    16.         void UpdateMixers(MassiveCloudsProfile p)
    17.         {
    18.             var toRemove = Mathf.Max(0, mixer.Count - p.Parameter.lodArray.Length);
    19.             var toAdd = Mathf.Max(0, p.Parameter.lodArray.Length - mixer.Count);
    20.             for (var i = 0; i < toRemove; i++)
    21.             {
    22.                 mixer.RemoveAt(mixer.Count - 1);
    23.             }
    24.  
    25.             for (var i = 0; i < toAdd; i++)
    26.             {
    27.                 var m = new MassiveCloudsMixer();
    28.                 mixer.Add(m);
    29.             }
    30.         }
    31.         void Change(MassiveCloudsProfile p, bool lerp)
    32.         {
    33.             for(int i = 0; i < p.Parameter.lodArray.Length; i++)
    34.             {
    35.                 mixer[i].ChangeTo(p.Parameter.lodArray[i], lerp);
    36.                 mixer[i].SetParameter(p.Parameter.lodArray[i].Parameter);
    37.             }    
    38.         }
    39.     }

    Code (CSharp):
    1.             if (mixers.Count != profiles.Count || forced)
    2.             {
    3.                 var toRemove = Mathf.Max(0, mixers.Count - profiles.Count);
    4.                 var toAdd = Mathf.Max(0, profiles.Count - mixers.Count);
    5.                 for (var i = 0; i < toRemove; i++)
    6.                 {
    7.                     mixers.RemoveAt(mixers.Count - 1);
    8.                     lodMixers.RemoveAt(mixers.Count - 1);
    9.                 }
    10.                 for (var i = 0; i < toAdd; i++)
    11.                 {
    12.                     var mixer = new MassiveCloudsMixer();
    13.                     mixers.Add(mixer);
    14.  
    15.                     var lodmixer = new LODMixer(true);
    16.                     lodMixers.Add(lodmixer);
    17.                 }
    18.             }
    19.             // Update Mixers
    20.             for (var i = 0; i < profiles.Count; i++)
    21.             {
    22.                 mixers[i].ChangeTo(currentProfiles[i], lerp);
    23.                 lodMixers[i].ChangeTo(currentProfiles[i], lerp);
    24.  
    25.                 if (currentParameters[i] != parameters[i])
    26.                 {
    27.                     mixers[i].SetParameter(parameters[i]);
    28.                     currentParameters[i] = parameters[i];
    29.                 }            
    30.             }
    31.  
    The LOD mixers also get updated in the Update function, when the normal mixers get updated, but Ill save the copy paste of that as its just a duplicate, just pointing to a different mixer.

    So now my
    BuildCommandBuffer 
    code looks like this

    Code (CSharp):
    1.                     var myrendertextures = new CreateResolutionTextures(TargetCamera, commandBuffer, curParam.renderResolutions);
    2.                     for (int ri = 0; ri < curParam.renderResolutions.Length; ri++)
    3.                     {                      
    4.                         if (curParam.lodArray[ri] == null) continue;
    5.                         if (!curParam.lodArray[ri].Parameter.canRender) continue;
    6.                         commandBuffer.SetGlobalTexture("_ScreenTexture", renderTextures.From);
    7.                         var cloud = lodMixers[index].mixer[ri].Material.CloudMaterial;
    8.                         SetMat(cloud, curParam.lodArray[ri].Parameter);
    9.                         var mix = lodMixers[index].mixer[ri].Material.MixMaterial;
    10.                         SetMat(mix, curParam.lodArray[ri].Parameter);
    11.                         commandBuffer.Blit(renderTextures.From, myrendertextures.Next(ri), cloud);
    12.                         commandBuffer.Blit(myrendertextures.Next(ri), renderTextures.To, mix);
    13.                         renderTextures.Flip();
    14.                     }                  
    15.                     myrendertextures.Release(commandBuffer);

    And here are the results of the lod system. I could tweak the values of the LOD profiles individually to try to make a blend between them so its less noticeable, but for purposes of showing it very clearly I will leave it as is. There is very clearly a close, medium, and far detail
    upload_2020-2-4_17-23-34.png

    The next challenge is to make layers work with the lods so you can have different layers of clouds. This might present a headache as some layers could have more LOD levels than others, so figuring that out will be one of the bigger issues I suspect
     
    awesomedata and mewlist like this.
  8. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Version 4.1.0 submitted!
    Finally it will work on HDRP7.1.8 (Unity2019.3f6 or later).

    If version accepted, I will report at here.

    Thanks.
     
  9. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
  10. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    FIXED, read next post

    Hello, I've recorded a video of the issue.

    The problem is:

    If I modify the .asset file the changes are not seen in realtime
    Even if I stop and play again changes take no effect
    For changes to take effect, the .asset must be unnaisgned from camera effect and asigned again.

    Looks like "massive Clouds" camera script stores the values of the .asset and does not refresh.

     
    Last edited: Feb 7, 2020
  11. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    To edit a profile in realtime, select hte "layer" in the camera effect!!!!

    I was getting mad.

    upload_2020-2-7_12-2-57.png
     
  12. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Very happy with ressults
    upload_2020-2-7_19-18-55.png

    upload_2020-2-7_19-19-41.png
     
    mewlist likes this.
  13. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    146
    Hey there Mewlist,
    congratulations on the HDRP custom pass release! It is working great for me so far. :)
    I wanted to ask: Is it possible to save the current state of the shader and restore it later? I am mostly talking about the current internal scroll offset or time variable that drives the shader.
     
  14. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    First of all: Thank you for that awesome new release and your hard work.

    I noticed there are compiler errors if the post processing package is not installed when using Unity 2019.3.0f6. Maybe you could create another unity package with the scripts separated or you could add to the documentation, that it is save to remove the folder Scripts/Postprocessing.

    As our project targets PS4, I tried you asset there (again ;) ).
    Setup:
    • Unity 2019.3.0f6
    • HDRP 7.1.8
    • Did all steps from you documentation for HDRP Setup
    I got this errors:

    Code (csharp):
    1. Shader error in 'MassiveCloudsVolumetricShadow': Program 'MassiveCloudsVert', parameter of type 'float4' is a function output and does not permit argument of mismatching type 'half4' at Assets/MassiveClouds/Shader/MassiveCloudsVolumetricShadow.cginc(78) (on ps4)
    2.  
    3. Compiling Vertex program with _HORIZONTAL_ON _RENDERER_AUTHENTIC
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    Code (csharp):
    1. Shader error in 'MassiveCloudsVolumetricShadow': Program 'MassiveCloudsVert', parameter of type 'float4' is a function output and does not permit argument of mismatching type 'half4' at Assets/MassiveClouds/Shader/MassiveCloudsVolumetricShadow.cginc(78) (on ps4)
    2.  
    3. Compiling Vertex program with _HORIZONTAL_ON _RENDERER_AUTHENTIC
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR

    If fixed them by changing the texCol from half4 to float4 in "MassiveCloudsVolumetricShadow.cginc".

    And I think, MassiveCloudsMaterial.cginc misses a definition for the ComputeGrabScreenPos method. I fixed this by using the method from UnityCG.cginc.

    The last things was the missing definition of the property _ScreenSize in MassiveCloudsDepthSampler. I fixed this by moving the this property to MassiveCloudsInput.cginc and removing it from MassiveCloudsCommon.cginc.

    But still I can't see any clouds in the PS4 build, while windows builds and editor is working great. There are only shader warnings left, but they are not PS4 target related:

    Code (csharp):
    1.  
    2. 'SAMPLE_DEPTH_TEXTURE' : macro redefinition
    3. Compiling Vertex program with _RENDERER_AUTHENTIC
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    5.  
    Code (csharp):
    1.  
    2. 'SAMPLE_DEPTH_TEXTURE_LOD' : macro redefinition
    3. Compiling Vertex program with _RENDERER_AUTHENTIC
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    5.  

    Can you help me? Is there anything I could test or I could send to you to help you make this work?

    Thanks in advance!
     
  15. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Have you added shader preload on the graphics settings?
     
  16. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Yes, of course. I followed the documentation and it is working in editor and standalone builds.
     
  17. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Hi.
    Sorry, internal shader time can not be saved.

    If you control scroll offset, please control it from script.
    You can set offset using MassiveClouds.SetOffset(Vector3) function.
    And set scrollVelocity to zero.

    Code (CSharp):
    1.         for (int i = 0; i < parameters.Count(); i++)
    2.         {
    3.             var parameter = parameters[i];
    4.             parameter.Density = densities[i];
    5.             parameter.ScrollVelocity = Vector3.zero;
    6.             parameters[i] = parameter;
    7.         }
    8.         massiveClouds.SetParameters(parameters);
    9.         massiveClouds.SetOffset(Vector3.zero); // you can set scroll offset here
    10.  
    Sample code is like this.
    And MassiveCloudsScriptableScrollSample.cs is sample code for controlling scroll from script.

    Thanks.
     
    ElevenGame likes this.
  18. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Thank you for your report !

    On PS4, all objects except clouds are rendered or Black screen?

    I want to see frame debugger, rendering command buffer is working correctly on PS4.
    If cloud is rendered in any step of CustomPass, probably there are problems or differences in last Blit step.

    upload_2020-2-10_23-57-38.png


    And...

    Would you try to change RenderTarget format to ARGB32 (from ARGB64) in MassiveCloudsPass.cs
    Like this.

    upload_2020-2-11_0-24-40.png

    (Sorry, PS4 issue is not available on web widely and I do not have development environment.)

    Thanks.
     
  19. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Don't be sorry. That's why I'm here to help. I'm glad you are helping me. That's not self-evident!

    That is what I see on PS4. As you can see, all objects except clouds are rendered.
    upload_2020-2-10_17-26-16.png

    In Editor/Standalone:
    upload_2020-2-10_17-26-42.png


    The frame debugger can only be used with graphics jobs disabled but I think this does not matter at this case.

    It seems like the custom pass is rendering:
    upload_2020-2-10_17-28-23.png

    I also changed the RenderTarget format as described, but it doesn't change anything.

    Thanks again for your help!
     
  20. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    If I select the same "Draw Dynamic" entry I get this image:
    upload_2020-2-10_17-46-22.png

    upload_2020-2-10_17-46-45.png
     
  21. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    It seems cloud are rendered into internal buffers.
    Would I see the last two stage of custom pass in Frame Debugging?
    upload_2020-2-11_9-9-25.png
    Thanks.
     
  22. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Yes, here they are:
    upload_2020-2-11_9-30-8.png upload_2020-2-11_9-29-54.png
     
    mewlist likes this.
  23. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Hi.
    I missed uv calculation compatibility codes.
    Would you try to change MassiveCloudsVertHDRPView() function like below, in MassiveCloudsCommon.cginc.

    Code (CSharp):
    1. v2f MassiveCloudsVertHDRPView(appdata v)
    2. {
    3.     v2f o;
    4.     uint vertexID = v.vertexID;
    5.    
    6.     float2 posUV = float2((vertexID << 1) & 2, vertexID & 2);
    7.     float4 posCS = float4(posUV * 2.0 - 1.0, UNITY_NEAR_CLIP_VALUE, 1.0);
    8.     float2 uv = posUV.xy;
    9.     #if UNITY_UV_STARTS_AT_TOP
    10.         uv.y = 1.0 - uv.y;
    11.     #endif
    12.     o.vertex = posCS;
    13.     o.uv = float4(uv / _RTHandleScale.xy, 0, 1);
    14.  
    15.     return o;
    16. }
     
  24. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Thanks.
    I changed it and made a new build. But no clouds on PS4. Should I send you more frame debugger outputs?
     
  25. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    I may understand reason of this problem.
    Would you overwrite MassiveCloudsBlit.shader entirely ?

    I was wrong.

    UNITY_RAW_FAR_CLIP_VALUE is required for vertex position.
    I set that wrong value UNITY_NEAR_CLIP_VALUE.


    Code (CSharp):
    1. Shader "MassiveCloudsBlit"
    2. {
    3.     Properties
    4.     {
    5.         [HideInInspector]
    6.         _MainTex   ("Texture", 2D) = "white" {}
    7.         [Toggle]
    8.         _HORIZONTAL         ("Horizontal?", Float)              = 0
    9.         [Toggle]
    10.         _RelativeHeight     ("RelativeHeight?", Float)          = 0
    11.         _Thickness          ("Thickness", Range(0, 10000))      = 50
    12.         _FromHeight         ("FromHeight", Range(0, 5000))      = 1
    13.         _MaxDistance        ("MaxDistance", Range(0, 60000))    = 5000
    14.     }
    15.  
    16.     SubShader
    17.     {
    18.         // No culling or depth
    19.         Cull Off ZWrite Off ZTest Always
    20.  
    21.         Pass
    22.         {
    23.             CGPROGRAM
    24.             #pragma vertex Vert
    25.             #pragma fragment MassiveCloudsFragment
    26.             #pragma shader_feature _HORIZONTAL_ON
    27.  
    28.             #include "MassiveCloudsCommon.cginc"
    29.             #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
    30.  
    31.             v2f Vert(appdata v)
    32.             {
    33.                 v2f o;
    34.                 uint vertexID = v.vertexID;
    35.                
    36.                 float2 posUV = float2((vertexID << 1) & 2, vertexID & 2);
    37.                 float4 posCS = float4(posUV * 2.0 - 1.0, UNITY_RAW_FAR_CLIP_VALUE, 1.0);
    38.                 float2 uv = posUV.xy;
    39.                 #if UNITY_UV_STARTS_AT_TOP
    40.                     uv.y = 1.0 - uv.y;
    41.                 #endif
    42.                 o.vertex = posCS;
    43.                 o.uv = float4(uv / _RTHandleScale.xy, 0, 1);
    44.            
    45.                 return o;
    46.             }
    47.            
    48.             float4 MassiveCloudsFragment(v2f i) : SV_Target
    49.             {
    50. #if defined(USING_STEREO_MATRICES)
    51.                 half4 texCol = tex2Dproj(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv, _MainTex_ST));
    52. #else
    53.                 half4 texCol = tex2Dproj(_MainTex, i.uv);
    54. #endif
    55.                 return texCol;
    56.             }
    57.             ENDCG
    58.         }
    59.     }
    60. }
    61.  
     
  26. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    I tried it. Still no clouds :(
     
  27. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Oh...

    I think ClipSpace position of fullscreen Quad is out of screen or out of near-far clip.

    Please try
    1. posCS.z to zero in Vert
    float4 posCS = float4(posUV * 2.0 - 1.0, 0.0, 1.0);

    2. Shift posCS

    posCS.y += 1;

    or try
    posCS.y -= 1;

    any change comes?
     
  28. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Nothing changed. No clouds.

    You said to set the z-Value of posCS to zero, but in you example you set the y-Value to zero, I think? I used the code from your example for the tests.

    Could this be related to the changes I did? (see https://forum.unity.com/threads/v4-...-volumetric-clouds.581182/page-7#post-5462637)

    I compared the entries of the frame debugger in editor and on ps4. Maybe this points in the right direction:

    PS4
    PS4.jpg

    Editor
    Editor.jpg

    (I should have used the same resoultion... :D)
     
    Last edited: Feb 12, 2020
  29. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Second value zero is z-Value because, posUV is float2 value.
    float4(posUV * 2.0 - 1.0, 0.0, 1.0);

    Thank you for frame debugger shot.
    It seems that clouds are rendered internally, but blit from camera buffer and to camera buffer is not working.
    And DepthTexure is read correctly.

    And I think your local changes are not issue for this problem.

    CustomPass may not be working...?

    I want to know if does this simple FullScreen CustomPass shader sample works.

    https://docs.unity3d.com/Packages/c...s.high-definition@7.1/manual/Custom-Pass.html
    upload_2020-2-12_22-45-13.png
     
  30. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Oh yes, I'm sorry.

    I just tested a simple mosaic effect in FullScreenPass on PS4 and it is working:

    PS4
    upload_2020-2-12_16-19-37.png

    Editor
    upload_2020-2-12_16-20-17.png
     
  31. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235

    So that's it...

    I understand that Camera Buffer can be wrote with CustomPass on PS4.

    I think there are some problems in my codes.

    So, I have replaced camera buffer copying codes by using DrawProcedural.
    I attached patch as unitypackage on this post.

    Would you try this?


    upload_2020-2-13_2-3-52.png
    I tested this patch on Windows + DX11.

    Thanks.
     

    Attached Files:

    Last edited: Feb 12, 2020
  32. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Wow, you're awesome! It works! Thank you very much.

    So... Next thing I could try is Xbox One. Will do this tomorrow!

    Thank you again for your help!
     
    TokyoWarfareProject and mewlist like this.
  33. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    I am glad to hear that!!.
    Thank you for your patiance.
     
  34. thomas-weltenbauer

    thomas-weltenbauer

    Joined:
    Oct 23, 2013
    Posts:
    72
    Xbox is working as well! Thank you again for your help!
     
    mewlist likes this.
  35. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hello,

    I just recently purchased the package. I am using Unity 2019.3.0f6. With HDRP 7.1.8.

    I followed the .pdf instructions the best I could. It seems like the installation worked, however in my scene it looks like the clouds are on the ground, instead of in the sky.

    Perhaps I am missing a setting or something? Here is a picture of my game currently:
    MassiveCloudsUnityProb1.png

    Ignore the pink, as those are just materials/textures I havn't converted to HDRP yet. I am using a "Procedural Sky" in my volume settings. It just looks like the fog/clouds are too thick and on the ground?

    I am using the "Altocumulus" profile, and when I try adjusting setting in the profile, nothing seems to happen. Thanks for any help or suggestions.
     
  36. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    33
    hi! im trying to insert some epic planets sprites between skybox and massive clouds render.
    i write custom shader and set required RenderQueue to my shader and get what i want:

    but it works fine only in scene editor. in runtime i get this one:

    its looks like color are accumulated very fast and have uncleared trail when i move camera.

    i read a lot about what is wrong with it. and find only one thread that recommend to change RenderQueue more, but when i do it - planet will overlap clouds.

    what i must change to make it work in runtime same as in scene editor?

    p.s. its also works fine when i set Solid Color instead of Skybox in camera ClearFlags:
     
  37. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    It looks like fog.

    How about your general settings of Clouds?
    upload_2020-2-20_8-53-15.png

    And Is there difference from HDRP default sample scene?
    I think there is some problems in clouds or pipeline settings.

    I want to reproduce this case.

    Thanks.
     
  38. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    What RenderPipeline do you use.

    Does planet image is placed as GameObject in Scene ?
    And has transparent pass?

    I try to reproduce it.
     
  39. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    33
    deferred standard render. Massive Cloud is in post effect as "Massive Cloud Before Transparent Effect"
    planet is SpriteRender with custom material with shader (materials RenderQueue 2500):

    Code (CSharp):
    1. Shader "Mobile/Hybrid_Far" {
    2. Properties {
    3.     _MainTex ("Particle Texture", 2D) = "white" {}
    4. }
    5.  
    6. Category {
    7.     Blend SrcAlpha One
    8.  
    9.     Cull Off Lighting Off Fog { Mode Off }
    10.     ZWrite Off
    11.  
    12.     BindChannels {
    13.         Bind "Color", color
    14.         Bind "Vertex", vertex
    15.         Bind "TexCoord", texcoord
    16.     }
    17.  
    18.     SubShader {
    19.         Pass {
    20.             SetTexture [_MainTex] {
    21.                 combine texture * primary
    22.             }
    23.         }
    24.     }
    25. }
    26. }
     
    Last edited: Feb 20, 2020
    mewlist likes this.
  40. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437

    Thanks for the reply. I let it sit for a week waiting for your response, and now when I loaded it up again it worked! Maybe a simple Unity restart or something was required? I could have sworn I did that, but maybe not. Anyways, it seems to be working now -- which is great. Problem solved for now. I will post back if I have any more issues. :)


    I do have a request though to ask you (not related to this asset really). I'm trying to use particles (particle systems) to simulate clouds as well -- and I cannot find a good cloud shader that works well with Unity's particle system and that performs well. I have tried using the provided Unity sample "Particle Lit Soft" shaders for the ShaderGraph -- which actually works, but the performance is terrible. When the Particle System Clouds fill more and more of the screen space, the performance dips dramatically, it's currently unusable for me in a real game.

    So, do you know if there's a way to get particle shaders to perform better in ShaderGraph. Or could you possibly write a particle shader for me that might work (for realistic looking clouds)? It seems to me non-shadergraph shaders usually work better, the shader-graph ones always seem to have problems.

    I would be willing to pay you for it, if you're willing to do it. Overall, I'm just looking for a realistic looking cloud particle system shader that takes normal maps and looks at least semi-realistic!

    Thanks again for your help and reply. I'm glad the asset is working.
     
    mewlist likes this.
  41. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Sorry for late to reply.

    Render Queue 2500 is before Unity Skybox rendering.
    Do you draw skybox by Mesh? If so, would I know that render Queue value.

    I have tested it.
    * Deferred rendering
    * Standart RP
    * Unity 2019.3.2
    * Sprite Renderer with your Hybrid_Far shader RenderQueue=2500
    * PPSv2 Before Transparent Pass
    * Remove Skybox and Clear screen by constant color.

    Build and run Windows application.
    But it is not reproduced.
    upload_2020-2-23_1-15-1.png

    It seems I miss some other factor in this problem.
    Would you aware something else?

    Thanks.
     
    Last edited: Feb 22, 2020
  42. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    55
    Hi!

    Will this work in Vulkan and URP?
     
  43. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    upload_2020-2-25_23-10-5.png

    On 2019.3.2f1, It seems to work.
    Thanks.
     
  44. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    33
    here is it, i use skybox (unity default with haze and procedural sun rendering, also any skybox with sky gradients can be used)
     
  45. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    So far my game is coming along well and the clouds are looking sensational. I am using the old unity renderer (not HDRP or URP) When I get above the clouds and look down I can see the water in my lakes and streams being rendered on top of the clouds. Is there a way to have the clouds cover the water?
     
  46. fikriemre

    fikriemre

    Joined:
    Sep 27, 2017
    Posts:
    4
    Does M.C . support clouds ground shadow? If it how can i enable it?
     
  47. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    MassiveCloudsCameraEffect has Render Timing parameter.
    Set Camera Render Timing to AfterTransparent will resolve waterplane rendering.

    But with other transparent object is rendered before clouds.
    Transparent rendering order is dufficuld to solve all situation.

    In URP or HDRP, bit more customizable.
    We need to design RenderingPass timing of SRP.
     
  48. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Screen Space Clouds Shadow parameter is prepared.
    But, There is a limitation. It casts shadow also into room.
     
  49. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I don't have After Transparent in my list of options :(

    upload_2020-3-18_18-4-57.png
     
  50. mewlist

    mewlist

    Joined:
    May 22, 2017
    Posts:
    235
    Sorry. If you use Camera Effect, "After Forward Alpha" is same.
    Thanks.