31 lines
483 B
GLSL
31 lines
483 B
GLSL
#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);
|
|
}
|
|
}
|
|
|
|
|
|
} |