aboutsummaryrefslogtreecommitdiff
path: root/web/pw-visualizer/assets/shaders/frag/masked_image.glsl
blob: da0c787ff4c75fc2a44e1d2b2217868aa2f86697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifdef GL_ES
precision mediump float;
#endif

// Passed in from the vertex shader.
varying vec2 v_texCoord;

uniform float u_step_interval;
uniform float u_time;
uniform vec3 u_color;
uniform vec3 u_color_next;


// The texture.
uniform sampler2D u_texture;

void main() {
   float alpha = texture2D(u_texture, v_texCoord).a;
   vec3 color = mix(u_color, u_color_next, u_time);
   gl_FragColor = vec4(color, alpha);
}