precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
float stripes(vec2 p, float steps) {
return fract(p.x*steps);
}
void main() {
vec2 p = position;
float brightness = stripes(p, 10.);
gl_FragColor.rgb = vec3(brightness);
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
float stripes(vec2 p, float steps) {
return fract(p.x*steps);
}
void main() {
vec2 p = position;
vec4 color = texture2D(webcam, p);
p.x += color.r * 0.1;
float brightness = stripes(p, 10.);
gl_FragColor.rgb = vec3(brightness);
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
uniform float time;
float stripes(vec2 p, float steps) {
return fract(p.x*steps);
}
void main() {
vec2 p = position;
vec4 color = texture2D(webcam, p);
p.x += color.r * 0.1 * sin(time);
float brightness = stripes(p, 10.);
gl_FragColor.rgb = vec3(brightness);
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
float checkerboard(vec2 p, float steps) {
float x = floor(p.x * steps);
float y = floor(p.y * steps);
return mod(x + y, 2.);
}
void main() {
vec2 p = position;
float brightness = checkerboard(p, 20.);
gl_FragColor.rgb = vec3(brightness);
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
float checkerboard(vec2 p, float steps) {
float x = floor(p.x * steps);
float y = floor(p.y * steps);
return mod(x + y, 2.);
}
void main() {
vec2 p = position;
vec4 color = texture2D(webcam, p);
p += color.r * 0.1;
float brightness = checkerboard(p, 20.);
gl_FragColor.rgb = vec3(brightness);
gl_FragColor.a = 1.;
}
precision mediump float;
varying vec2 position;
uniform sampler2D webcam;
uniform float time;
float checkerboard(vec2 p, float steps) {
float x = floor(p.x * steps);
float y = floor(p.y * steps);
return mod(x + y, 2.);
}
void main() {
vec2 p = position;
vec4 color = texture2D(webcam, p);
p.y += color.r * 0.2 * (sin(time)+1.);
float brightness = checkerboard(p, 20.);
gl_FragColor.rgb = vec3(brightness);
gl_FragColor.a = 1.;
}