Search Unity

Volumetric Clouds

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

  1. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Negative... No console issues/warnings.
    Will try to see if it is something else...
     
  2. hampa

    hampa

    Joined:
    Nov 12, 2014
    Posts:
    5
    I'm unable to get the Depth Blend to work. It shows cloud but they don't blend with environment or objects.

    I've added Write Depth Textures script you posted and tried with various Rendering Paths.
     
  3. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    What OS are you using ? Shader forge or the standard one ? Does the shader displays the 4 check boxes (Depth blend, edge blend, complex lighting and normalized lighting) ?
     
  4. hampa

    hampa

    Joined:
    Nov 12, 2014
    Posts:
    5
    OSX, Unity 4.6. I have the 4 checkboxes. The Depth Blend changes the clouds but without blending with objects.

    I think the standard one, I'm use the one click cloud prefab.
     
  5. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Could you check if unity's soft particles acts in the same way ? (Enable soft particle in unity's settings, put a soft particle material over a mesh and make that mesh clip with another non-soft particle mesh)
     
  6. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Version 1.3 finally available, here's the change log :
    Version 1.3 :
    New Features
    • Light color intensity can now be controlled via the alpha of the base color.
    • Rewrote how the planes are generated, the script can now generate curved planes.
    • Created a second shader which will only be used to cast shadows, really fast compared to the older one !
    • Wrote a custom inspector for the script.
      • Added the functions above.
      • Rearranged variables position.
    • Rewrote the custom inspector for the shader.
      • Design changed from messy inspector to a little bit more practical.
      • Extensive help available inside the inspector, a little toggle will show a description and some tips under each variables.
    Bug Correction
    • Fixed an error with the normals calculation in the shader, it shouldn't shade the wrong direction when the light direction is horizontal.
     
  7. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    Hi just bought this as it looks really great, but I'm having trouble getting it to work in a 2D environment. I want to simply rotate the Game Object's x axis, but I get what looks like barcode if I do that. If I leave the rotation alone I can see the clouds in the y direction. How can I get this to appear correctly as a background for my 2D game? I'm not using shader forge. Just standard.
     
  8. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Naphier Hi ! Sorry for the late reply, you could curve them or give them a rotation below 90 on the x axis. I'll pm you a specific shader that'll get rid of this.
     
  9. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    Sweet, I've got the modified shader and it seems to be working perfectly. I haven't read through the code for it yet, but I'm curious if it is fully compatible with the original shader or breaks its functionality?
    Thanks!
     
  10. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Naphier I changed the UV being calculated using the x and z axis in world space to a UV mapped to the geometry(same thing as an uv for your 3d objects).
    It wont break anything besides world alignment.
    You're welcome !
     
  11. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    Unfortunately the new shader doesn't appear to work on mobile (Android 5) for some reason. The original does and I can set the x axis to 315 deg and see it working. New shader works perfectly in the editor.
    Any clues?
     
  12. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Naphier That's really strange, it might have something to do with how i fake the double sided rendering(saves performances when you aren't looking at clouds), could you try running the shader with the option "Curved" turned on, input two segments and reorient them to face the direction you want.
    If that didn't work, could you write down the exact process you are going through when using them on mobile ?
     
  13. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    I've tried a few different options now and no go.
    Current setup:





    I've tried flipping normals, rotating the meshes 180, and using curves.
    I hope this helps and I appreciate the assistance!
     
  14. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Naphier I sent you another pm, hope that fixes it.
     
  15. Andit

    Andit

    Joined:
    Feb 27, 2015
    Posts:
    6

    I seem to have an issue with the clouds flickering at higher distances, is there something I am doing wrong?
     
  16. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Andit I can't seem to reproduce your problem, what's your setup ? What version of unity are you using ?
    Is the flickering happening in play mode too ?
     
  17. Andit

    Andit

    Joined:
    Feb 27, 2015
    Posts:
    6
    Ok it seems that my problem was due to some scripts that were not calling animations properly. Thanks anyway!
     
  18. OneManStoryBook

    OneManStoryBook

    Joined:
    Jan 12, 2015
    Posts:
    7
    Does this asset work with Unity 5?
     
  19. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Yup, I am using unity 5 atm and it works just fine.
     
  20. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Hi there Eideren,

    Can you update the cloud shader to use Light Probes in unity 5? Using a single light probe to sync the color gardient of the clouds with the sky could be amazing...
     
  21. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Project Mysh Unity changed quite a lot of stuff with version 5 and they didn't really document any of them ...
    I'll try to implement that as soon as I know about it !
     
  22. Uncle-Sam201

    Uncle-Sam201

    Joined:
    Mar 22, 2015
    Posts:
    1
    Awesome plugin, with a great price!



    Also take a peep at a small video here and here!
     
    Last edited: Mar 23, 2015
    Eric2241 likes this.
  23. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Hey,

    I just got your asset and I really like it. It works perfectly. But I've come across a problem when I enable shadow casting. This is how the clouds look when I enable it:



    Am I doing something wrong?
     
  24. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Goldenvale That's really strange, could you share the settings of the shader and the script ?
    Are you using a custom shadow map, something like Shadow Softener ?
     
  25. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    @Eideren


    Here are the settings:




    I'm not using any custom shadows
     
  26. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Goldenvale That's not it, if you strip down everything in your scene does this strange shadow still appear ? If so, could you pm me the project with what's creating it ? And if it still does it after the strip down, do you have another PC or device to test it on ?
     
  27. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Nevermind, I think it's something in my scene that's creating the issue. I won't be using the shadows feature anyway. Thanks for the reply and keep up the good work.
     
  28. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Just bought. Black background on deferred, fine on forward. We use Unity 5 deferred... :(
     
  29. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Also seeing that strange fringing. Mac, Unity 5, deferred.
     
  30. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @hippocoder + @garyhaus
    Sorry about that !
    Deferred and legacy deferred are fine on my end and I'm using the latest update ...
    The shader should supposedly render in forward mode even in deferred rendering since transparency isn't supported in deferred.
    I don't remember if I changed anything since the last update so I'll send you my files.

    If it still doesn't work, could you try out the shadow caster material alone on a unity plane and then the cloud material to see which of the two bugs out ?
    Could you post some screenshots as well ?
     
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    More info: we use linear with HDR on camera and classic tone mapping (as is necessary for HDR).

    Tried the latest you linked to but no joy. Regarding screenshot, well it's just overwriting skybox with black from what I can see. The clouds are still present, it just is on a black background.
     
    Last edited: Apr 30, 2015
  32. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @hippocoder So that's your setup ?

    It's fine on my end...
    It might be a drawing order issue, anyway, I sent you two other shaders, I hope those works.
     
  33. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Will give it a go ASAP. Thank you!
     
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Correct, but camera must have HDR ticked on, and the post effect tone mapping applied. The camera's clear settings are set to Skybox and the skybox is applied within the Lighting window (procedural unity skybox)
     
  35. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Another issue I notice is when installing your package, shader keywords break in other packages. I wonder if you're using a lot of them?
     
  36. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @hippocoder + @garyhaus
    I guess those shaders didn't work either.
    I'm currently looking for another PC to test the shader on, I'll try to fix those problems if I can finally recreate it.

    That shader has 4 on and 4 off, I could probably remove the off and put an #elseif.
    It's probably because you hit the 64 keywords limit, I dont know if it is still the limit though.
     
    Last edited: May 1, 2015
  37. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It breaks Amplify Motion's one. I guess it's project wide so I should start trimming shaders. Did you do your tests in DX11 or are you on a mac?
     
  38. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @hippocoder Dx11.
    128 seems to be the limit according to unity's doc.
     
  39. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @hippocoder & @garyhaus I finally got my hands on another PC, did a clean install of unity and I still can't replicate that error...

    @hippocoder Are you using a mac as well ?
     
  40. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @hippocoder & @garyhaus I sent you a cutoff shader, it shouldn't have the same problem but it wont support transparency.
     
  41. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Seems like it has magically cleared itself up... Ugg I cannot figure out why it is all of a sudden working again... Anyway, it works and thank you...

    Gary
     
  42. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Have you tested the CloudsShaderForgeEdition with Unity 5.02p1 and ShaderForge 1.13(latest version)? I'm getting this when I try to use it:



    I've seen this kind of thing before from ShaderForge. I think it was an old version corrupting shaders.
     
  43. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    That's just shader forge 1."something" defaulting the rendering to dithered cutout, you just have to open the blending menu, turn off dithered alpha clip and compile it.
     
  44. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Thanks, that was it. Now to figure out why the SF shader is so much darker than the other one.
     
  45. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    I've been playing with this on my own with no luck: Is there any way to get blurrier(not as hard edges), lighter(less alpha) shadows with the cloud shadows? I'm just trying to make them appear a bit more like real life while still having hard, dynamic shadows from objects close to the ground.
     
  46. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Well, if I knew that it would already be implemented ;) .

    Before Unity 5.0 it was impossible without a lot of trickery (aka using projectors which are a pain to set-up and don't really work on complicated situations) since the pixels in the shadow map(light attenuation) where either black or white(black = shaded, white = lit) (I wont really explain why since that's a really vast subject and It's not entirely related to this feature).

    The guys at Unity changed the way shadows are filtered in Unity 5.0 and now it is technically possible, alpha objects are rendered in the shadow map using dithering (it's kind of like creating holes in the shadows, +transparent -> +holes) and then the shadow map is filtered(blurred), the holes are averaged and appears as if they are a lighter kind of shadow.

    The problem is that it's only available on their "Standard Shader", I didn't find any documentation as to how we are supposed to implement it.

    If you did find something that could help, drop by this thread and I'll be happy to look at it and implement it.
     
  47. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Isn't the Standard Shader source available or is it just impenetrable to read? I'll have to do some more looking into those shadow changes in Unity 5 you're talking about.

    edit: Oh yeah, does this support Deferred render? I get black halos at the edges of the clouds when I switch out of Forward.
     
    Last edited: May 22, 2015
  48. Chaerephon

    Chaerephon

    Joined:
    Jan 3, 2013
    Posts:
    8
    Hi Eideren,

    Just wanted to say I'm loving these clouds.. will aim for 2x layers in the final build.

    Screen Shot 2015-05-23 at 11.11.13 am.png
    Screen Shot 2015-04-25 at 3.56.25 pm.png
     
  49. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    We might find something by skimming over the builtin shaders but it's a gigantic mess, I'll try to dive back to it when I have enough free time.

    Yeah, some people reported that but i can't find why it would render that way, you got the same thing with the SF shader and the normal one, right ?
     
  50. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Looks really nice !
    Really nice job on that map, is it based on real world data or did you reproduce it ?