Search Unity

Volumetric Clouds

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

  1. IanNicolades

    IanNicolades

    Joined:
    Oct 1, 2016
    Posts:
    40
    Hi there,

    What's the proper procedure for spherical planets where the Unity camera remains at 0,0,0 with the rest of the world positioned around it?

    I've enabled Spherical and Spherical Mapping, set Cloud Transform.y to the size of the planet, and _CloudSpherePosition to the inverse of the camera's real-world position, but still don't see any clouds. If I lower the dimensions and leave Sphere Position at 0,0,0, clouds show up, but are centered around the camera and quite wrong.

    Thanks!
     
  2. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hello !
    _CloudSpherePosition works as intended, your issue is kind of outside of this asset's scope but if you share your project with me I might be able to help you with it, without it I can't really see what could be wrong.
     
  3. BellBlitzKing

    BellBlitzKing

    Joined:
    Feb 9, 2018
    Posts:
    11
    @Eideren Writing to ask about how to do a few mods to your cloud formation, outside of a flat plane and the ways your clouds are responsive to interactions or the world around it. Tips welcome on how to fake any the formations.

    1. Cloud avoidance: How could a hole in the clouds area be achieved? In our world, there are non-flat cloud formations like that. Your volumetric clouds to avoid a certain invisible circular plane, like 'go around it' / avoidance perhaps? The eye of a hurricane which is a curved Wall of cloud, (when viewed from the ground not from the sky) is a heavier example besides the first two images below.

    2. Cloud rings:
    Is there are way to get your clouds to move along a ring or loop formation/path? Like what you see after a nuclear explosion, clouds circling back onto themselves but within the area of a halo shape-wise.

    3. Cloud splitting:
    Can you cloud dynamically split or fade when an object hits or goes through it? Or a way to fake it? For example when an orbital lazer or hot energy beam cuts a circle through them, OR a shining sun ray through a hole that closes once the ray fades away?

    4. Clouds cut: Skyscrapers and planes often cause a sliced line in the clouds overall.










     
    Last edited: Nov 26, 2019
  4. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hello,
    For point #1, #3 and #4 take a look at the Coverage Map on the material, look at the online guide for more info.
    As for #2, not really, that's something whose implementation would vary based on the particular effect that you want to create.
     
  5. BellBlitzKing

    BellBlitzKing

    Joined:
    Feb 9, 2018
    Posts:
    11
    Thanks Eideren for responding so fast, I'll explore the coverage settings and experiment to get the right visual. Keep up the good work
     
  6. jake_vr

    jake_vr

    Joined:
    May 21, 2017
    Posts:
    6
    Hey, this asset looks great! Just wondering, how does it perform in VR (both PC based and Android based)?
     
    patek_ likes this.
  7. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Earlier versions of unity might work but current ones probably won't as I received a mail a couple days ago mentioning stereoscopic issues in VR. I can't fix those issues right now as I don't have an headset.
    As with any heavy image effects, this won't work too well on most mobiles, if you think that ambient occlusion is fine to run on your target hardware you could try it.
     
  8. jake_vr

    jake_vr

    Joined:
    May 21, 2017
    Posts:
    6
    Hey thanks for your reply. Are the stereoscopic issues just to do with the shadows? We might not need cloud shadows for our project - is there a setting to turn them off?
     
  9. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    You can disable cloud shadows but that person mentioned the clouds specifically so I wouldn't bet on them working right.
     
  10. jake_vr

    jake_vr

    Joined:
    May 21, 2017
    Posts:
    6
    Ok thank you
     
  11. JPhilipp

    JPhilipp

    Joined:
    Oct 7, 2014
    Posts:
    56
    Terrific asset!

    Like someone else said, you may get a "Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5" error message when attaching RaymarchedClouds to your camera; this happens when the camera is contained inside a person that uses a non-kinematic rigidbody (useful instead of a CharacterController for some physics-based apps).

    To work around this, in the CreatePlane function you can change the line

    Code (CSharp):
    1. DestroySafe(planeGO.GetComponent<MeshCollider>());
    to

    Code (CSharp):
    1. MeshCollider collider = planeGO.GetComponent<MeshCollider>();
    2. collider.enabled = false;
    3. DestroySafe(collider);
    (Alternatively, DestroyImmediate(), but that's not recommended by Unity.)

    In my tests, this code change fixed the issue and was side-effects-free, so may be a candidate for default inclusion in this asset.
     
  12. zoulinxiaoa

    zoulinxiaoa

    Joined:
    Dec 5, 2018
    Posts:
    3
    I have a question if I have an mirror like this https://www.cnblogs.com/chinarbolg/p/9601388.html
    or an water like-SUIMONO - WATER SYSTEM ,how can I reflaction the Volumetric clound on the mirror or water?could you give me some tips or something?
     
  13. shi946

    shi946

    Joined:
    Jun 3, 2019
    Posts:
    16
    Your asset is AWESOME. I wanted clouds around some planets, I got clouds around them planets :)

    Edit: By the way, is there any method to gauge where the clouds are? Doesn't need to be exact, just to tell if there are or are not clouds at a position.
     
    Last edited: Aug 1, 2020
  14. MixedupJim

    MixedupJim

    Joined:
    Mar 12, 2018
    Posts:
    7
    Hi,

    Is there any update on the issue with clouds in VR. I've been using this asset in a VR app and it runs great but the shadows cause a strange effect almost like a reflection in them.

    I'm not sure what causes it.

    It's a shame because the cloud shadows add so much to the look of the game.

    Does anyone have any idea what might be causing it?
     
  15. Wawwaa

    Wawwaa

    Joined:
    Sep 30, 2017
    Posts:
    165
    Hi, any news about HDRP support?
     
  16. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @zoulinxiaoa Follow the manual but instead of placing it on the player camera, do it for the mirror/water camera

    @shi946 The asset comes with a 'CloudsEvent.cs', that component fires unity events when it enters and exits clouds

    @MixedupJim I don't have an hmd so this isn't easy to fix on my end but if you PM with a preview of the issue I'll see what I can do.

    @SinDeSiecle Well, after taking a long look at it I can't justify putting in the work to support hdrp; the shader graph is far too simple so I have to actually write it and there's very little resources on that, the resources I did find showed a completely different api than what previous shaders used and when changing that they didn't even try to make the writing experience for those any better, what's the point.
    Sorry I couldn't help you ...
     
  17. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    Hi,
    I just picked this asset up a few days ago. I'm using this asset on Unity version 2020.1.4f1 and it works well enough despite the reviews I found on the store page. Looks *highly* decent too!

    I read a few posts of people trying to get the clouds to render at massive scales and distances. And that some may have had success with that approach. So I ask has any one had any success with that?

    @Eideren Thank you for providing this asset!
    Do you plan on continuing to develop this asset? Or perhaps developing a version 2.0?

    Regards
     
    Last edited: Feb 18, 2021
  18. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @pratt_timmy
    Hey, thanks a bunch ! Yeah it's been a while since I did anything with this asset.
    You should be able to figure things out with the manual it has tons of tips to increase view distance and such.

    As for continuing this asset, I would have to fix things for all of the new render pipelines first and that stuff on the shader front is just changing things up for the sake of it instead of actually fixing stuff. I'll take a look in a couple of days but I can't promise much.
     
  19. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    @Eideren Sounds great. Might have few questions for you.
    I'm using it in a project to render some clouds around a planet.
     
    Last edited: Feb 21, 2021
  20. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @pratt_timmy doing this properly would require additional changes but you can swap line 383 from
    normals = TransformNormalsAroundSphere(normals, normalize(samplePos - _CloudSpherePosition));

    to
    normals = normalize(lerp(normals, samplePos - _CloudSpherePosition, 0.5));
    and get good enough results
     
  21. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    @Eideren Thank you. For the help :).
    I figured out how to use these clouds around a large planet by using scaled space layered onto normal space. Normal space is 1:1, scaled space is normal space divided by 100000. I adjust the shader's Raymarching settings at runtime as the scaled space camera's altitude changes and It looks pretty decent with good performance. The only problem is that normal space obviously can't receive any shadows from scaled space clouds. I can render the shadows onto a scaled copy of the planet when viewing from a distance but as I approach the planet I need to begin rendering 1:1 and the shadows would disappear as scaled space fades to normal space. I played around with the clouds at 1:1 scales and I see that you must dynamically adjust the script's "Plane Offset" field or else the shader will not render properly at distances above 1km unity units. And you'll get something like this

    My question: Is there a work around for rendering non-volumetric Shadow's Only when dealing with large distances and 1:1 scales without having to adjust the Plane Offset field? I just need the shadows the clouds cast when at 1:1
     
    Last edited: Feb 23, 2021
  22. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I don't think I understood your setup or what you're trying to do, sorry, could you rephrase that ?
     
  23. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    @Eideren Yes of course.
    The project generates planet terrain at 1:1, I use one camera to render this. I translate the 1:1 camera position and rotation relative to the planet to another camera's rotation and position scaled by 100000. The scaled camera renders the clouds using using your script with spherical settings on top of the 1:1 camera. This way the clouds look good even from far away.

    The problem I have is figuring out a way to render the cloud's shadows onto the 1:1 terrain. I'm looking at the code trying to figure out if there is a way to render only shadows over greater distances than is currently possible. Maybe I am doing something wrong but at ranges above a few km I get results like in the screen shot from my previous post without adjusting the Plane Offset.

    Edit: Ah looks like I didn't know what I was doing. I was doing something wrong. This might work as is
     
    Last edited: Feb 23, 2021
  24. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    So here's something. If your looking at the clouds from inside the sphere's radius the clouds look fine. If you look at the clouds from outside of the sphere's radius you get this
     

    Attached Files:

  25. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @pratt_timmy go through the section in the manual about the raymarcher, you'll have to tweak those values
     
  26. roundyyy

    roundyyy

    Joined:
    Dec 23, 2019
    Posts:
    112
    Hi, Are you planning to update for single pass stereo rendering? Unfortunately bought it and doesn't work
     
  27. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    I don't have any HMD at hand so I can't implement it and debug it properly, sorry. If you send me your invoice at contact(at)eideren.com I can refund you.
     
  28. roundyyy

    roundyyy

    Joined:
    Dec 23, 2019
    Posts:
    112
    No worries, I will keep it, maybe one day you will get HMD (trust me it's great fun ;) )
     
  29. SERGIOMACHIN

    SERGIOMACHIN

    Joined:
    Jan 10, 2019
    Posts:
    2
    Hola, es compatible con android?, no consigo hacer que funcione.
     
  30. SERGIOMACHIN

    SERGIOMACHIN

    Joined:
    Jan 10, 2019
    Posts:
    2
    Lo he comprado pensando que sería compatible con android.
     
  31. AkumaGameStudio

    AkumaGameStudio

    Joined:
    Mar 29, 2015
    Posts:
    7
    Hi @Eideren , would you please update to URP, i do need this clouds so badly to work at urp
     
  32. kidne

    kidne

    Joined:
    Nov 29, 2013
    Posts:
    27
    I purchased this because it said it can be "interacted with through an event system". There's nothing in the documentation about how and what this means. I'd like to make a poofy particle effect when a player flies in and out of a cloud through Triggers like onTriggerEnter for example. How would I do this?
     
  33. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Yes, add the "CloudsEvent" component in the scene and fill in its "events.monitoredTransform" with whichever object you want to detect going in and out of clouds. That event's OnEnter and OnExit will trigger when the transform enters and exits cloud. You can set OnEnter and OnExit like you would for other unity events to trigger particles and co.
     
  34. unity_nItJOqbQ4Wmi9Q

    unity_nItJOqbQ4Wmi9Q

    Joined:
    Apr 20, 2021
    Posts:
    1
    I bought and download the latest version and the CloudsEvent prefab only has a missing scritp, theres any solution to this?
     
  35. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    That shouldn't happen, does the console print any error when you reimport the folder ?
     
  36. AkumaGameStudio

    AkumaGameStudio

    Joined:
    Mar 29, 2015
    Posts:
    7
    Are there any plans to support urp?
     
  37. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    Please 1st check "latest release date" for each plugin, which are the updates in the asset store!
    This plugin is out of any question > last update is from Jan 2019! Means, it's dead!
    URP stuff needs to be not older than 2-3 weeks, because Unity changes URP every upcoming month, because they simply don't know what to do or how to do it. ^^

    This plugin is dead!
    https://assetstore.unity.com/packages/vfx/shaders/volumetric-clouds-25527


    you might want to checkout InfiniCLOUD (HDRP & URP!)... because this one has not only a ton of features, it is also supported for URP and the latest update is from Sep 17, 2021, as it should be, if you are working on URP!

    https://assetstore.unity.com/packag...d-hdrp-urp-volumetric-clouds-particles-154133
     
  38. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @AkumaGameStudio What I said about HDRP a couple of posts above your first is valid for URP as well; it would be a huge waste of time right now to support and continually update for all the *RPs, it's not financially viable, once they are stable enough I'll re-evaluate.
    You can try out InfiniCloud as @SOIL proposed, at more than four times the price of my asset you get what you pay for.
    I still provide support for anyone using this asset and have a couple of minor fixes I'll push to the store once I have a larger update.
     
  39. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    32
    @Eideren
    Hey. Sorry to bother you but I'm having a problem. Was wondering if there was some sort of fix. I've been tweaking the values for the raymarcher like you've suggested but I can't seem to solve it.
    I'm rendering clouds using the spherical option in the Shader around a pretty large planet. Getting static looking artifacts when above a few thousand units outside of the sphere but when inside of the sphere there are no artifacts at all and at any distance. You can see whats happening in the video.


    Edit: I figured out a fix.
    Line 232 of VolumetricCloudsCG.cginc
    Changed:
    return distance(samplePos, _CloudSpherePosition) > CloudUpperBounds + .1;
    to
    return distance(samplePos, _CloudSpherePosition) > CloudUpperBounds + 10;
    Seems a bit hacky but it did the trick for now...
    I tried everything else I could; clipping planes, plane offset, etc. but no joy. Please let me know if this is a bad idea.
    Thanks
     
    Last edited: Feb 1, 2022
  40. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hello !
    You should be able to get a similar kind of result by changing the material value
    Cloud Transform
    's Y value, your change might lead to clouds rendering in unexpected ways but if you think it looks and performs fine, sure, keep it that way.
     
  41. Dehlar

    Dehlar

    Joined:
    Jul 30, 2018
    Posts:
    1
    Hi @Eideren
    Is it possible to create a better cloud coverage on top a spherical object? Playing around with the sphere mapping only resulted in the clouds forming on the outer rim (pic 1). I was wondering if I can achieve what you see in the 2nd picture with your asset pack (just volumetric, ofc).

     
  42. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Here's a zip containing a material setup for a sphere of scale 1000, you should be able to figure the rest out when comparing it with yours. upload_2022-2-10_5-41-51.png
    Enable and use the handles to position and scale it as you want.
    upload_2022-2-10_5-43-14.png
     

    Attached Files:

  43. SkygodGames

    SkygodGames

    Joined:
    Feb 23, 2014
    Posts:
    18
    Hello, IM currently using the latest version of Unity 2020 and for some reason when I add the script to the camera I see no clouds. The attached image only shows my skybox.
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      650.1 KB
      Views:
      220
  44. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    You have to toggle on the 'Attach To Editor Cam' if you want to see them in editor.
     
  45. kidmethuselah

    kidmethuselah

    Joined:
    Jan 14, 2021
    Posts:
    18
    @Eideren

    I'm trying to edit the shader during runtime for a weather system.


    Code (CSharp):
    1. cloudMaterial.SetFloat("_Coverage", 0.19f);
    2. cloudMaterial.SetFloat("_CloudDensity", 0.14f);
    3. cloudMaterial.SetFloat("_TimeMult", 17f);
    4. cloudMaterial.SetFloat("_TimeMultSecondLayer", 6f);
    All of the above works great. However, I cannot toggle between spherical and non-spherical no matter what i've tried. And I've tried a lot:

    Code (CSharp):
    1. cloudMaterial.SetInt("_SphericalMapping", 0);
    2. cloudMaterial.SetInt("_SPHERE_MAPPED", 0);
    3. cloudMaterial.SetInt("_SphereMapped", 0);
    4. cloudMaterial.SetInt("_SphericalMapping", 0);
    5. cloudMaterial.SetPass(0);
    I have tried all these properties and various combinations of them. Is there something I'm missing?
     
  46. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    _SPHERE_MAPPED is a shader feature, you have to manipulate it through Material.SetKeyword
     
  47. kidmethuselah

    kidmethuselah

    Joined:
    Jan 14, 2021
    Posts:
    18
    Amazing. Implimented in about 2 minutes.

    Imma give you a sick review