/*{ "CATEGORIES": [ "Distortion" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/morph.glsl", "DESCRIPTION": "", "INPUTS": [ { "NAME": "startImage", "TYPE": "image" }, { "NAME": "endImage", "TYPE": "image" }, { "DEFAULT": 0, "MAX": 1, "MIN": 0, "NAME": "progress", "TYPE": "float" }, { "DEFAULT": 0.1, "MAX": 1, "MIN": 0, "NAME": "strength", "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: paniq // License: MIT vec4 transition(vec2 p) { vec4 ca = getFromColor(p); vec4 cb = getToColor(p); vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0); vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0); vec2 oc = mix(oa,ob,0.5)*strength; float w0 = progress; float w1 = 1.0-w0; return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress); } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }