2020-04-19 13:54:11 +00:00
|
|
|
#version 330 core
|
|
|
|
|
|
|
|
uniform sampler2D sampler;
|
2020-04-19 14:47:15 +00:00
|
|
|
uniform vec3 iColor;
|
|
|
|
uniform float time;
|
2020-04-19 13:54:11 +00:00
|
|
|
|
|
|
|
in vec2 texCoords;
|
|
|
|
|
|
|
|
out vec4 color;
|
|
|
|
|
|
|
|
void main() {
|
2020-04-19 14:47:15 +00:00
|
|
|
vec4 sample = texture(sampler, texCoords);
|
|
|
|
float x = sample.r + time;
|
2020-04-19 23:11:06 +00:00
|
|
|
color = vec4(iColor, mod(floor(x), 2) * (-x + 2) * sample.a);
|
2020-04-19 14:47:15 +00:00
|
|
|
if (color.a == 0) {
|
2020-04-19 13:54:11 +00:00
|
|
|
discard;
|
2020-04-19 14:47:15 +00:00
|
|
|
}
|
2020-04-19 13:54:11 +00:00
|
|
|
}
|