{"id":4362,"date":"2016-09-16T18:37:29","date_gmt":"2016-09-16T10:37:29","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=4362"},"modified":"2021-08-23T20:57:59","modified_gmt":"2021-08-23T17:57:59","slug":"custom-sprite-bloom-hdr-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2016\/09\/16\/custom-sprite-bloom-hdr-shader\/","title":{"rendered":"Custom Sprite Bloom HDR Shader"},"content":{"rendered":"<h6><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4363\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2016\/09\/16\/custom-sprite-bloom-hdr-shader\/sprite-bloom-hdr\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/sprite-bloom-hdr.gif?fit=306%2C155&amp;ssl=1\" data-orig-size=\"306,155\" 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=\"sprite-bloom-hdr\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/sprite-bloom-hdr.gif?fit=300%2C152&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/sprite-bloom-hdr.gif?fit=306%2C155&amp;ssl=1\" class=\"alignnone size-full wp-image-4363\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/sprite-bloom-hdr.gif?resize=306%2C155\" alt=\"sprite-bloom-hdr\" width=\"306\" height=\"155\" \/><\/h6>\n<p>Tried to do this shader mentioned in the forums (<a href=\"http:\/\/forum.unity3d.com\/threads\/beginners-question-on-bloom-effect-for-2d-sprites.431262\/#post-2789071\" target=\"_blank\" rel=\"noopener\">link<\/a>), to have a Bloom image effect only on certain sprites.<br \/>\nSee main image^ 2 same sprites, different material, so only 1 gets bloomed (even though the Bloom is full screen image effect)<\/p>\n<p><strong>Instructions:<\/strong><br \/>\n&#8211; Download shader below<br \/>\n&#8211; Create new material, assign that shader to it<br \/>\n&#8211; Assign the material into sprite renderer<br \/>\n&#8211; In the Camera, enable [x] HDR *Disable Antialias from Edit\/Quality settings if it complains about it<br \/>\n&#8211; Add Cinematic Image Effect, Bloom to the Camera *Download it from <a href=\"https:\/\/www.assetstore.unity3d.com\/en\/#!\/content\/51515\" target=\"_blank\" rel=\"noopener\">asset store<\/a> or from <a href=\"https:\/\/bitbucket.org\/Unity-Technologies\/cinematic-image-effects\/downloads\" target=\"_blank\" rel=\"noopener\">bitpuke<\/a> *Update: 2021, use Unity PostProcessing from package manager.<br \/>\n&#8211; Set Bloom threshold to 1.1 (so only pixels with color value over 1.1 will get bloomed)<\/p>\n<p><strong>Shader source: <\/strong>*Note: Currently this uses r+g+b to compare with shader BloomThreshold value..<br \/>\n<a href=\"https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Shaders\/2D\/Sprites\/SpriteHDRBloom.shader\"> https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Shaders\/2D\/Sprites\/SpriteHDRBloom.shader<\/a><\/p>\n<h6>*Image source: <a href=\"http:\/\/opengameart.org\/content\/mage-attack\" target=\"_blank\" rel=\"noopener\">http:\/\/opengameart.org\/content\/mage-attack<\/a><\/h6>\n","protected":false},"excerpt":{"rendered":"<p>Tried to do this shader mentioned in the forums (link), to have a Bloom image effect only on certain sprites. See main image^ 2 same sprites, different material, so only 1 gets bloomed (even though the Bloom is full screen image effect) Instructions: &#8211; Download [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4363,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Custom Sprite Bloom HDR Shader","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}},"categories":[13,3],"tags":[906,50,907,908,14,909,357],"class_list":["post-4362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shaders","category-unity3d","tag-bloom","tag-effect","tag-hdr","tag-selected","tag-shader","tag-single","tag-sprite"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/sprite-bloom-hdr.gif?fit=306%2C155&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-18m","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4362","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=4362"}],"version-history":[{"count":5,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4362\/revisions"}],"predecessor-version":[{"id":5407,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4362\/revisions\/5407"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4363"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}