/*{
"CATEGORIES": [
"Wipe"
],
"CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/Directional.glsl",
"DESCRIPTION": "",
"INPUTS": [
{
"NAME": "startImage",
"TYPE": "image"
},
{
"NAME": "endImage",
"TYPE": "image"
},
{
"DEFAULT": 0,
"MAX": 1,
"MIN": 0,
"NAME": "progress",
"TYPE": "float"
},
{
"DEFAULT": [
0,
1
],
"MAX": [
1,
1
],
"MIN": [
-1,
-1
],
"NAME": "direction",
"TYPE": "point2D"
}
],
"ISFVSN": "2"
}
*/
vec4 getFromColor(vec2 inUV) {
return IMG_NORM_PIXEL(startImage, inUV);
}
vec4 getToColor(vec2 inUV) {
return IMG_NORM_PIXEL(endImage, inUV);
}
// Author: Gaƫtan Renaudeau
// License: MIT
vec4 transition (vec2 uv) {
vec2 p = uv + progress * sign(direction);
vec2 f = fract(p);
return mix(
getToColor(f),
getFromColor(f),
step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)
);
}
void main() {
gl_FragColor = transition(isf_FragNormCoord.xy);
}