/*{ "CATEGORIES": [ "Wipe" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/polar_function.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": "segments", "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: Fernando Kuteken // License: MIT #define PI 3.14159265359 vec4 transition (vec2 uv) { float angle = atan(uv.y - 0.5, uv.x - 0.5) - 0.5 * PI; float normalized = (angle + 1.5 * PI) * (2.0 * PI); float radius = (cos(float(segments) * angle) + 4.0) / 4.0; float difference = length(uv - vec2(0.5, 0.5)); if (difference > radius * progress) return getFromColor(uv); else return getToColor(uv); } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }