Skip to content

Instantly share code, notes, and snippets.

@WilliamBundy
Created January 22, 2020 00:19
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 WilliamBundy/25026605d488c3ce0777f92ff027ce36 to your computer and use it in GitHub Desktop.
Save WilliamBundy/25026605d488c3ce0777f92ff027ce36 to your computer and use it in GitHub Desktop.
vec4 box = vec4(0.0, 0, 0.3, 0.3);
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
box.x += 0.05 * iTime;
box.y -= 0.03 * iTime;
// Normalized pixel coordinates (from 0 to 1)
vec2 uv = fragCoord/iResolution.xy;
vec2 looped = uv / box.zw;
looped = uv - floor(looped) * box.zw;
looped += box.xy;
fragColor = texture(iChannel0, looped);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment