{"id":401,"date":"2012-01-04T01:27:48","date_gmt":"2012-01-03T22:27:48","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=401"},"modified":"2013-08-15T21:59:25","modified_gmt":"2013-08-15T18:59:25","slug":"fake-realtime-raycast-shadows-unity3d","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/01\/04\/fake-realtime-raycast-shadows-unity3d\/","title":{"rendered":"Fake 2D Realtime Raycast Shadows (for unity free version)"},"content":{"rendered":"<p><a href=\"http:\/\/unitycoder.com\/upload\/demos\/mShadowRayScan1\/\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"402\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/01\/04\/fake-realtime-raycast-shadows-unity3d\/mraycastshadows1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows1.jpg?fit=680%2C495&amp;ssl=1\" data-orig-size=\"680,495\" 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=\"mRaycastShadows1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows1.jpg?fit=680%2C495&amp;ssl=1\" class=\"alignnone  wp-image-402\" title=\"mRaycastShadows1\" alt=\"\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows1.jpg?resize=680%2C495\" width=\"680\" height=\"495\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows1.jpg?resize=300%2C218&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Testing another way of doing realtime 2D shadows, by casting rays from the player position, then create &#8220;light&#8221; polygon to the area where we can see.<br \/>\nMore info later, need to test few things (using setpixels &amp; shader? or using different shader for better light effect with polygon plane)<\/p>\n<p><strong>Webplayer:<\/strong><br \/>\n<a href=\"http:\/\/unitycoder.com\/upload\/demos\/mShadowRayScan1\/\" target=\"_blank\">http:\/\/unitycoder.com\/upload\/demos\/mShadowRayScan1\/<\/a> (added 10.1.2012)<\/p>\n<p><strong>Download source:<\/strong><br \/>\n<a title=\"Download\" href=\"http:\/\/unitycoder.com\/download\/index2.php?link=166&amp;uid=un1t3c0d5r\" target=\"_blank\">mRayCastShadowTest.unityPackage<\/a><\/p>\n<p>More test images:<br \/>\nRays with 1 bounce (so we get light behind the corners also..red color is bounced light ray, using 512 rays for this image, using Debug.DrawLine)<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"407\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/01\/04\/fake-realtime-raycast-shadows-unity3d\/mraycastshadows2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows2.jpg?fit=680%2C578&amp;ssl=1\" data-orig-size=\"680,578\" 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=\"mRaycastShadows2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows2.jpg?fit=680%2C578&amp;ssl=1\" class=\"alignnone size-full wp-image-407\" title=\"mRaycastShadows2\" alt=\"\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows2.jpg?resize=680%2C578\" width=\"680\" height=\"578\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows2.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows2.jpg?resize=300%2C255&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Testing another way of doing realtime 2D shadows, by casting rays from the player position, then create &#8220;light&#8221; polygon to the area where we can see. More info later, need to test few things (using setpixels &amp; shader? or using different shader for better light [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":402,"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":[7,52,98,113,40],"class_list":["post-401","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-fake","tag-light","tag-raycast","tag-scan","tag-shadow"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mRaycastShadows1.jpg?fit=680%2C495&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-6t","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/401","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=401"}],"version-history":[{"count":8,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/401\/revisions"}],"predecessor-version":[{"id":2290,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/401\/revisions\/2290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/402"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}