-
-
Save gre/8608651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef GL_ES | |
precision highp float; | |
#endif | |
// General parameters | |
uniform sampler2D from; | |
uniform sampler2D to; | |
uniform float progress; | |
uniform vec2 resolution; | |
uniform float amplitude; | |
uniform float speed; | |
void main() | |
{ | |
vec2 p = gl_FragCoord.xy / resolution.xy; | |
vec2 dir = p - vec2(.5); | |
float dist = length(dir); | |
vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30.; | |
gl_FragColor = mix(texture2D(from, p + offset), texture2D(to, p), smoothstep(0.2, 1.0, progress)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "amplitude": 100, "speed": 50 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment