{"id":957,"date":"2012-08-06T02:45:24","date_gmt":"2012-08-05T23:45:24","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=957"},"modified":"2015-10-28T12:41:59","modified_gmt":"2015-10-28T09:41:59","slug":"dynamic-clouds-cloud-shadows-on-terrain","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/08\/06\/dynamic-clouds-cloud-shadows-on-terrain\/","title":{"rendered":"Dynamic Clouds + Cloud Shadows on Terrain"},"content":{"rendered":"<p><a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/AnimatedCloudsSkyDomeShadows1\/\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"958\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/08\/06\/dynamic-clouds-cloud-shadows-on-terrain\/animated_clouds_skydome_shader_ground_shadows3\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/animated_clouds_skydome_shader_ground_shadows3.jpg?fit=680%2C493&amp;ssl=1\" data-orig-size=\"680,493\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"animated_clouds_skydome_shader_ground_shadows3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/animated_clouds_skydome_shader_ground_shadows3.jpg?fit=680%2C493&amp;ssl=1\" class=\"alignnone size-full wp-image-958\" title=\"animated_clouds_skydome_shader_ground_shadows3\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/animated_clouds_skydome_shader_ground_shadows3.jpg?resize=680%2C493\" alt=\"\" width=\"680\" height=\"493\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/animated_clouds_skydome_shader_ground_shadows3.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/animated_clouds_skydome_shader_ground_shadows3.jpg?resize=300%2C217&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Adding more stuff to the previous <a title=\"http:\/\/unitycoder.com\/blog\/2012\/08\/02\/animated-clouds-shader-skydome\/\" href=\"http:\/\/unitycoder.com\/blog\/2012\/08\/02\/animated-clouds-shader-skydome\/\" target=\"_blank\">cloud test<\/a>, now with fake shadows. (scene works with unity indie)<\/p>\n<p><strong>New features:<\/strong><br \/>\n&#8211; Animated sky cloud shadows on terrain<br \/>\n&#8211; Bugs: Currently the clouds are not perfectly aligned..<br \/>\n&#8211; Shadow strength can be adjusted (now its 0.5 for the webplayer, 1 would give total black drop shadow for the cloud)<br \/>\n&#8211; I think it would need some cut-off value for the shadows, as almost transparent clouds still make quite visible shadows..<\/p>\n<p><strong>Webplayer:<br \/>\n<\/strong><a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/AnimatedCloudsSkyDomeShadows1\/\" target=\"_blank\">http:\/\/unitycoder.com\/upload\/demos\/AnimatedCloudsSkyDomeShadows1\/<strong><br \/>\n<\/strong><\/a><\/p>\n<p><strong>Get current test version source (2-in-1 : Animated clouds &amp; Fake cloud shadows : works with indie):<\/strong><br \/>\n(Direct download link arrives to your email!)<br \/>\n4eur [digishop id=&#8221;3&#8243;]<\/p>\n<p><em>*Note that this is &#8220;developer version&#8221;, the example scene &#8220;just works&#8221;, you might have to tweak it to make it work in your scenes.. (email me if you have problems)<\/em><\/p>\n<p>** Note#2: Doesnt work well with LINEAR mode (gamma is fine), also some problems with DEFERRED mode<\/p>\n<p><strong>FIX for Unity5 (tested on beta11)<\/strong><\/p>\n<p>Open shader &#8220;CloudShadow3.shader&#8221;<br \/>\nFind line:<br \/>\nfloat2 uv_PerlinTex: TEXCOORD0;<\/p>\n<p>Comment it out:<br \/>\n\/\/float2 uv_PerlinTex: TEXCOORD0;<\/p>\n<p>Find line:<br \/>\nperturbValue = tex2D (_PerlinTex, half2(IN.uv_PerlinTex.x+translation,IN.uv_PerlinTex.y));<\/p>\n<p>Replace that line with:<br \/>\nperturbValue = tex2D (_PerlinTex, half2(i.uv_Main.x,i.uv_Main.y+translation));<\/p>\n<p>Find line:<br \/>\n_ShadowTex (&#8220;Cookie&#8221;, 2D) = &#8220;gray&#8221; { TexGen ObjectLinear }<\/p>\n<p>Replace with:<br \/>\n_ShadowTex (&#8220;Cookie&#8221;, 2D) = &#8220;gray&#8221;<\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#2:<\/strong>\u00a0Testing in unity5, after adding blend mode to see skybox \u00a0behind it &#8220;Blend OneMinusDstColor One \/\/ Soft Additive&#8221;<br \/>\n(see info about sun game window\u00a0<a href=\"http:\/\/forum.unity3d.com\/threads\/add-basic-clouds-to-default-skybox-procedural-material.364077\/#post-2356041\" target=\"_blank\">problems here<\/a>)<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4024\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/08\/06\/dynamic-clouds-cloud-shadows-on-terrain\/fake_clouds\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/fake_clouds.gif?fit=546%2C482&amp;ssl=1\" data-orig-size=\"546,482\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fake_clouds\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/fake_clouds.gif?fit=546%2C482&amp;ssl=1\" class=\"alignnone size-full wp-image-4024\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/fake_clouds.gif?resize=546%2C482\" alt=\"fake_clouds\" width=\"546\" height=\"482\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding more stuff to the previous cloud test, now with fake shadows. (scene works with unity indie) New features: &#8211; Animated sky cloud shadows on terrain &#8211; Bugs: Currently the clouds are not perfectly aligned.. &#8211; Shadow strength can be adjusted (now its 0.5 for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":958,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,3],"tags":[270,267,63,266,269,205,40,255,254,268,168],"class_list":["post-957","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-animated","tag-cloud","tag-clouds","tag-dome","tag-dynamic","tag-indie","tag-shadow","tag-sky","tag-skydome","tag-system","tag-terrain"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/08\/animated_clouds_skydome_shader_ground_shadows3.jpg?fit=680%2C493&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-fr","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=957"}],"version-history":[{"count":14,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/957\/revisions"}],"predecessor-version":[{"id":4027,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/957\/revisions\/4027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/958"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}