/*{ "CATEGORIES": [ "Dissolve", "Wipe" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/ColourDistance.glsl", "DESCRIPTION": "", "INPUTS": [ { "NAME": "startImage", "TYPE": "image" }, { "NAME": "endImage", "TYPE": "image" }, { "DEFAULT": 0, "MAX": 1, "MIN": 0, "NAME": "progress", "TYPE": "float" }, { "DEFAULT": 5, "MAX": 10, "MIN": 0, "NAME": "power", "TYPE": "float" } ], "ISFVSN": "2" } */ vec4 getFromColor(vec2 inUV) { return IMG_NORM_PIXEL(startImage, inUV); } vec4 getToColor(vec2 inUV) { return IMG_NORM_PIXEL(endImage, inUV); } // License: MIT // Author: P-Seebauer // ported by gre from https://gist.github.com/P-Seebauer/2a5fa2f77c883dd661f9 vec4 transition(vec2 p) { vec4 fTex = getFromColor(p); vec4 tTex = getToColor(p); float m = step(distance(fTex, tTex), progress); return mix( mix(fTex, tTex, m), tTex, pow(progress, power) ); } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }