{"id":2394,"date":"2013-09-07T15:23:28","date_gmt":"2013-09-07T12:23:28","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=2394"},"modified":"2024-05-07T09:02:03","modified_gmt":"2024-05-07T06:02:03","slug":"gradient-bar-range-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2013\/09\/07\/gradient-bar-range-shader\/","title":{"rendered":"Gradient Bar Range (shader)"},"content":{"rendered":"<p><a title=\"http:\/\/unitycoder.com\/upload\/demos\/GradientBarRange1\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/GradientBarRange1\/\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2395\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2013\/09\/07\/gradient-bar-range-shader\/gradient_bar_range_shader_unity_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_1.jpg?fit=680%2C566&amp;ssl=1\" data-orig-size=\"680,566\" 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=\"gradient_bar_range_shader_unity_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_1.jpg?fit=680%2C566&amp;ssl=1\" class=\"alignnone size-full wp-image-2395\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_1.jpg?resize=680%2C566\" alt=\"gradient_bar_range_shader_unity_1\" width=\"680\" height=\"566\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_1.jpg?resize=300%2C249&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Tried to make something like this: <a title=\"http:\/\/forum.unity3d.com\/threads\/199297-Can-t-figure-this-gradient-material-thing-out\" href=\"http:\/\/forum.unity3d.com\/threads\/199297-Can-t-figure-this-gradient-material-thing-out\" target=\"_blank\" rel=\"noopener\">http:\/\/forum.unity3d.com\/threads\/199297-Can-t-figure-this-gradient-material-thing-out<\/a><\/p>\n<p>Its just a shader, which takes top bar and bottom bar world positions and then builds gradient between them..<\/p>\n<p><strong>AssetStore: *2024: updated to unity 2021.3<\/strong><br \/>\n<a href=\"_wp_link_placeholder\" data-wplink-edit=\"true\"><em>https:\/\/assetstore.unity.com\/packages\/vfx\/shaders\/vertical-gradient-range-shader-11310?aid=1101lGti<\/em><\/a><\/p>\n<p><strong>Webplayer:<\/strong><br \/>\n<a title=\"http:\/\/unitycoder.com\/upload\/demos\/GradientBarRange1\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/GradientBarRange1\/\" target=\"_blank\" rel=\"noopener\">http:\/\/unitycoder.com\/upload\/demos\/GradientBarRange1\/<\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Feature requests:<\/strong><br \/>\n&#8211; Sprites shader version<br \/>\n&#8211; Sample code to change the two colors<br \/>\n<em>&#8211; feel free to post more ideas \/ requests..<\/em><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#2:<\/strong> works with any shaped objects<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2.jpg\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2398\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2013\/09\/07\/gradient-bar-range-shader\/gradient_bar_range_shader_unity_2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2.jpg?fit=1320%2C605&amp;ssl=1\" data-orig-size=\"1320,605\" 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=\"gradient_bar_range_shader_unity_2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2.jpg?fit=1024%2C469&amp;ssl=1\" class=\"alignnone size-medium wp-image-2398\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2-300x137.jpg?resize=300%2C137\" alt=\"gradient_bar_range_shader_unity_2\" width=\"300\" height=\"137\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2.jpg?resize=300%2C137&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2.jpg?resize=1024%2C469&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_2.jpg?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>&lt;-click to view<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tried to make something like this: http:\/\/forum.unity3d.com\/threads\/199297-Can-t-figure-this-gradient-material-thing-out Its just a shader, which takes top bar and bottom bar world positions and then builds gradient between them.. AssetStore: *2024: updated to unity 2021.3 https:\/\/assetstore.unity.com\/packages\/vfx\/shaders\/vertical-gradient-range-shader-11310?aid=1101lGti Webplayer: http:\/\/unitycoder.com\/upload\/demos\/GradientBarRange1\/ &#8212; Feature requests: &#8211; Sprites shader version &#8211; Sample code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2395,"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":[485,3],"tags":[550,549,174,551,14],"class_list":["post-2394","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-assets","category-unity3d","tag-bar","tag-gradient","tag-range","tag-remap","tag-shader"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/09\/gradient_bar_range_shader_unity_1.jpg?fit=680%2C566&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-CC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2394","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=2394"}],"version-history":[{"count":6,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2394\/revisions"}],"predecessor-version":[{"id":5854,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2394\/revisions\/5854"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/2395"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=2394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=2394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=2394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}