Search Unity

[Released] kode80 Volumetric Clouds (Ver 1.1.0)

Discussion in 'Assets and Asset Store' started by kode80, Dec 4, 2015.

  1. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Yup they are truly volumetric. Each frame is rendered by raycasting through the atmosphere, using various layers of 3D noise to represent the clouds.

    Currently you cannot fly through the clouds. Although as mentioned before, this is purely an implementation detail. I just need to add a separate render path for this case. If there's enough demand for this I can add it.

    It's been a long time coming, but I should be releasing this on Monday, so you can try it out for yourself then!
     
    wetcircuit likes this.
  2. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    As for me I do want (and need) this feature. :D
    That's great!

    Another question, you also will add lights (or can be easily added) in the clouds during storms?
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Is it possible to extract a very vague or rough mask of cloud coverage (that has no impact on performance) or a basic idea of how much cloud there is nearby? the reason for it is to shadow the landscape / know roughly how to tweak lighting my end.

    It's not a killer feature or very needed but its a nice thing to consider for polish pass later. Perhaps during the generation of the effect, you will have a texture already available - and we can just take a look at that.

    Not fussed, but waiting until monday is a chore! :)
     
    spraycanmansam and eskovas like this.
  4. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Adding additional lights is possible technically, but would definitely add a decent chunk of overhead per light, per pixel. It's certainly something I can look into for a future update.

    However, since all lighting/rendering properties can be updated in realtime, you may be able to 'fake' lightning by animating light color/scalars etc. to give a similar effect. I haven't tried this for your specific case but it works great for various times of day.

    The coverage map does exactly this, is what you author in the coverage editor and is available to you at runtime. I actually started an experimental shadow renderer pass a while back that uses the coverage map to add cloud shadows to the global shadow map. It works well enough in it's rough state, I just need to finish it. This is something that's definitely on the roadmap.
     
  5. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Very nice. Will probably pick it up. Could you make your default install path inside Plugins folder like most assets do? This prevents recompilation each time a user compiles one of their scripts, and keeps projects manageable. Great work!

    Demo scene is broken as it relies on Input button being setup. A lot of projects will have different stuff ie an input manager from asset store or console stuff (ie. we couldn't add an input button to it if we wanted to) - no biggie as I can edit the source, just mentioning.
     
  7. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Thanks for the heads up, I'll edit the demo script to just use hardcoded keys so it doesn't rely on input manager.

    That's interesting about the Plugins folder, is there some official docs on this? I don't believe I've d/l a single asset that does that (they generally seem to use /CompanyName/AssetName/) and obviously all Unity's assets use a non-plugin folder too. It was my understanding that /Plugins is specifically for pre-compiled libraries, not for general assets. Also I thought that scripts are only re-compiled on changes?
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This sticky in the asset store forum should point you in a vague direction: http://forum.unity3d.com/threads/wh...-scripting-packages-editor-extensions.292674/

    It's preferred because projects can often contain a large amount of assets so keeping them manageable and preventing them adding to compile times is quite nice - I found I could move clouds in there and they functioned normally, but would not update unless I dragged the mouse with button down over the window. I guess it might be because I'm on 5.3 or something?
     
  9. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    I also didn't know this - great tip, going by most the assets I've ever downloaded, I think this one slipped by most author's :eek:
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm afraid I was misleading. It's in the ones I use, then, such as final ik and friends, ie high quality expensive ones with lots of care. Sorry for thread offtopic. Clouding the issue.
     
    punk likes this.
  11. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Thanks for the link, wow... just wow. o_O
    I'll do some more research, but I guess moving to /Plugins is the way forward (until it's not).

    Regarding only updating on mouse down, I'm assuming you're talking about the coverage editor? If so, this is the intended behavior since I figured people would prefer the performance savings when editing. If you go to the Editor Properties foldout in the Coverage Editor, there's a "Continuous Update" toggle that will enable continuous updates regardless of input.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    No, I just disabled the camera script with Input in it, and set up my camera, your coverage map, and my sun, then hit play. Clouds became visible but did not update animation wise unless I dragged the mouse across it with LB held down (in your demo scene).
     
  13. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    I see what you did there. :D
     
    punk and hippocoder like this.
  14. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Hmmm, that's very odd. Do they update camera-wise (i.e. you can look around correctly) and it's just the animation that's not happening? Also, was this the case prior to moving to the plugins folder? I'll take a look.
     
  15. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    True, final ik does always wondered why he did that and it does help uncluter things, @kode80 clouds looking great by the way ;)
     
    kode80 likes this.
  16. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Excellent! Congrats on the release @kode80 ! :)
     
    kode80 likes this.
  17. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Thanks, means a lot!
     
  18. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Non-commercial use is very generous! Thank you!

    Screen Shot 2016-04-12 at 10.33.17 AM.png
     
  19. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    You're very welcome!
     
    wetcircuit likes this.
  20. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hehe, good one man! I was planning to do the same but I see you did it before me :). I think it would save a lot of time with this solution if I won't continue with my personal implementation.

    By the way you used GPU Pro 7 Book + the Horizon Zero Dawn docs and ideas right? They look very very similar.
     
  21. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    It's a fascinating topic, definitely recommend learning about it if you're interested. That said, yes I've spent around 6 months development time on this asset (including building my own external app for generating custom 3D noise), so it's quite the investment.

    I haven't read GPU Pro 7, but the Zero Dawn doc is essential reading. I'd also highly recommend reading this: http://magnuswrenninge.com/productionvolumerendering
     
    Last edited: Apr 12, 2016
  22. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Hi Kode80. Congrats on releasing this. Looks amazing.

    Do you know if this will work and run at acceptable frame rates in VR for Oculus and the Vive? Very important for us VR devs to be able to use the latest and best assets that keep coming out to keep pushing VR graphics forward. Thanks.

    -Miguel
     
  23. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    With the Oculus DK2 it works perfectly, which is all I have access to right now (if someone wants to send me a Vive I'll gladly accept :D). Definitely curious to hear other's experiences performance wise with the new HMDs.

    One thing to note - Unity's native VR support doesn't report the correct pixel width/height (it returns the dimensions of the game view), which means if you have the kode80 Clouds component set to use camera dimensions they'll be rendered to a sub-optimal resolution. This is an easy fix however, simply alter these properties in the kode80 Clouds component:
    • Set "Render Size" to "Fixed Dimensions"
    • Set "Fixed Width" & "Fixed Height" to the resolution you wish (when using fixed dimensions the downsample property is ignored so remember to factor that in to your dimensions)
    Also of note, I experimented with stereo rendering of the clouds themselves but concluded it wasn't worth the overhead. The clouds are so far away that the stereo disparity is practically nonexistent. Interestingly enough, even though the clouds are monoscopic - the people I've demo'd them to have all mentioned how great the 3D is. The depth cues; both parallax and shading really do seem to fool the brain into believing they're stereo!
     
  24. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Thanks for the info. Good stuff.

    Forgot to ask I noticed it only runs in deferred with HDR checked. Any way this can run in Forward with HDR not checked as well? Doesn't seem to work in Forward unless I missed something in the options.
     
  25. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Nope that's just how I have the demo setup, there's no reason for it not to work in forward - all the actual cloud rendering is done in the fragment shader and it doesn't use any of the GBuffer info (or even depth buffer for that matter). The only geometry rendered is a fullscreen quad to display the cloud shader's output texture. I just double checked by starting a new project set to forward/LDR and everything worked as expected - so if you're having trouble, let me know and I'll try and figure out what the problem is.

    HDR isn't a requirement either, although if you're using LDR you'll want to lower the sun/ambient light scalar properties etc. otherwise you'll end up with blown out white clouds due to the lack of range.

    That said, personally I think HDR is worth the lack of HW AA, but obviously that's your call to make - I know a lot of people in VR are convinced that AA is worth w/e sacrifices you need to achieve it.
     
  26. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Thanks for the link, but I already knew about it (from the Zero Dawn paper, they put it in there along many other references) so after I found about it I've slept with it under my pillow :).

    But if you said it took you so long (6 months!) I think that your solution is a HUGE time saver. And releasing it for free (so that we can try it out and see that it exactly fit our needs) is an amazing step, I think that's the way to go.

    For example I had some questions about the looks of some ocean systems just because I couldn't try them out, but for your solution, after I saw it inside my game, it immediately convinced me that it is a must-have! That since in some videos things might look ok but after you rig them inside your game/solution they look quite bad :). Happened to me with some assets before. But not your case.

    Keep up the good work!
     
  27. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    It is an incredible asset. Thank you very much for sharing free to try, other assets developers should do like you.

    I tried a bit and I miss being able to fly through the clouds and above them. :p I also missed more types of clouds and the possibility of adding more sun light, for example a moon or another sun.

    I have to try it further to see if is for my game and then buy it.
     
  28. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Yeah, the Production Volume Rendering book is seriously great - a lot of amazing info in there. So pleased to hear you're happy with kode80 Clouds, really means a lot.

    You're very welcome, thank you for the kind words! In/above the clouds is definitely something I'm going to be looking into over the coming month and additional lights too.

    For now, you can easily emulate the moon by just changing lighting/density properties. The TimeOfDay script that's included is a good template for doing this sort of thing, just track the rotation of your 'sun' light and update cloud properties accordingly.
     
    Duende likes this.
  29. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Just a quick note. I've been working on a few minor bug fixes and features for the first update which will be released soon. Another key feature that will be in the first update (and all subsequent kode80 assets) is automatic asset updating directly in the editor, similar to how the Asset Store works.

    This means you'll be able to check very quickly if there is a new version available, what it contains, and download the new version - right from within the editor. I posted a quick vine of this here if anyone's interested:
    https://twitter.com/kode80/status/720689891336720385
     
    wetcircuit and Duende like this.
  30. Cunnah

    Cunnah

    Joined:
    May 27, 2013
    Posts:
    4
    Hi,

    I am very pleased with the results of this but I am having an issue with the render of the clouds. The clouds render over tree billboards any ideas or solutions?
     
  31. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Sorry to hear that, I've hopefully fixed it this evening. Let me know if this works for you. Just replace the following files with the versions attached to this post:
    /Assets/kode80/Clouds/Resources/kode80Clouds/CloudBlender.shader
    /Assets/kode80/Clouds/Resources/kode80Clouds/CloudBlenderEditor.shader
    /Assets/kode80/Clouds/Scripts/FullScreenQuad.cs

    I'll release an official update next week that includes this and some other minor fixes. If you're so inclined you can keep an eye on the develop branch of the GitHub repo, but obviously be aware this is an in-development branch.

    In other news, I've got ground shadows working nicely today. Should be in next week's update!
     

    Attached Files:

  32. Cunnah

    Cunnah

    Joined:
    May 27, 2013
    Posts:
    4
    Looking forward to it with those files I managed to fix the issue I had to set the billboard shader to que Transparent rather than Transparent-100 to fix it however. I am going to test if this is going to give me issues later.
     
  33. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Glad to hear that fixed it. If you had to move the billboard shader below the transparent queue, then in theory you should be able to fix by leaving the billboard's queue alone and setting the CloudBlender's queue to Transparent+100. Which billboard shader are you using? I'll give it a try.
     
  34. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Just posted a quick WIP video of raycast ground shadows. This feature will be available in the next update.

     
    Seith, moure, elbows and 1 other person like this.
  35. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That is super cool.
     
  36. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Thanks! Finally gave me an excuse to play with CommandBuffers too, made it super easy to run my shadows shader directly on Unity's screen space shadow mask - so the shadows interact correctly with other scene shadows and lights.
     
    Seith and hippocoder like this.
  37. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That is super cool times two.
     
    kode80 likes this.
  38. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    I downloaded your latest version and I get this error in 5.3 when playing your demo scene:
    Assets/kode80/Clouds/Scripts/CubemapExporter.cs(129,30): error CS0117: `System.IO.File' does not contain a definition for `WriteAllBytes'
     
    kode80 likes this.
  39. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    My apologies. This will be fixed in the update (hopefully releasing today). In the meantime, you can fix easily by:

    Moving:
    /Assets/kode80/Clouds/Scripts/CubemapExporter.cs
    To:
    /Assets/kode80/Clouds/Editor/CubemapExporter.cs
     
  40. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    That didnt fix it either. Same error.
     
  41. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Can you check if your current Platform is set to Web Player? If so, switch to PC/Mac. Turns out, even though this is an editor script, it still complains if Platform is set to WebPlayer.
     
  42. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    That did it. Although when I run the scene no clouds are visible. Theres a missing texture under "Cloud Coverage", just as an FYI. I added it and it works fine now. Looks great!
     
  43. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Excellent, glad that fixed it and you like what you see!

    The missing Cloud Coverage Texture reference in the demo scene will be fixed in the upcoming update.
     
  44. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    I would love to be able to fly through the clouds as well!
     
  45. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Alright folks, kode80 Clouds Version 1.1.0 is now available for d/l:
    http://kode80.com/downloads/assets/kode80Clouds.unitypackage

    Important: before you install this version, you should remove the previous version from your project. Certain files have been moved to fix editor conflicts and Unity's package installer does not handle moved/deleted files.

    Update Notes:
    * Added kode80CloudShadows component (place on directional light)
    * Added AssetUpdater (Window/kode80/Check for Asset Updates)
    * kode80Clouds now draws a gizmo for visualizing horizon/atmosphere size
    * kode80Clouds' transform now affects virtual skydome position in scene
    * Hardcoded input in demo's FlyCamera script (fixes Input Manager errors)
    * Fixed Coverage Editor's brush position for all atmosphere sizes
    * Fixed compile errors for < Unity 5.3.3
    * Fixed lighting when project is set to Gamma
    * Updated documentation

    Also a reminder, today is the last day of the 50% discount, tomorrow commercial licenses will be back to full price! Purchase a license from: http://kode80.com
     
    hippocoder and Lex4art like this.
  46. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    A few people have requested this feature. It's in the planning stages right now, and hopefully I'll have something to demo over the next month. Primary focus for the next few updates is making the core asset as good as it can be.
     
    Seith and Marked like this.
  47. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Great updates keep it up!

    By the way, as a little note I installed AQUAS-Lite demo and I also tested with the standard unity's advanced water and the clouds vanish like Houdini. So if you watch the sky and the water at the same time the clouds are just vanishing.

    I'm sure this has to do with the reflections, but if you have time, please, look into it. I think it is important since many projects/scenes will contain water with reflections.

    Kindest regards.
     
  48. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Thanks!

    I'll look into that. I did do some experiments with planar reflections a while back with mixed results. When the clouds are on screen, the reflections look great, but just like SSR, if the clouds are not on screen, then there won't be anything to reflect. My hacky solution, again similar to SSR, is to fade them out based on view angle - this actually works surprisingly well for water since fresnel + the water's normal map do a good job of hiding the flaws.

    Long term what I want to do, is create a kode80CloudsReflectionProbe component that will update a realtime cubemap for all cloud reflections. This is the ideal approach since you'll get proper reflections from any angle. I've already got an experimental version of this in place offline, the main thing is how to make it fast, which I have a couple of thoughts on.
     
    wetcircuit likes this.
  49. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I understand the problem. The water won't have anything to reflect if you are not looking at the clouds.

    But I was saying that the water is making the clouds just vanish when you look at them both. For example when you look far into the horizon without water the clouds are showing, all is ok. If I add the water they are just gone. That happens only in 'play' mode when the game is playing so I think it is related somehow with the script that calculates reflections for water.

    Attached 2 images, without water and with water. NoWater.png
    WithWater.png

    As soon as I enable the water the clouds are just vanishing. If required I can make a small demo project for that.
     
  50. kode80

    kode80

    Joined:
    Aug 1, 2013
    Posts:
    151
    Thanks for taking the time to explain and provide screenshots. I'm looking into this this morning, I suspect it's a draw order issue when the water is enabled, which should be an easy fix. I'll report back asap.