- Notifications
You must be signed in to change notification settings - Fork117
Customizable radial progress bar shader for Unity3D. Allows you to set arc range, minimum and maximum colors, textures, radius, and a few more things. Create HP Bars, Speedometers, rank progress, etc!
License
AdultLink/RadialProgressBar
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This shader allows you to create shiny looking radial progress bars that can be used to display information like character HP, loading status, matchmaking rating progress, car speed, etc. The possibilities are endless.
The shader can be edited throughAmplify Shader Editor and contributions to the project are always welcome!
Project developed usingUnity 2017.4.8f1. Please use this version if you are planning on contributing. You can work on your own branch and send a pull request with your changes.
You can also just download aunitypackage from thereleases tab and easily import everything to your project. This will not download thescreenshots folder.
Disclaimer: The scripts controlling the behavior of the examples provided are not optimized in any way and should only be taken as quick & dirty examples.
To get this shader up and running you only need to attach it to a material, and drop that material onto a quad. That's it, you now have a basic HP Bar!
Best is to check the examples provided to get an idea on how to tweak the different parameters, and to take inspiration from them.
This shader comes in two variants; "standard" (the one that will be described here) and "simple". The second one is a simplified version of the first one, which does away with many of the settings.
These are settings that affect the whole bar, and they are pretty much self-explanatory. By increasing and decreasingFill percentage, we control the amount of that bar that is filled. This is the main setting for this shader.
Rotation andArc range (0-360) allows you to control the starting and ending angles.
"Background" will always be visible regardless of the fill percentage (unless you turn the opacity all the way down to 0, of course).
Here, we can set both the color for the "fill" area of the background, as well as for the border. Additionally, border radial (along the circle) and tangential widths can be set, as well as its opacity.
This is the meat of the shader, and it is divided into two sections:Border andFill. Border settings are very similar to the ones already described for the background, with the caveat that it is possible to specify aColor (min) and aColor (max), so that the bar will lerp between them as is fills up.
Fill settings, on the other hand, are comprised of three more sections:Main texture,Secondary texture andNoise texture.
If you don't want to use any texture, just leave the slot empty.
They all provide similar parameters to play with, likeopacity andcontrast,tiling andoffset. You can make these textures scroll or rotate (which is quite handy for a radial bar) via a dropdown button. Rotation/scrolling speed is customizable.
Again, bar color will lerp between min and max colors. If you don't want this to happen, simply give them both the same value.
It is important to note that the noise texture will beMULTIPLIED with the secondary texture, and the result will beADDED to the main texture. This gives you some room to get creative.
"Standard" version - Click to expand
//MAIN SETTINGS_Radius_Arcrange_Fillpercentage_Globalopacity_Rotation//BACKGROUND_Backgroundfillcolor_Backgroundopacity_Backgroundbordercolor_Backgroundborderopacity_Backgroundborderradialwidth_Backgroundbordertangentwidth//BAR - BORDER_Bordermincolor_Bordermaxcolor_Mainbarborderopacity_Mainborderradialwidth_Mainbordertangentwidth//BAR - MAIN TEXTURE_Maintex_Barmincolor_Barmaxcolor_Maintexopacity_Maintexcontrast_Invertmaintex_Mainscrollrotate_Maintexscrollspeed_Maintexrotationspeed_Maintextiling_Maintexoffset//BAR - SECONDARY TEXTURE_Secondarytex_Barsecondarymincolor_Barsecondarymaxcolor_Secondarytexopacity_Secondarytexcontrast_Invertsecondarytex_Secondaryscrollrotate_Secondarytexscrollspeed_Secondarytexrotationspeed_Secondarytextiling_Secondarytexoffset//BAR - NOISE TEXTURE_Noisetex_Noiseintensity_Noisetexcontrast_Invertnoisetex_Noisetexspeed_Noisetextiling_Noisetexoffset
"Simplified" version - Click to expand
//MAIN SETTINGS_Radius_Arcrange_Fillpercentage_Globalopacity_Rotation//BAR_Barmincolor_Barmaxcolor
This piece of software is offered for free because I believe the gamedev community can benefit from it, and it should not be behind a paywall. I learned from the community, and now I am giving back.
If you would like to support me, donations are very much appreciated, since they help me create more software that I can offer for free.
Thank you very much :)
MIT License
Copyright (c) 2018 Guillermo Angel
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
About
Customizable radial progress bar shader for Unity3D. Allows you to set arc range, minimum and maximum colors, textures, radius, and a few more things. Create HP Bars, Speedometers, rank progress, etc!
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.











