/*{ "CATEGORIES": [ "Wipe" ], "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/Bounce.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": "bounces", "TYPE": "float" }, { "DEFAULT": 0.1, "MAX": 1, "MIN": 0, "NAME": "shadow_height", "TYPE": "float" }, { "DEFAULT": [ 0, 0, 0, 1 ], "NAME": "shadow_colour", "TYPE": "color" } ], "ISFVSN": "2", "VSN": "" } */ vec4 getFromColor(vec2 inUV) { return IMG_NORM_PIXEL(startImage, inUV); } vec4 getToColor(vec2 inUV) { return IMG_NORM_PIXEL(endImage, inUV); } // Author: Adrian Purser // License: MIT const float PI = 3.14159265358; vec4 transition (vec2 uv) { float time = progress; float stime = sin(time * PI / 2.); float phase = time * PI * bounces; float y = (abs(cos(phase))) * (1.0 - stime); float d = uv.y - y; return mix( mix( getToColor(uv), shadow_colour, step(d, shadow_height) * (1. - mix( ((d / shadow_height) * shadow_colour.a) + (1.0 - shadow_colour.a), 1.0, smoothstep(0.95, 1., progress) // fade-out the shadow at the end )) ), getFromColor(vec2(uv.x, uv.y + (1.0 - y))), step(d, 0.0) ); } void main() { gl_FragColor = transition(isf_FragNormCoord.xy); }