Skip to content

Instantly share code, notes, and snippets.

@fand
Created November 9, 2017 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fand/d45c6de53ca7d2ea4db805bc6e399b45 to your computer and use it in GitHub Desktop.
Save fand/d45c6de53ca7d2ea4db805bc6e399b45 to your computer and use it in GitHub Desktop.
precision mediump float;
uniform float time;
uniform vec2 resolution;
uniform sampler2D video1;
uniform sampler2D video2;
uniform sampler2D video3;
vec2 rotate(in vec2 p, in float t) {
return mat2(
sin(t), cos(t),
cos(t), -sin(t)
) * p;
}
void main() {
float t = time * .3;
vec2 uv = gl_FragCoord.xy / resolution;
uv -= .5;
uv.y *= resolution.y / resolution.x;
// uv *= uv;
vec2 uv1 = mod(uv * mat2(
1, sin(time * .2) * 9.,
cos(time * .4 + .2) * -.5, 1
), .12);
vec2 uv2 = mod(uv * mat2(
1, sin(time * .3) * .8,
cos(time *.3) * 2., 1
), .17);
uv2 = rotate(uv2, t) + .5;
gl_FragColor = (
texture2D(video1, uv1) +
texture2D(video2, uv2)
) * .5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment