/*{ "CATEGORIES": [ "Wipe" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/angular.glsl", "DESCRIPTION": "", "INPUTS": [ { "NAME": "startImage", "TYPE": "image" }, { "NAME": "endImage", "TYPE": "image" }, { "DEFAULT": 0, "MAX": 1, "MIN": 0, "NAME": "progress", "TYPE": "float" }, { "DEFAULT": 90, "MAX": 360, "MIN": 0, "NAME": "startingAngle", "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.141592653589 vec4 transition (vec2 uv) { float offset = startingAngle * PI / 180.0; float angle = atan(uv.y - 0.5, uv.x - 0.5) + offset; float normalizedAngle = (angle + PI) / (2.0 * PI); normalizedAngle = normalizedAngle - floor(normalizedAngle); return mix( getFromColor(uv), getToColor(uv), step(normalizedAngle, progress) ); } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }