/*{ "CATEGORIES": [ "Distortion" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/WaterDrop.glsl", "DESCRIPTION": "", "INPUTS": [ { "NAME": "startImage", "TYPE": "image" }, { "NAME": "endImage", "TYPE": "image" }, { "DEFAULT": 0, "MAX": 1, "MIN": 0, "NAME": "progress", "TYPE": "float" }, { "DEFAULT": 30, "MAX": 100, "MIN": 0, "NAME": "speed", "TYPE": "float" }, { "DEFAULT": 30, "MAX": 100, "MIN": 0, "NAME": "amplitude", "TYPE": "float" } ], "ISFVSN": "2" } */ vec4 getFromColor(vec2 inUV) { return IMG_NORM_PIXEL(startImage, inUV); } vec4 getToColor(vec2 inUV) { return IMG_NORM_PIXEL(endImage, inUV); } // author: Paweł Płóciennik // license: MIT vec4 transition(vec2 p) { vec2 dir = p - vec2(.5); float dist = length(dir); if (dist > progress) { return mix(getFromColor( p), getToColor( p), progress); } else { vec2 offset = dir * sin(dist * amplitude - progress * speed); return mix(getFromColor( p + offset), getToColor( p), progress); } } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }