On the quest of learning shaders I wanted to do something with animated materials, reacting to some external parameter.
I was inspired for this project from one of Freya Holmers streams! She provides amazing educational content. Miss Holmers was running like an online class on creating a healthbar, and after thinking how I would go about it, I started working on this project.
I suggest that you enable "Animated Material" so you can see how the material behaves without being in Play Mode.
I wanted the whole healthbar toL
- be one shader
- be framed (using sdf)
- the frame to be parametricized
- the frame to be animated in some way
- the health itself to be animated in a different way than the frame
- the health bar to react to the actual health level
- the health bar to give a sense of urgency due to the health level if there is a need for it
- Everything to be super easy to change
the animation curves cant be easily changed without going into the shader code and changing the math