Skip to content

Instantly share code, notes, and snippets.

@AGoblinKing
Created November 11, 2013 08:21
Show Gist options
  • Save AGoblinKing/7409677 to your computer and use it in GitHub Desktop.
Save AGoblinKing/7409677 to your computer and use it in GitHub Desktop.
private glsl
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.b, 10.);
gl_FragColor.g = wave(color.g, 10.);
gl_FragColor.b = wave(color.r, 10.);
gl_FragColor.a = 1.;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment