/*{ "CATEGORIES": [ "Distortion" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/kaleidoscope.glsl", "DESCRIPTION": "", "INPUTS": [ { "NAME": "startImage", "TYPE": "image" }, { "NAME": "endImage", "TYPE": "image" }, { "DEFAULT": 0, "MAX": 1, "MIN": 0, "NAME": "progress", "TYPE": "float" }, { "DEFAULT": 1.5, "MAX": 5, "MIN": 0, "NAME": "power", "TYPE": "float" }, { "DEFAULT": 1, "MAX": 1, "MIN": 0, "NAME": "speed", "TYPE": "float" }, { "DEFAULT": 1, "MAX": 1, "MIN": 0, "NAME": "angle", "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: nwoeanhinnogaehr // License: MIT vec4 transition(vec2 uv) { vec2 p = uv.xy / vec2(1.0).xy; vec2 q = p; float t = pow(progress, power)*speed; p = p -0.5; for (int i = 0; i < 7; i++) { p = vec2(sin(t)*p.x + cos(t)*p.y, sin(t)*p.y - cos(t)*p.x); t += angle; p = abs(mod(p, 2.0) - 1.0); } abs(mod(p, 1.0)); return mix( mix(getFromColor(q), getToColor(q), progress), mix(getFromColor(p), getToColor(p), progress), 1.0 - 2.0*abs(progress - 0.5)); } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }