HorizontalProgressBar.java now can be filled left to right or the other way
This commit is contained in:
31
shaders/StylishShaders/HorizontalProgressBar.glsl
Normal file
31
shaders/StylishShaders/HorizontalProgressBar.glsl
Normal file
@ -0,0 +1,31 @@
|
||||
#version 410
|
||||
|
||||
in vec4 color;
|
||||
in vec2 fragCoord;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform float time;
|
||||
uniform float fill;
|
||||
uniform bool leftToRight;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (leftToRight){
|
||||
if (fill > fragCoord.x){
|
||||
FragColor = color;
|
||||
}
|
||||
else {
|
||||
FragColor = vec4(color.xyz, 0f);
|
||||
}
|
||||
} else {
|
||||
if (fill < fragCoord.x){
|
||||
FragColor = color;
|
||||
}
|
||||
else {
|
||||
FragColor = vec4(color.xyz, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#version 410
|
||||
|
||||
in vec4 color;
|
||||
in vec2 fragCoord;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform float time;
|
||||
uniform float fill;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (fill > fragCoord.x){
|
||||
FragColor = color;
|
||||
}
|
||||
else {
|
||||
FragColor = vec4(color.xyz, 0f);
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user