{"id":2397,"date":"2021-02-04T00:58:13","date_gmt":"2021-02-03T16:58:13","guid":{"rendered":"https:\/\/www.clonefactor.com\/wordpress\/?p=2397"},"modified":"2021-02-04T13:42:11","modified_gmt":"2021-02-04T05:42:11","slug":"solve-unity3d-scene-color-not-work-in-hdrp","status":"publish","type":"post","link":"https:\/\/www.clonefactor.com\/wordpress\/program\/unity3d\/shader\/2397\/","title":{"rendered":"solve Unity3d Scene Color not work in HDRP\/URP"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">HDRP<\/h1>\n\n\n\n<p>To make Scene Color work in HDRP,<br>First you will need to make sure the <strong>Edit &gt; Project Settings &gt; HDRP Default Settings &gt;..<\/strong><br>make sure <strong>Opaque Objects<\/strong> &amp; <strong>Transparent Objects<\/strong> are checked..<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"892\" height=\"653\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_Requirement.jpg\" alt=\"\" class=\"wp-image-2403\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_Requirement.jpg 892w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_Requirement-300x220.jpg 300w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_Requirement-768x562.jpg 768w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_Requirement-359x263.jpg 359w\" sizes=\"auto, (max-width: 892px) 100vw, 892px\" \/><\/figure>\n\n\n\n<p>and then, create your new HDRP &gt; Shader &gt; Unlit Shader Graph<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"742\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_UnlitShaderGraph.jpg\" alt=\"\" class=\"wp-image-2399\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_UnlitShaderGraph.jpg 576w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/HDRP_UnlitShaderGraph-233x300.jpg 233w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><figcaption>Create new Unlit Shader Graph<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor00.jpg\" alt=\"\" class=\"wp-image-2398\" width=\"768\" height=\"884\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor00.jpg 768w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor00-261x300.jpg 261w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>in order to access camera data, you&#8217;ll need to change Surface Type intto &#8220;<strong>Transparent<\/strong>&#8220;<\/li><li>Add <strong>Scene Color<\/strong> and add it to Fragment Base Color, PS: &#8220;Scene Color&#8221; equal to &#8220;<strong>_CameraOpaqueTexture<\/strong>&#8221; in the old day.<\/li><\/ul>\n\n\n\n<p>in general this is how you did it in Shader, but in HDRP you will saw the following result.<br>the mesh which contain the material you just did will become extremely bright.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor01-707x1024.jpg\" alt=\"\" class=\"wp-image-2400\" width=\"707\" height=\"1024\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor01-707x1024.jpg 707w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor01-207x300.jpg 207w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor01.jpg 738w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><figcaption>extremely bright object in the scene<\/figcaption><\/figure>\n\n\n\n<p>For some reason it become a super white object, and the booming make it extremely bright.<br>to fix this we need to&#8230;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use a &#8220;Exposure&#8221; node and Multiply with &#8220;Scene Color&#8221;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02-1024x581.jpg\" alt=\"\" class=\"wp-image-2402\" width=\"1024\" height=\"581\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02-1024x581.jpg 1024w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02-300x170.jpg 300w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02-768x436.jpg 768w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02-1536x871.jpg 1536w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02-359x204.jpg 359w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor02.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>So as you can see with the simple setup like this will able to access the camera information and display you our objects.<br>another option for this is &#8220;HD Scene color&#8221; but you will need to toggle on the &#8220;Exposure&#8221; option. it dose the same as above graph.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"573\" height=\"380\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor03.jpg\" alt=\"\" class=\"wp-image-2409\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor03.jpg 573w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor03-300x199.jpg 300w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor03-359x238.jpg 359w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">URP<\/h1>\n\n\n\n<p>In URP the setup to make things work are different. <br>your will need to enable &#8220;Opaque Texture&#8221; in your pipe line.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>go to EDIT > Project Settings > Quality > Rendering click on the reference to locate your URP setting.<\/li><li>in this cases High, Medium, Low<\/li><li>Find them and toggle on the &#8220;Opaque Texture&#8221; in the inspector.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor04.jpg\" alt=\"\" class=\"wp-image-2413\" width=\"1473\" height=\"957\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor04.jpg 1473w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor04-300x195.jpg 300w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor04-1024x665.jpg 1024w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor04-768x499.jpg 768w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor04-359x233.jpg 359w\" sizes=\"auto, (max-width: 1473px) 100vw, 1473px\" \/><\/figure>\n\n\n\n<p>One more thing to go.<br>The camera in your scene also require to toggle on &#8220;Opaque Texture&#8221; option, or &#8220;Use Pipeline Settings&#8221; &#8211; depend on above step.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"627\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor05.png\" alt=\"\" class=\"wp-image-2416\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor05.png 601w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor05-288x300.png 288w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/figure>\n\n\n\n<p>at this moment if we create a scene color in shader graph you may notice the following issue.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor06-1024x734.jpg\" alt=\"\" class=\"wp-image-2418\" width=\"1024\" height=\"734\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor06-1024x734.jpg 1024w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor06-300x215.jpg 300w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor06-768x551.jpg 768w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor06-359x257.jpg 359w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor06.jpg 1319w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It&#8217;s because <strong>Surface Type<\/strong> set to &#8220;Transparent&#8221;, and in case you needed, &#8220;Two Sided&#8221; can also be selected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07.jpg\" alt=\"\" class=\"wp-image-2419\" width=\"1641\" height=\"949\" srcset=\"https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07.jpg 1641w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07-300x173.jpg 300w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07-1024x592.jpg 1024w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07-768x444.jpg 768w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07-1536x888.jpg 1536w, https:\/\/www.clonefactor.com\/wordpress\/wp-content\/uploads\/2021\/02\/SceneColor07-359x208.jpg 359w\" sizes=\"auto, (max-width: 1641px) 100vw, 1641px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>HDRP To make Scene Color work in HDRP,First you wi &hellip;<\/p>\n","protected":false},"author":1,"featured_media":2402,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[120,121],"class_list":["post-2397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shader","tag-hdrp","tag-urp"],"_links":{"self":[{"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/posts\/2397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2397"}],"version-history":[{"count":7,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/posts\/2397\/revisions"}],"predecessor-version":[{"id":2421,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/posts\/2397\/revisions\/2421"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/media\/2402"}],"wp:attachment":[{"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.clonefactor.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}