precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
void main() {
vec4 color = texture2D(webcam, position);
gl_FragColor.r = color.r;
gl_FragColor.g = color.g;
gl_FragColor.b = color.b;
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
void main() {
vec4 color = texture2D(webcam, position);
gl_FragColor.r = color.r;
gl_FragColor.g = 0.;
gl_FragColor.b = 0.;
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
void main() {
vec4 color = texture2D(webcam, position);
gl_FragColor.r = color.r;
gl_FragColor.g = color.g;
gl_FragColor.b = 1. - color.b;
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
void main() {
vec4 color = texture2D(webcam, position);
gl_FragColor.r = 1. - color.r;
gl_FragColor.g = 1. - color.g;
gl_FragColor.b = 1. - color.b;
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
void main() {
vec4 color = texture2D(webcam, position);
float average = (color.r + color.g + color.b) / 3.;
gl_FragColor.r = average;
gl_FragColor.g = average;
gl_FragColor.b = average;
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
float wave(float x, float amount) {
return (sin(x * amount) + 1.) * .5;
}
void main() {
vec4 color = texture2D(webcam, position);
gl_FragColor.r = wave(color.r, 10.);
gl_FragColor.g = wave(color.g, 20.);
gl_FragColor.b = wave(color.b, 40.);
gl_FragColor.a = 1.;
}