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
*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)