info-beamer/ffnord-con-2015-2/room/progress.frag

17 lines
427 B
GLSL
Raw Permalink Normal View History

2015-09-08 23:41:50 +02:00
uniform sampler2D Texture;
varying vec2 TexCoord;
uniform float percent;
void main() {
vec2 pos = TexCoord;
float angle = atan(pos.x - 0.5, pos.y - 0.5);
float dist = distance(pos, vec2(0.5, 0.5));
if (dist >= 0.5) {
gl_FragColor = vec4(0.0);
} else if (angle < percent) {
gl_FragColor = vec4(0.894, 0.251, 0.506, 1);
} else {
gl_FragColor = vec4(1.0, 0.776, 0.251, 1);
}
}