Aug
6
2012

Dynamic Clouds + Cloud Shadows on Terrain

Adding more stuff to the previous cloud test, now with fake shadows. (scene works with unity indie)

New features:
– Animated sky cloud shadows on terrain
– Bugs: Currently the clouds are not perfectly aligned..
– Shadow strength can be adjusted (now its 0.5 for the webplayer, 1 would give total black drop shadow for the cloud)
– I think it would need some cut-off value for the shadows, as almost transparent clouds still make quite visible shadows..

Webplayer:
http://unitycoder.com/upload/demos/AnimatedCloudsSkyDomeShadows1/

Get current test version source (2-in-1 : Animated clouds & Fake cloud shadows : works with indie):
(Direct download link arrives to your email!)
4eur [digishop id=”3″]

*Note that this is “developer version”, the example scene “just works”, you might have to tweak it to make it work in your scenes.. (email me if you have problems)

** Note#2: Doesnt work well with LINEAR mode (gamma is fine), also some problems with DEFERRED mode

FIX for Unity5 (tested on beta11)

Open shader “CloudShadow3.shader”
Find line:
float2 uv_PerlinTex: TEXCOORD0;

Comment it out:
//float2 uv_PerlinTex: TEXCOORD0;

Find line:
perturbValue = tex2D (_PerlinTex, half2(IN.uv_PerlinTex.x+translation,IN.uv_PerlinTex.y));

Replace that line with:
perturbValue = tex2D (_PerlinTex, half2(i.uv_Main.x,i.uv_Main.y+translation));

Find line:
_ShadowTex (“Cookie”, 2D) = “gray” { TexGen ObjectLinear }

Replace with:
_ShadowTex (“Cookie”, 2D) = “gray”

Image#2: Testing in unity5, after adding blend mode to see skybox  behind it “Blend OneMinusDstColor One // Soft Additive”
(see info about sun game window problems here)

fake_clouds


13 Comments + Add Comment

  • That looks really awesome!
    I guess you would need Unity Pro for the shadows though?
    Would be really awesome if you would actually finish and release this one though. You’re really great at all this stuff. You should do tutorials =)

    • Doesn’t need pro (and i’m using unity indie too..)

      Thanks!

  • it looks awesome!! 😀

    when you post the download link??

    • Maybe in 4-6months.. still needs some work. (donaters get the current version as-is, that is might have some problems/bugs)

  • Direct purchase download link added for now! (so no free version atleast this year yet..)

  • Is this project still being maintained? Do the shadows work on a mesh (I.e. a terrain not generated in Unity)?

    Thanks!

  • Also, what version of unity was this last tested on?

    Thanks!

    • Just tested on 4.6.0b17, still works (and no warnings), but there hasnt been any updates or improvements on this since release..

      It works on mesh also (shadows are made with projector in this version)

  • Works with Unity 5 beta?

    • tested on 5.0.0b11 (64bit), needed few modifications to work (adding them to main post now^)

      • Tried and it’s pretty cool, but I noticed that the projector doesn’t cast shadows on 3D object in the scene (of course, all this model has Mesh Renderer component). It’s possible for that objects to receive shadows? Thanks.

        • Could be because by default the “CloudShadowProjector” transform Y position is so low? (try moving it higher, and also adjust the Near/Far clip planes if necessary.

  • Animated cloud shadows asset for Unity
    https://github.com/EntroPi-Games/Unity-Cloud-Shadows

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.