{"id":5680,"date":"2023-10-19T09:47:48","date_gmt":"2023-10-19T06:47:48","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=5680"},"modified":"2023-10-19T09:47:48","modified_gmt":"2023-10-19T06:47:48","slug":"2-sided-lighting-for-sprite-diffuse-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2023\/10\/19\/2-sided-lighting-for-sprite-diffuse-shader\/","title":{"rendered":"2 Sided Lighting for Sprite Diffuse Shader"},"content":{"rendered":"\n<p>Interesting question at<br><a href=\"https:\/\/forum.unity.com\/threads\/making-normal-maps-work-on-both-sides-of-a-2d-sprite-in-3d-space.1507538\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/forum.unity.com\/threads\/making-normal-maps-work-on-both-sides-of-a-2d-sprite-in-3d-space.1507538\/<\/a><\/p>\n\n\n\n<p>Made quick test with BiRP, modified sprite surface shader, with custom lighting (added &#8220;abs&#8221; into dot normal)..<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2023\/10\/2sidedsprite.gif?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"321\" data-attachment-id=\"5681\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2023\/10\/19\/2-sided-lighting-for-sprite-diffuse-shader\/2sidedsprite\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2023\/10\/2sidedsprite.gif?fit=449%2C321&amp;ssl=1\" data-orig-size=\"449,321\" 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=\"2sidedsprite\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2023\/10\/2sidedsprite.gif?fit=449%2C321&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2023\/10\/2sidedsprite.gif?resize=449%2C321&#038;ssl=1\" alt=\"\" class=\"wp-image-5681\"\/><\/a><\/figure>\n\n\n\n<p><strong>Source:<\/strong><br><a href=\"https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Shaders\/2D\/Sprites\/Diffuse%20(2%20Sided%20Light).shader#L48\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Shaders\/2D\/Sprites\/Diffuse%20(2%20Sided%20Light).shader#L48<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Interesting question athttps:\/\/forum.unity.com\/threads\/making-normal-maps-work-on-both-sides-of-a-2d-sprite-in-3d-space.1507538\/ Made quick test with BiRP, modified sprite surface shader, with custom lighting (added &#8220;abs&#8221; into dot normal).. Source:https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Shaders\/2D\/Sprites\/Diffuse%20(2%20Sided%20Light).shader#L48<\/p>\n","protected":false},"author":1,"featured_media":5681,"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":false,"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":[13],"tags":[181,568,1259,357],"class_list":["post-5680","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shaders","tag-2-sided","tag-custom","tag-lighting","tag-sprite"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2023\/10\/2sidedsprite.gif?fit=449%2C321&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1tC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5680","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=5680"}],"version-history":[{"count":1,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5680\/revisions"}],"predecessor-version":[{"id":5682,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5680\/revisions\/5682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/5681"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=5680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=5680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=5680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}