Back to shaders
Shader test bench
Ripple
runnable transition
GLSL transition function. Stronghold supplies two demo textures and progress/time uniforms.
Code
// Author: gre
// License: MIT
uniform float amplitude; // = 100.0
uniform float speed; // = 50.0
vec4 transition (vec2 uv) {
vec2 dir = uv - vec2(.5);
float dist = length(dir);
vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30. * progress;
return mix(
getFromColor(uv + offset),
getToColor(uv),
smoothstep(0.2, 1.0, progress)
);
}