Changed moveto animations to use quadratic easing instead of exponential.

Added shader for screen wipes (e.g. DivaLeftToRightBlackFade).
This commit is contained in:
firebingo 2018-05-01 22:23:11 -07:00
parent 00eaff29fb
commit 6a4bb7a459
5 changed files with 116 additions and 7 deletions

31
Js/Shaders.js Normal file
View file

@ -0,0 +1,31 @@
const leftToRightFadeShader = `
precision mediump float;
varying vec2 vTextureCoord;
uniform vec2 dimensions;
uniform vec4 filterArea;
uniform float time;
uniform vec4 fadeincolor;
uniform vec4 fadeoutcolor;
vec2 mapCoord( vec2 coord ) {
coord *= filterArea.xy;
return coord;
}
void main( void ) {
vec2 uv = vTextureCoord;
vec2 mappedCoord = mapCoord(uv) / dimensions;
float step2 = time;
float step3 = time + 0.2;
step3 = clamp(step3, -1.0, 1.0);
float step4 = 1.0;
vec4 color = fadeincolor;
color = mix(color, fadeoutcolor, smoothstep(step2, step3, mappedCoord.x));
color = mix(color, fadeoutcolor, smoothstep(step3, step4, mappedCoord.x));
gl_FragColor = color;
}`
//http://glslsandbox.com/e#39992.0