Search Unity

Volumetric Clouds

Discussion in 'Assets and Asset Store' started by Eideren, Oct 20, 2014.

  1. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    You can set it to map spherically around a planet.
     
  2. zoulinxiaoa

    zoulinxiaoa

    Joined:
    Dec 5, 2018
    Posts:
    3
    this asset is very cool but some issue show up when I update to the unity2018.2.16f1, Please help
    Here is the error message:
    Shader error in 'VolumetricCloud': cannot implicitly convert from 'const half3' to 'float4' at line 193 (on d3d11)

    Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL Y_AXIS
    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_RGBM_ENCODING

    this message is point the VolumetricCloud.shader
    float3 fakePerspDir = lerp(worldPos - _WorldSpaceCameraPos, UNITY_MATRIX_V[2].xyz, _OrthographicPerspective * UNITY_MATRIX_P[3][3]);
    o.eyeVec = NormalizePerVertexNormal(fakePerspDir);
     
  3. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hey, did you update to the latest version of this asset ? I just ran it through your exact unity version and it works fine, latest version doesn't use 'NormalizePerVertexNormal' anymore.
     
  4. zoulinxiaoa

    zoulinxiaoa

    Joined:
    Dec 5, 2018
    Posts:
    3
    It help.think
     
  5. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I'm sorry, what ?
     
  6. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    upload_2018-12-31_21-22-35.png
    unity 2018.2.5f1 fresh import spherical clouds
     
  7. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Just bought it , thanks for making this!
     
  8. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I checked on my end using your version in spherical mode and it works fine, could you try it inside a new scene ?
    Thanks a bunch !
     
  9. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    New year, new update, here's the change-log:

    // Version 3.5

    Shape
    • Cloud Flatness, controls the curve of the cloud to puff them out.
    • Old 'alpha' from 2.x is back as Local Scale, scales cloud vertically within their boundary.
    Shading
    • Direct and Indirect lighting computation can now be entirely disabled to help performances.
    • Base color is now effectively an albedo and Shading color now caps the minimum color.
    • Changed normal intensity to shading intensity.
    • Slightly changed how normals are calculated to retain more details.
    • Scaled direct lighting and point light contribution by density to more accurately represent real lighting model.
    • New silver lining feature and controls.
    • Sky Occlusion Normalized to manipulate the size of the occlusion gradient.
    • Occlusion Tint which, has its name implies, tint the occlusion.
    UI
    • Tons of property names have been changed to more accurately represent what they do.
    • Minor UI presentation changes.
    Raymarcher
    • Changed how each samples are blended together, it now uses a proper front to back blending.
    • Changed Step Size to min step size.
    • New 'Step Parallel Mult' control, this scales the length of each steps when the camera 'looks' towards the horizon, helps with rendering distant clouds.
    Breaking changes can be opted out of by clicking on the 'New Shading' toggle.


    As always, you'll have to wait a couple of days for the asset store team to process it before being able to download
     
    Last edited: Jan 3, 2019
    ElectroMantis and Lars-Steenhoff like this.
  10. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    44
    Any idea how this could be made compatible with Aura?



    In this example, every element showed is being "colored" by the red lights, except the clouds. That's what Aura does. I don't have much shader knowledge, but if anyone could give me some pointers I could try editing the cloud's code.

    Thanks!

    PS. In order to replicate this, just create a blank scene with any type of light with an AuraLight script, have a camera with the Aura script and Clouds. That's it. Just see how to clouds are completely unaffected.
     
  11. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Im trying to use this on 1:1 scales :\ it doesnt appear to enjoy it.
    Also latest version:
    upload_2019-1-8_8-56-32.png


    So i fixed the major issues turned out to be mostly Settings, but the clouds appear to have a Min/Max view distance, and are a bit glitchy.
    upload_2019-1-8_9-2-48.png
    Rotating the camera makes it Flicker a lot.
     
    Last edited: Jan 7, 2019
  12. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Well, leaving unity to calculate its own UI size was a mistake apparently, I'll push an update to fix this.

    Disable your coverage map and verify that the wrap mode set on the textures you use in the material is on 'repeat'. As for them being 'glitchy', if you modify the base preset you'll have to familiarize yourself with the raymarcher's settings, look at the manual, play around with those settings and you should be able to figure this out.
     
  13. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Im using all the default textures and settings, just On a sphere and at 1:1 scales.
    Not using a coverage map.

    I have modified every setting i can see on the Material with no affect.


    Heres a Gif:
    https://gyazo.com/2eeeba6e361d5b5aba749cedb74e694f
     
    Last edited: Jan 7, 2019
  14. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    By 1:1 scale, you're referring to the fact that your planet is as large as the real counterpart ? The flickering is caused by floating point rounding errors, I would have to guess that you're very far away from the origin, increase planeOffset on the c# script until the flickering stops.
    Single precision floating points aren't really suited to what you're trying to achieve anyway, you should probably look into what 'Kerbal Space Program' has had to go through to implement those kinds of things inside unity.
    If you see other issues, please try it inside a completely clean scene and we'll continue from there.
     
  15. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    I have already implemented a Custom Floating Origin system, But distance from Origin only goes up to about 500 before it snaps to -500. The size of the Cloud sphere is about 6,000,000 units, I believe this could be where the Issue is coming from, The cloud Center is sometimes multiple million units away. Would changing your system to using Doubles be possible?
     
  16. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I actually already thought about that, you just have to open 'VolumetricCloudsCG.cginc' and change those first few lines
    Code (csharp):
    1. #define   pf1 float
    2. #define   pf2 float2
    3. #define   pf3 float3
    4. #define   pf4 float4
    5. #define pf4x4 float4x4
    6.  
    7. #define   f1 half
    8. #define   f2 half2
    9. #define   f3 half3
    10. #define   f4 half4
    11. #define f4x4 half4x4
    to
    Code (csharp):
    1. #define   pf1 double
    2. #define   pf2 double2
    3. #define   pf3 double3
    4. #define   pf4 double4
    5. #define pf4x4 double4x4
    6.  
    7. #define   f1 double
    8. #define   f2 double2
    9. #define   f3 double3
    10. #define   f4 double4
    11. #define f4x4 double4x4
    Edit: Nvm, not as simple as that, unity's properties doesn't support casting to doubles
     
  17. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Alright so ill figure out the flickering later, What about the Min Max rendering distance (atleast it appears to look like that)? You can see in the Gif I can only see like a Ring of the Clouds around me i cant actually get close to them.
     
  18. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    That's either your near clip or the plane offset that's set too far, it should be the same for any other geo.
    Did you try inside a new scene ? About the flickering, did you try to set the plane offset farther ?

    I sent you a double precision version in PM, you have a toggle at the bottom of the material to switch to it.
     
  19. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Plane offset is set to 0, Everything works just fine just not when scaled, does works fine in a new scene. Changing the Plane offset makes it worse. Changing the near clip plane adjusts how far the Ring is from me, Having it at 0.1 makes all the clouds invisible, at a value of around 200 i can See the clouds and go through them, but i cant have my near clip plane at 200 :\ It also reduces how Far i can see the clouds as well. Checking the Double precision stuff now.
     
  20. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Double precision doesn't appear to have changed much if anything. It Appears to be a little less flickery though.

    Reducing the Near clip plane results in this:
    upload_2019-1-8_13-33-16.png
    Small ring, but Tiny view distance.

    Got discord or some other Live chat?
     
  21. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Sent it through a PM
     
  22. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    44
    bump?
     
  23. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Sorry but I can't really help you there, providing support for that asset requires a fairly large amount of work and is not really worth it on my end and if you don't really know anything about shaders starting out here wouldn't be advisable.
     
  24. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    44
    Ah, it's a shame since Aura is such an amazing package, but I understand.

    Edit: What about fog, though? I've also wondered about that. I'd settle for a quick and dirty way to make the clouds be affected by the standard unity fog, if possible.
     
  25. Hobsonite

    Hobsonite

    Joined:
    Sep 13, 2017
    Posts:
    2
    Hi,

    Switched my project over to the HD Render Pipeline and it looks like the Volumetric Clouds materials are rendering pink. Tried removing the plugin and re-importing.

    Wanted to check if it's expected they will work with the HD Render Pipeline at this time, thanks!
     

    Attached Files:

  26. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I tried playing around with it to see if it was easily fixable but unity doesn't even provide us any kind of feedback as to what the error is about, doesn't even show the shader as not being compiled so until they fix that I'm not going to invest my time debugging in the dark. Once they do though, I definitely will try to make it work with HDRP don't hesitate to send me a message if I didn't say anything when they end up fixing that !
     
  27. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    You could use 'Distance Blend' coupled with 'Draw Distance' to blend with the skybox, in most case that's more visually pleasing than unity fog.
     
  28. Hobsonite

    Hobsonite

    Joined:
    Sep 13, 2017
    Posts:
    2
    Makes sense! Thanks for the response.
     
  29. BitMax

    BitMax

    Joined:
    Apr 11, 2013
    Posts:
    4
    Hey Eideren,
    Thanks for making a cool and useful asset! I am having a few issues getting my clouds to spread evenly.
    Is there a way to set a bounding box/area size for the clouds? Right now there's a long strip off to the sides and what's around the camera is oddly clipped. After playing with settings I wasn't able to remedy this.
    Also when I move the camera the clouds get oddly clipped and change shape, is this intended?

    Settings:

    Scene:


    Thanks
     
  30. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    That's weird, could you send me a small repro project ?
     
  31. jekifow

    jekifow

    Joined:
    Jan 27, 2019
    Posts:
    3
    Turns out it was an issue with a specific scene!

    By the way is there a way to have the clouds not mirrored along the middle? makes it seem like a reflection from a lake when looking at them head on.
    Also will there be HDRP support in the future?

    Thanks!
     
  32. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    If you're reffering to spherical clouds then you could try with a different mapping by changing the variable on the material called "Spherical Mapping".
    As for HDRP, once unity fixes their stuff, sure.
     
    Last edited: Mar 4, 2019
  33. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    Hi! I just bought VC, but can't get them working in runtime. It's sure my setting or something.

    If I activate "in editor window" checkbox, then I can see the clouds. Just somehow not in runtime. I use 3 Oculus Camera rigs, that need to have the same name, otherwise the oculus api doesn't recognize it. :/ The last layer is for the environment, where I have attached the Raymarched Clouds script. My project is for a client and runs in forward mode, since I it is for VR. I also attached following depth script somewhere on a an empty. My Unity Version is 2018.3.0f2

    Code (CSharp):
    1. using UnityEngine;
    2. [ExecuteInEditMode]
    3. public class EnableDepthTexture : MonoBehaviour
    4. {
    5.     void Start()
    6.     {
    7.         Camera.main.depthTextureMode = DepthTextureMode.Depth;
    8.     }
    9. }
    Can't await to see them properly in action!

    thanks in advance!
     
  34. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hey, does it run in a build with a non-VR camera ?
    I don't have any HMD so I don't really know if the asset work as-is in VR.
    If it is a VR related issue, debugging it is going to be a real pain without a proper device ! If you have time on your hand we could try debugging it together or if you know of a tool to emulate VR display I should be able to do it myself but if neither of those are feasible I wont be able to resolve that issue.
     
  35. Wawwaa

    Wawwaa

    Joined:
    Sep 30, 2017
    Posts:
    165
    Hi Eideren,

    Thank you for this great asset.

    I am, too, like a previous user, using this asset for generating clouds around a sphere in my game. When I isolate the asset from the rest of the game code, everything works fine (I handled the floating point problems). But, in my game scene, clouds stay alive for a few seconds then they disappear.

    In my game I update the cloud sphere center by these lines whenever an origin fix is performed:

    Vector4 cloudsCenter = new Vector4(currentPlanet.transform.position.x, currentPlanet.transform.position.y, currentPlanet.transform.position.z, 0);
    playerCam.GetComponent<RaymarchedClouds>().materialUsed.SetVector("_CloudSpherePosition", cloudsCenter);

    These lines seem to be executed successfully, I don't think it is the reason for clouds to disappear after a few seconds.

    Do you have any idea about how I should proceed?

    EDIT: It seems they are there in day time but they disappear on night time.

    EDIT2: Yep, I am confident with the current use. Please, ignore my message. And thanks for this great asset.
     
    Last edited: Mar 8, 2019
  36. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hello !
    No biggie, do come back if you still have issues !
     
  37. MixedupJim

    MixedupJim

    Joined:
    Mar 12, 2018
    Posts:
    7
    Hi, thanks for this awesome cloud generator! I do have one quick question...

    In my game I have a floating origin point but when I move the camera the clouds pattern changes noticeably. I'm guessing this is because the cloud centre is based on the world position of the camera. Is it possible to change this to work from a local position from another game object?

    ***UPDATE***

    Worked it out! I need to use the Z & W Cloud Transform offsets.
     
    Last edited: Mar 24, 2019
  38. ChainsawFilms

    ChainsawFilms

    Joined:
    May 28, 2016
    Posts:
    18
    Hello. Does this asset support several cloud systems at the same time, I need to put clouds around different (small) planets in a small level. Thank you.
     
  39. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Yes but you'll have to sort them manually if you don't want farther away clouds rendering in front of closer ones, I.E.: set their Material.renderQueue based on the distance of the clouds' center to your camera. That might not be necessary depending on your setup.
     
  40. ChainsawFilms

    ChainsawFilms

    Joined:
    May 28, 2016
    Posts:
    18
    Thanks for the answer. I should mention it's a 2 player game, one person on a VR headset and one person on the PC screen, both playing on the same PC, so I'll need to work out how to sort per render device. Could be tricky :)
     
  41. Resident-Emil

    Resident-Emil

    Joined:
    Jun 23, 2015
    Posts:
    4
    Hi,
    I'm using your fantastic asset to make clouds around a spherical planet. it works quite well. The problem I have is with the control of the cloud texture. I am trying to create shaped clouds in the sky as hints to players, but it is just not possible to control the mapping of the texture to the spherical clouds. I get repetitions and ugly seams and stuff. Is it possible to somehow get better control of how the normal map is mapped to the spherical clouds layer?
     
  42. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I'm not quite sure I understand what you're trying to achieve, if you want some clouds to have a specific shape like an arrow or similar you could use a coverage map to mask out the shape, if that's not it could you please elaborate ?
     
  43. Resident-Emil

    Resident-Emil

    Joined:
    Jun 23, 2015
    Posts:
    4
    I can make clouds with specific shapes, like an arrow or something. Though I managed to do it with my own custom normal map instead of the coverage map. However, I can't figure out how the textures (normal map and coverage map) are mapped to the sphere. No matter how I tweak the settings I get either repeating textures, bad stretching or ugly seams.
    To clarify what I'd like to achieve:
    I'd like to have uniquely formed clouds appear at specific points on the globe. So, for example, a giant arrow-shaped cloud in the sky. But I only want this arrow-cloud at one specific point in the sky.
    Could you possibly make an example setup with how you would implement specific cloud formations on a spherical sky?
    I'd be very grateful :)
     
  44. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Here's a material setup for a 10k sphere with an arrow stamped on the top part of it, verify that the texture within has its repeat mode set to clamp and the coverage map on the material is set to that texture.
    To control the position and size of that texture on the sphere you change the coverage map's tiling and offset.
     

    Attached Files:

  45. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    Hello,

    i have update to the new version of volumetrics clouds that looks awesome

    but i have this error message
    Volumetric Clouds : Directional is not supported.
    and it's still working but increase the error per frame wich doesn't look really sexy...

    Annotation 2019-05-30 124739.jpg
     
  46. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    ho... and i deactivated the script and reactivated it, and the problems has gone...
     
  47. fdprayoga14

    fdprayoga14

    Joined:
    May 16, 2014
    Posts:
    2
    id like to render 360 video but its not working.. any setting should i use to make it work?

    i'm using Unity Recorder
     
  48. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I'm not sure, in the worst case you should be able to work around this issue by placing meshes all around the camera to occlude its view and setting their material by your preferred cloud one.
     
  49. Cookieg82

    Cookieg82

    Joined:
    Mar 28, 2017
    Posts:
    73
    Hi,

    Just purchased this asset. I have a problem.

    I use Cinemachine and I cannot seem to get it to work? Any ideas?

    Errors are in capture image

    (To add, I have placed the script on the virtual cam, it just errors out again. Saying there is no camera?)

    **EDIT** Just seen a comment above about High Render /Low Render etc. I bought this assets with the understanding it worked across the platform regardless? No mention of pipeline issues before buying. The information at time of purchase is missing regarding what it does and does not work with. Misleading.

    Thanks
     

    Attached Files:

    Last edited: Oct 7, 2019
  50. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hello,

    Sorry about that, the asset store page has been changed to reflect that, it has to be reviewed by unity first so it'll take some time to go live.
    The last update for this package was in january and at that time hdrp and ldrp were really early and small features, given that it didn't really make sense then to specify that this asset didn't support them (it's kind of the other way around since unity decided to break everything but I digress).
    I can refund you if you want, you just have to send me your invoice number by email (contact at eideren dot com).