{"id":4991,"date":"2019-05-25T05:07:47","date_gmt":"2019-05-24T21:07:47","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=4991"},"modified":"2019-05-25T05:07:47","modified_gmt":"2019-05-24T21:07:47","slug":"enable-hdr-color-picker-for-shader-or-script","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2019\/05\/25\/enable-hdr-color-picker-for-shader-or-script\/","title":{"rendered":"Enable HDR Color picker for Shader or Script"},"content":{"rendered":"\n<p>I needed HDR color for some old Unlit\/Color-shader, and for c# script also, found out that you can add this attribute for the shader:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ BEFORE (no hdr color picker)\n_Color (&quot;Main Color&quot;, Color) = (1,1,1,1)\n\/\/ AFTER (hdr color picker)\n&#x5B;HDR]_Color (&quot;Main Color&quot;, Color) = (1,1,1,1)\n<\/pre><\/div>\n\n\n<p>And for the script:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ BEFORE\npublic Color shouldbeHDR = Color.white;\n\/\/ AFTER\n&#x5B;ColorUsage(true, true)]\npublic Color shouldbeHDR = Color.white;\n<\/pre><\/div>\n\n\n<p><strong>More info:<\/strong><br><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/docs.unity3d.com\/ScriptReference\/ColorUsageAttribute.html\" target=\"_blank\">https:\/\/docs.unity3d.com\/ScriptReference\/ColorUsageAttribute.html<\/a><br><a rel=\"noreferrer noopener\" aria-label=\"https:\/\/docs.unity3d.com\/Manual\/SL-Properties.html (opens in a new tab)\" href=\"https:\/\/docs.unity3d.com\/Manual\/SL-Properties.html\" target=\"_blank\">https:\/\/docs.unity3d.com\/Manual\/SL-Properties.html<\/a><\/p>\n\n\n\n<p>Also make sure your Camera has [x] HDR enabled<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"463\" data-attachment-id=\"4992\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/05\/25\/enable-hdr-color-picker-for-shader-or-script\/hdr-enabled-shader-and-variable\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/hdr-enabled-shader-and-variable.jpg?fit=680%2C463&amp;ssl=1\" data-orig-size=\"680,463\" 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=\"hdr-enabled-shader-and-variable\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/hdr-enabled-shader-and-variable.jpg?fit=680%2C463&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/hdr-enabled-shader-and-variable.jpg?resize=680%2C463&#038;ssl=1\" alt=\"\" class=\"wp-image-4992\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/hdr-enabled-shader-and-variable.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/hdr-enabled-shader-and-variable.jpg?resize=300%2C204&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><figcaption>Left: No HDR | Right: HDR enabled<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I needed HDR color for some old Unlit\/Color-shader, and for c# script also, found out that you can add this attribute for the shader: And for the script: More info:https:\/\/docs.unity3d.com\/ScriptReference\/ColorUsageAttribute.htmlhttps:\/\/docs.unity3d.com\/Manual\/SL-Properties.html Also make sure your Camera has [x] HDR enabled<\/p>\n","protected":false},"author":1,"featured_media":4992,"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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[804,13,420,3],"tags":[79,358,907,1098],"class_list":["post-4991","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripts","category-shaders","category-tutorials","category-unity3d","tag-color","tag-editor","tag-hdr","tag-picker"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/hdr-enabled-shader-and-variable.jpg?fit=680%2C463&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1iv","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4991","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=4991"}],"version-history":[{"count":1,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4991\/revisions"}],"predecessor-version":[{"id":4993,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4991\/revisions\/4993"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4992"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}