/*{
"CATEGORIES": [
"Wipe"
],
"CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/pinwheel.glsl",
"DESCRIPTION": "",
"INPUTS": [
{
"NAME": "startImage",
"TYPE": "image"
},
{
"NAME": "endImage",
"TYPE": "image"
},
{
"DEFAULT": 0,
"MAX": 1,
"MIN": 0,
"NAME": "progress",
"TYPE": "float"
},
{
"DEFAULT": 2,
"MAX": 10,
"MIN": 0,
"NAME": "speed",
"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: Mr Speaker
// License: MIT
vec4 transition(vec2 uv) {
vec2 p = uv.xy / vec2(1.0).xy;
float circPos = atan(p.y - 0.5, p.x - 0.5) + progress * speed;
float modPos = mod(circPos, 3.1415 / 4.);
float signed = sign(progress - modPos);
return mix(getToColor(p), getFromColor(p), step(signed, 0.5));
}
void main() {
gl_FragColor = transition(isf_FragNormCoord.xy);
}