HorizontalProgressBar.java now can be filled left to right or the other way

This commit is contained in:
Antoine
2021-06-12 03:09:43 +02:00
parent 8b9d698acc
commit f93f801e0b
4 changed files with 51 additions and 34 deletions

View 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);
}
}
}

View File

@ -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);
}
}