Nouveau shader pour les barres de progression qui donne un aspect "tube"
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
#version 410
|
||||
|
||||
in vec4 color;
|
||||
in vec2 fragCoord;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform float time;
|
||||
uniform float fill;
|
||||
uniform bool leftToRight;
|
||||
uniform float height;
|
||||
|
||||
void main()
|
||||
{ //Rectangle plus large que haut
|
||||
vec4 colorTemp = color;
|
||||
float ouverture = 0.8f;
|
||||
float lum = -pow(fragCoord.y + height/2f, 2f) * 5f /height + ouverture;
|
||||
colorTemp.xyz *= lum;
|
||||
if (leftToRight){
|
||||
if (fill > fragCoord.x){
|
||||
FragColor = colorTemp;
|
||||
}
|
||||
else {
|
||||
FragColor = vec4(0f);
|
||||
}
|
||||
} else {
|
||||
if (fill < fragCoord.x){
|
||||
FragColor = colorTemp;
|
||||
}
|
||||
else {
|
||||
FragColor = vec4(0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user