Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

ParticlClouds Package v2 (Volumetric Clouds!!)

Discussion in 'Made With Unity' started by ikke998, Aug 9, 2010.

  1. ikke998

    ikke998

    Joined:
    Jan 7, 2010
    Posts:
    79
    This is version 2 of my cloud package:
    The Main new feature is a fancy real Volumetric Effect.
    You can control the color of the cloud and the highlight!

    Demo1
    Demo2



    This package is a bit heavier on your system then v1, if you need thousands of clouds then I suggest you try out v1.
    If you want more accurate looking clouds, v2 is for you. :wink:

    now go download this package!!
     

    Attached Files:

    bzdur likes this.
  2. Pelajesh

    Pelajesh

    Joined:
    Dec 7, 2009
    Posts:
    363
    this is nice :) One question tho... Can I use it for my game?
     
  3. ikke998

    ikke998

    Joined:
    Jan 7, 2010
    Posts:
    79
    yes 8)
     
  4. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    655
    These are awesome. You do fantastic work on these.

    I'll bet you could do some fantastic fog as I love your work on these clouds.

    Do you have a PayPal account so I can pay you to do some fog for me?
     
  5. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,040
    These are fantastic.

    One question: Do they cast shadows?
     
  6. JRavey

    JRavey

    Joined:
    May 12, 2009
    Posts:
    2,377
    I like them a lot, but wish you wouldn't use Simulate In World Space on the particle emitter. When set that to false, you can parent them to something else and give a nice wind effect. It's time for lunch, but if anybody can't figure out what I mean, I will explain it later. Oh, and these make for some nice swampy fog.
     
  7. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    These look fantastic!.

    I would suggest to put some "parts of clouds" over each other because they look a bit "planar", like a thick planar area.

    I dont have in my project a real need for volumetric clouds, but yes could be a hot feature if these could be emited as dust or smoke trails to use as dust that comes from cars when driving in a dirty road or when braking hard or burning tires.

    Excellent work anyway and thanks for sharing!!!
     
  8. LieMan

    LieMan

    Joined:
    Aug 7, 2010
    Posts:
    6
    Hey,
    they look really really nice! But theres a problem if the camera goes too far away from the clouds. After a certain distance the get darker and darker until they get black. What can i do to prevent them doing this?
     
  9. ikke998

    ikke998

    Joined:
    Jan 7, 2010
    Posts:
    79
    Hmm does this only happen when Fog is on?
    I just noticed the shader has a set fog color

    Use this shader:
    Code (csharp):
    1. Shader "Particles/Alpha Blended" {
    2. Properties {
    3.     _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
    4.     _MainTex ("Particle Texture", 2D) = "white" {}
    5. }
    6.  
    7. Category {
    8.     Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
    9.     Blend SrcAlpha OneMinusSrcAlpha
    10.     AlphaTest Greater .01
    11.     ColorMask RGB
    12.     Cull Off Lighting Off ZWrite Off
    13.     BindChannels {
    14.         Bind "Color", color
    15.         Bind "Vertex", vertex
    16.         Bind "TexCoord", texcoord
    17.     }
    18.    
    19.     // ---- Dual texture cards
    20.     SubShader {
    21.         Pass {
    22.             SetTexture [_MainTex] {
    23.                 constantColor [_TintColor]
    24.                 combine constant * primary
    25.             }
    26.             SetTexture [_MainTex] {
    27.                 combine texture * previous DOUBLE
    28.             }
    29.         }
    30.     }
    31.    
    32.     // ---- Single texture cards (does not do color tint)
    33.     SubShader {
    34.         Pass {
    35.             SetTexture [_MainTex] {
    36.                 combine texture * primary
    37.             }
    38.         }
    39.     }
    40. }
    41. }
    42.  

    This shader ignores the Fog:

    Code (csharp):
    1. Shader "Particles/Alpha Blended" {
    2. Properties {
    3.     _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
    4.     _MainTex ("Particle Texture", 2D) = "white" {}
    5. }
    6.  
    7. Category {
    8.     Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
    9.     Blend SrcAlpha OneMinusSrcAlpha
    10.     AlphaTest Greater .01
    11.     ColorMask RGB
    12.     Cull Off Lighting Off ZWrite Off Fog { Mode Off}
    13.     BindChannels {
    14.         Bind "Color", color
    15.         Bind "Vertex", vertex
    16.         Bind "TexCoord", texcoord
    17.     }
    18.    
    19.     // ---- Dual texture cards
    20.     SubShader {
    21.         Pass {
    22.             SetTexture [_MainTex] {
    23.                 constantColor [_TintColor]
    24.                 combine constant * primary
    25.             }
    26.             SetTexture [_MainTex] {
    27.                 combine texture * previous DOUBLE
    28.             }
    29.         }
    30.     }
    31.    
    32.     // ---- Single texture cards (does not do color tint)
    33.     SubShader {
    34.         Pass {
    35.             SetTexture [_MainTex] {
    36.                 combine texture * primary
    37.             }
    38.         }
    39.     }
    40. }
    41. }
    42.  
    I have reuploaded the package with the correct shader!
     
  10. LieMan

    LieMan

    Joined:
    Aug 7, 2010
    Posts:
    6
    Thank you, that was it- :)
     
  11. cerebrate

    cerebrate

    Joined:
    Jan 8, 2010
    Posts:
    261
    these clouds are awesome. thank you.


    On a kind of similar note, would it be possible to write a script that actually makes the particle color based off the vertex color of a mesh particle emitter? I'm thinking of kind of like a 'baked cloud shadow'.
     
  12. Disati

    Disati

    Joined:
    Oct 5, 2009
    Posts:
    111
    You're a hero!
     
  13. Nikolay116

    Nikolay116

    Joined:
    Mar 21, 2010
    Posts:
    421
  14. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,015
    Wow!!Very cool.Thanks for share.
     
  15. Al-Anselmo

    Al-Anselmo

    Joined:
    Apr 6, 2010
    Posts:
    86
    This is really beautiful! I'll try it later.
    Thank you for sharing this.
     
  16. kici

    kici

    Joined:
    Dec 10, 2010
    Posts:
    44
    Beauty,,, thanks for sharing !!
     
  17. MarkPixel

    MarkPixel

    Joined:
    Apr 15, 2010
    Posts:
    39
  18. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282
    Another epic win for the freeware world. Be sure to check you name under Heaven or Hell Credits friend! (as soon as it have one :> )


    PS: How can i change the clouds position? they seems static in my project. =(
     
    Last edited: Feb 16, 2011
  19. Chris Morris

    Chris Morris

    Joined:
    Dec 19, 2009
    Posts:
    259
    Look really good!
     
  20. Vinícius Sanctus

    Vinícius Sanctus

    Joined:
    Dec 14, 2009
    Posts:
    282
    Help me Ikke i really want you to be on my project´s credits!

    My freeware friend!

    =)
     
  21. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    115
    Hi Ikke,

    These clouds are great!! Thanx for sharing!

    I wanted to change the lighting of the clouds according to the position of the lightsource for my project.

    So I've made some adjustments to your script, maybe you or someone would find it useful so I thought it'd be good to share it.
    My experience as a javascripter is about 25 days :) so forgive me if there are some mistakes. Also, I'm still working on it and will post the final script with the screenshot of the results.

    Here's the code:

     
  22. 3dDude

    3dDude

    Joined:
    Jul 4, 2010
    Posts:
    1,067
    ok I know how to fix this but I can't find the download link... Could you post the volumetric cloud script up here please? Then I will make the changes...
     
  23. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    115
    There's a unity package file attached in ikke's first post.
     
  24. 3dDude

    3dDude

    Joined:
    Jul 4, 2010
    Posts:
    1,067
    Awwwww man.... I feel stupid now :p

    Anyway... Here is the simple version... I found there was a lot of stuff in the code that was not necessary.

    Code (csharp):
    1. var CloudColor : Color;
    2. var CloudHighlight : Color;
    3. var offset = 0;
    4. function LateUpdate () {
    5.     var particles = particleEmitter.particles;
    6.     for (var i=0; i<particles.Length; i++) {
    7.         particles[i].color = Color.Lerp (CloudColor,CloudHighlight,particles[i].position.y+offset);
    8.     }
    9.     particleEmitter.particles = particles;
    10. }

    Just paste this code over the old code... Then in the cloud prefab make sure simulate in world space is set to false...

    Should work and hope this helps!
     
  25. xXToastyXx

    xXToastyXx

    Joined:
    Jan 25, 2011
    Posts:
    38
    how can I make them move like in the demo?
     
  26. onepiece81

    onepiece81

    Joined:
    Feb 26, 2011
    Posts:
    2
    Beauty,,, thanks for sharing !!
     
  27. aman_jha

    aman_jha

    Joined:
    Aug 24, 2012
    Posts:
    9
    OMG dude this is pretty cool, I love the work you did here. I'm gonna refer you!

    the demos were great, but i was wondering how you got the fly script that moves with the mouse.
    I have been looking for a script like that for a while, could you possible give it to me at gunujha1(at)gmail.com?
    Thanks!
    and great work man
     
unityunity