gl-transitions 1.43.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +25 -0
  2. package/gl-transitions.js +1 -1
  3. package/gl-transitions.json +1 -1
  4. package/index.js +1 -1
  5. package/package.json +12 -2
  6. package/transitions/AdvancedMosaic.glsl +18 -0
  7. package/transitions/BlockDissolve.glsl +13 -0
  8. package/transitions/BookFlip.glsl +29 -0
  9. package/transitions/BowTieWithParameter.glsl +70 -0
  10. package/transitions/DefocusBlur.glsl +43 -0
  11. package/transitions/DirectionalScaled.glsl +31 -0
  12. package/transitions/EdgeTransition.glsl +47 -0
  13. package/transitions/FilmBurn.glsl +59 -0
  14. package/transitions/Fold.glsl +9 -0
  15. package/transitions/GlitchDisplace.glsl +11 -7
  16. package/transitions/HSVfade.glsl +26 -0
  17. package/transitions/HorizontalClose.glsl +13 -0
  18. package/transitions/HorizontalOpen.glsl +15 -0
  19. package/transitions/LeftRight.glsl +25 -0
  20. package/transitions/Overexposure.glsl +21 -0
  21. package/transitions/PuzzleRight.glsl +54 -0
  22. package/transitions/Rectangle.glsl +26 -0
  23. package/transitions/RectangleCrop.glsl +26 -0
  24. package/transitions/Rolls.glsl +37 -0
  25. package/transitions/RotateScaleVanish.glsl +36 -0
  26. package/transitions/SimpleFlip.glsl +11 -0
  27. package/transitions/SimpleZoomOut.glsl +19 -0
  28. package/transitions/Slides.glsl +37 -0
  29. package/transitions/StaticFade.glsl +44 -0
  30. package/transitions/TVStatic.glsl +25 -0
  31. package/transitions/TilesWave.glsl +59 -0
  32. package/transitions/TopBottom.glsl +24 -0
  33. package/transitions/VerticalClose.glsl +13 -0
  34. package/transitions/VerticalOpen.glsl +14 -0
  35. package/transitions/ZoomLeftWipe.glsl +33 -0
  36. package/transitions/ZoomRigthWipe.glsl +33 -0
  37. package/transitions/coord-from-in.glsl +15 -0
  38. package/transitions/directional-easing.glsl +15 -0
  39. package/transitions/directionalwarp.glsl +1 -1
  40. package/transitions/dissolve.glsl +53 -0
  41. package/transitions/fadecolor.glsl +1 -1
  42. package/transitions/mosaic_transition.glsl +16 -0
  43. package/transitions/perlin.glsl +9 -9
  44. package/transitions/pixelize.glsl +4 -2
  45. package/transitions/powerKaleido.glsl +54 -0
  46. package/transitions/randomNoisex.glsl +16 -0
  47. package/transitions/rotateTransition.glsl +19 -0
  48. package/transitions/scale-in.glsl +15 -0
  49. package/transitions/static_wipe.glsl +34 -0
  50. package/transitions/tangentMotionBlur.glsl +139 -0
  51. package/transitions/x_axis_translation.glsl +18 -0
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "gl-transitions",
3
- "version": "1.43.0",
3
+ "version": "1.45.0",
4
4
  "description": "The open collection of GL Transitions",
5
5
  "main": "index.js",
6
+ "license": "MIT",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/gl-transitions/gl-transitions.git"
@@ -10,5 +11,14 @@
10
11
  "bugs": {
11
12
  "url": "https://github.com/gl-transitions/gl-transitions/issues"
12
13
  },
13
- "homepage": "https://github.com/gl-transitions/gl-transitions#readme"
14
+ "homepage": "https://gl-transitions.com",
15
+ "keywords": [
16
+ "glsl",
17
+ "webgl",
18
+ "transitions",
19
+ "shader",
20
+ "opengl",
21
+ "video",
22
+ "animation"
23
+ ]
14
24
  }
@@ -0,0 +1,18 @@
1
+ // Author: Sergey Kosarevsky
2
+ // License: MIT
3
+ // Ported from https://gist.github.com/corporateshark/21d2fdd24c706952dc8c
4
+
5
+ uniform float pixelSize; // = 50.0
6
+
7
+ vec4 transition(vec2 uv) {
8
+ float T = progress;
9
+ float half_ = 0.5;
10
+ float size = (T < half_) ? mix(1.0, pixelSize, T / half_) : mix(pixelSize, 1.0, (T - half_) / half_);
11
+ float D = size * 0.005;
12
+ // Remap UV to center the mosaic pattern
13
+ vec2 UV = (uv - 0.5) / D;
14
+ vec2 coord = clamp(D * (ceil(UV - 0.5)) + 0.5, 0.0, 1.0);
15
+ vec4 C0 = getFromColor(coord);
16
+ vec4 C1 = getToColor(coord);
17
+ return mix(C0, C1, T);
18
+ }
@@ -0,0 +1,13 @@
1
+ // Author: nwoeanhinnogaehr
2
+ // License: MIT
3
+ // Ported from https://gist.github.com/nwoeanhinnogaehr/b93818de23d4511fde10
4
+
5
+ uniform float blocksize; // = 0.02
6
+
7
+ float rand(vec2 co) {
8
+ return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
9
+ }
10
+
11
+ vec4 transition(vec2 uv) {
12
+ return mix(getFromColor(uv), getToColor(uv), step(rand(floor(uv / blocksize)), progress));
13
+ }
@@ -0,0 +1,29 @@
1
+ // Author: hong
2
+ // License: MIT
3
+
4
+ vec2 skewRight(vec2 p) {
5
+ float skewX = (p.x - progress)/(0.5 - progress) * 0.5;
6
+ float skewY = (p.y - 0.5)/(0.5 + progress * (p.x - 0.5) / 0.5)* 0.5 + 0.5;
7
+ return vec2(skewX, skewY);
8
+ }
9
+
10
+ vec2 skewLeft(vec2 p) {
11
+ float skewX = (p.x - 0.5)/(progress - 0.5) * 0.5 + 0.5;
12
+ float skewY = (p.y - 0.5) / (0.5 + (1.0 - progress ) * (0.5 - p.x) / 0.5) * 0.5 + 0.5;
13
+ return vec2(skewX, skewY);
14
+ }
15
+
16
+ vec4 addShade() {
17
+ float shadeVal = max(0.7, abs(progress - 0.5) * 2.0);
18
+ return vec4(vec3(shadeVal ), 1.0);
19
+ }
20
+
21
+ vec4 transition (vec2 p) {
22
+ float pr = step(1.0 - progress, p.x);
23
+
24
+ if (p.x < 0.5) {
25
+ return mix(getFromColor(p), getToColor(skewLeft(p)) * addShade(), pr);
26
+ } else {
27
+ return mix(getFromColor(skewRight(p)) * addShade(), getToColor(p), pr);
28
+ }
29
+ }
@@ -0,0 +1,70 @@
1
+ // Author:KMojek
2
+ // License: MIT
3
+
4
+ uniform float adjust; // = 0.5;
5
+ uniform bool reverse; // = false;
6
+
7
+ float check(vec2 p1, vec2 p2, vec2 p3)
8
+ {
9
+ return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
10
+ }
11
+
12
+ bool pointInTriangle(vec2 pt, vec2 p1, vec2 p2, vec2 p3)
13
+ {
14
+
15
+ bool b1 = check(pt, p1, p2) < 0.0;
16
+ bool b2 = check(pt, p2, p3) < 0.0;
17
+ bool b3 = check(pt, p3, p1) < 0.0;
18
+ return b1 == b2 && b2 == b3;
19
+ }
20
+
21
+ const float height = 0.5;
22
+
23
+ vec4 transition_firstHalf( vec2 uv, float prog )
24
+ {
25
+ if ( uv.y < 0.5 )
26
+ {
27
+ vec2 botLeft = vec2( -0., prog-height );
28
+ vec2 botRight = vec2( 1., prog-height );
29
+ vec2 tip = vec2( adjust, prog );
30
+ if ( pointInTriangle( uv, botLeft, botRight, tip ) )
31
+ return getToColor(uv);
32
+ }
33
+ else
34
+ {
35
+ vec2 topLeft = vec2( -0., 1.-prog+height );
36
+ vec2 topRight = vec2( 1., 1.-prog+height );
37
+ vec2 tip = vec2( adjust, 1.-prog );
38
+ if ( pointInTriangle( uv, topLeft, topRight, tip ) )
39
+ return getToColor( uv );
40
+ }
41
+ return getFromColor( uv );
42
+ }
43
+
44
+ vec4 transition_secondHalf( vec2 uv, float prog )
45
+ {
46
+ if ( uv.x > adjust )
47
+ {
48
+ vec2 top = vec2( prog + height, 1. );
49
+ vec2 bot = vec2( prog + height, -0. );
50
+ vec2 tip = vec2( mix( adjust, 1.0, 2.0 * (prog - 0.5) ), 0.5 );
51
+ if ( pointInTriangle( uv, top, bot, tip) )
52
+ return getFromColor( uv );
53
+ }
54
+ else
55
+ {
56
+ vec2 top = vec2( 1.0-prog - height, 1. );
57
+ vec2 bot = vec2( 1.0-prog - height, -0. );
58
+ vec2 tip = vec2( mix( adjust, 0.0, 2.0 * (prog - 0.5) ), 0.5 );
59
+ if ( pointInTriangle( uv, top, bot, tip) )
60
+ return getFromColor( uv );
61
+ }
62
+ return getToColor( uv );
63
+ }
64
+
65
+ vec4 transition (vec2 uv) {
66
+ if ( reverse )
67
+ return ( progress < 0.5 ) ? transition_secondHalf( uv, 1.-progress ) : transition_firstHalf( uv, 1.-progress );
68
+ else
69
+ return ( progress < 0.5 ) ? transition_firstHalf( uv, progress ) : transition_secondHalf( uv, progress );
70
+ }
@@ -0,0 +1,43 @@
1
+ // Author: Sergey Kosarevsky
2
+ // License: MIT
3
+ // Ported from https://gist.github.com/corporateshark/b9f8e5675c647e615419
4
+
5
+ uniform float blurSize; // = 0.02
6
+
7
+ // 12-tap Poisson disk
8
+ // https://github.com/spite/Wagner/blob/master/fragment-shaders/poisson-disc-blur-fs.glsl
9
+
10
+ vec4 transition(vec2 uv) {
11
+ float T = progress;
12
+ float half_ = 0.5;
13
+ float D = (T < half_) ? mix(0.0, blurSize, T / half_) : mix(blurSize, 0.0, (T - half_) / half_);
14
+ vec4 C0 = getFromColor(uv);
15
+ vec4 C1 = getToColor(uv);
16
+ C0 += getFromColor(vec2(-0.326, -0.406) * D + uv);
17
+ C1 += getToColor(vec2(-0.326, -0.406) * D + uv);
18
+ C0 += getFromColor(vec2(-0.840, -0.074) * D + uv);
19
+ C1 += getToColor(vec2(-0.840, -0.074) * D + uv);
20
+ C0 += getFromColor(vec2(-0.696, 0.457) * D + uv);
21
+ C1 += getToColor(vec2(-0.696, 0.457) * D + uv);
22
+ C0 += getFromColor(vec2(-0.203, 0.621) * D + uv);
23
+ C1 += getToColor(vec2(-0.203, 0.621) * D + uv);
24
+ C0 += getFromColor(vec2( 0.962, -0.195) * D + uv);
25
+ C1 += getToColor(vec2( 0.962, -0.195) * D + uv);
26
+ C0 += getFromColor(vec2( 0.473, -0.480) * D + uv);
27
+ C1 += getToColor(vec2( 0.473, -0.480) * D + uv);
28
+ C0 += getFromColor(vec2( 0.519, 0.767) * D + uv);
29
+ C1 += getToColor(vec2( 0.519, 0.767) * D + uv);
30
+ C0 += getFromColor(vec2( 0.185, -0.893) * D + uv);
31
+ C1 += getToColor(vec2( 0.185, -0.893) * D + uv);
32
+ C0 += getFromColor(vec2( 0.507, 0.064) * D + uv);
33
+ C1 += getToColor(vec2( 0.507, 0.064) * D + uv);
34
+ C0 += getFromColor(vec2( 0.896, 0.412) * D + uv);
35
+ C1 += getToColor(vec2( 0.896, 0.412) * D + uv);
36
+ C0 += getFromColor(vec2(-0.322, -0.933) * D + uv);
37
+ C1 += getToColor(vec2(-0.322, -0.933) * D + uv);
38
+ C0 += getFromColor(vec2(-0.792, -0.598) * D + uv);
39
+ C1 += getToColor(vec2(-0.792, -0.598) * D + uv);
40
+ C0 /= 13.0;
41
+ C1 /= 13.0;
42
+ return mix(C0, C1, T);
43
+ }
@@ -0,0 +1,31 @@
1
+ // Author: Thibaut Foussard
2
+ // based on Directional transition by Gaëtan Renaudeau
3
+ // https://gl-transitions.com/editor/Directional
4
+ // License: MIT
5
+
6
+ #define PI acos(-1.0)
7
+
8
+ uniform vec2 direction; // = vec2(0.0, 1.0)
9
+ uniform float scale; // = .7
10
+
11
+ float parabola(float x) {
12
+ float y = pow(sin(x * PI), 1.);
13
+ return y;
14
+ }
15
+
16
+ vec4 transition (vec2 uv) {
17
+ float easedProgress = pow(sin(progress * PI / 2.), 3.);
18
+ vec2 p = uv + easedProgress * sign(direction);
19
+ vec2 f = fract(p);
20
+
21
+ float s = 1. - (1. - (1. / scale)) * parabola(progress);
22
+ f = (f - 0.5) * s + 0.5;
23
+
24
+ float mixer = step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0);
25
+ vec4 col = mix(getToColor(f), getFromColor(f), mixer);
26
+
27
+ float border = step(0., f.x) * step(0., (1. - f.x)) * step(0., f.y) * step(0., 1. - f.y);
28
+ col *= border;
29
+
30
+ return col;
31
+ }
@@ -0,0 +1,47 @@
1
+ // Author: Woohyun Kim
2
+ // License: MIT
3
+
4
+ uniform float edge_thickness; // = 0.001;
5
+ uniform float edge_brightness; // = 8.0;
6
+
7
+ vec4 detectEdgeColor(vec3[9] c) {
8
+ /* adjacent texel array for texel c[4]
9
+ 036
10
+ 147
11
+ 258
12
+ */
13
+ vec3 dx = 2.0 * abs(c[7]-c[1]) + abs(c[2] - c[6]) + abs(c[8] - c[0]);
14
+ vec3 dy = 2.0 * abs(c[3]-c[5]) + abs(c[6] - c[8]) + abs(c[0] - c[2]);
15
+ float delta = length(0.25 * (dx + dy) * 0.5);
16
+ return vec4(clamp(edge_brightness * delta, 0.0, 1.0) * c[4], 1.0);
17
+ }
18
+
19
+ vec4 getFromEdgeColor(vec2 uv) {
20
+ vec3 c[9];
21
+ for (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j)
22
+ {
23
+ vec4 color = getFromColor(uv + edge_thickness * vec2(i-1,j-1));
24
+ c[3*i + j] = color.rgb;
25
+ }
26
+ return detectEdgeColor(c);
27
+ }
28
+
29
+ vec4 getToEdgeColor(vec2 uv) {
30
+ vec3 c[9];
31
+ for (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j)
32
+ {
33
+ vec4 color = getToColor(uv + edge_thickness * vec2(i-1,j-1));
34
+ c[3*i + j] = color.rgb;
35
+ }
36
+ return detectEdgeColor(c);
37
+ }
38
+
39
+ vec4 transition (vec2 uv) {
40
+ vec4 start = mix(getFromColor(uv), getFromEdgeColor(uv), clamp(2.0 * progress, 0.0, 1.0));
41
+ vec4 end = mix(getToEdgeColor(uv), getToColor(uv), clamp(2.0 * (progress - 0.5), 0.0, 1.0));
42
+ return mix(
43
+ start,
44
+ end,
45
+ progress
46
+ );
47
+ }
@@ -0,0 +1,59 @@
1
+ // author: Anastasia Dunbar
2
+ // license: MIT
3
+ uniform float Seed; // = 2.31
4
+ float sigmoid(float x, float a) {
5
+ float b = pow(x*2.,a)/2.;
6
+ if (x > .5) {
7
+ b = 1.-pow(2.-(x*2.),a)/2.;
8
+ }
9
+ return b;
10
+ }
11
+ float rand(float co){
12
+ return fract(sin((co*24.9898)+Seed)*43758.5453);
13
+ }
14
+ float rand(vec2 co){
15
+ return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
16
+ }
17
+ float apow(float a,float b) { return pow(abs(a),b)*sign(b); }
18
+ vec3 pow3(vec3 a,vec3 b) { return vec3(apow(a.r,b.r),apow(a.g,b.g),apow(a.b,b.b)); }
19
+ float smooth_mix(float a,float b,float c) { return mix(a,b,sigmoid(c,2.)); }
20
+ float random(vec2 co, float shft){
21
+ co += 10.;
22
+ return smooth_mix(fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft)*.5),78.233+Seed))) * 43758.5453),fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft+1.)*.5),78.233+Seed))) * 43758.5453),fract(shft));
23
+ }
24
+ float smooth_random(vec2 co, float shft) {
25
+ return smooth_mix(smooth_mix(random(floor(co),shft),random(floor(co+vec2(1.,0.)),shft),fract(co.x)),smooth_mix(random(floor(co+vec2(0.,1.)),shft),random(floor(co+vec2(1.,1.)),shft),fract(co.x)),fract(co.y));
26
+ }
27
+ vec4 texture(vec2 p) {
28
+ return mix(getFromColor(p), getToColor(p), sigmoid(progress,10.));
29
+ }
30
+ #define pi 3.14159265358979323
31
+ #define clamps(x) clamp(x,0.,1.)
32
+
33
+ vec4 transition(vec2 p) {
34
+ vec3 f = vec3(0.);
35
+ for (float i = 0.; i < 13.; i++) {
36
+ f += sin(((p.x*rand(i)*6.)+(progress*8.))+rand(i+1.43))*sin(((p.y*rand(i+4.4)*6.)+(progress*6.))+rand(i+2.4));
37
+ f += 1.-clamps(length(p-vec2(smooth_random(vec2(progress*1.3),i+1.),smooth_random(vec2(progress*.5),i+6.25)))*mix(20.,70.,rand(i)));
38
+ }
39
+ f += 4.;
40
+ f /= 11.;
41
+ f = pow3(f*vec3(1.,0.7,0.6),vec3(1.,2.-sin(progress*pi),1.3));
42
+ f *= sin(progress*pi);
43
+
44
+ p -= .5;
45
+ p *= 1.+(smooth_random(vec2(progress*5.),6.3)*sin(progress*pi)*.05);
46
+ p += .5;
47
+
48
+ vec4 blurred_image = vec4(0.);
49
+ float bluramount = sin(progress*pi)*.03;
50
+ #define repeats 50.
51
+ for (float i = 0.; i < repeats; i++) {
52
+ vec2 q = vec2(cos(degrees((i/repeats)*360.)),sin(degrees((i/repeats)*360.))) * (rand(vec2(i,p.x+p.y))+bluramount);
53
+ vec2 uv2 = p+(q*bluramount);
54
+ blurred_image += texture(uv2);
55
+ }
56
+ blurred_image /= repeats;
57
+
58
+ return blurred_image+vec4(f,0.);
59
+ }
@@ -0,0 +1,9 @@
1
+ // Author: nwoeanhinnogaehr
2
+ // License: MIT
3
+ // Ported from https://gist.github.com/nwoeanhinnogaehr/f6fc39f4cfcbb97f96a6
4
+
5
+ vec4 transition(vec2 uv) {
6
+ vec4 a = getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));
7
+ vec4 b = getToColor(uv / vec2(progress, 1.0));
8
+ return mix(a, b, step(uv.x, progress));
9
+ }
@@ -1,13 +1,17 @@
1
1
  // Author: Matt DesLauriers
2
2
  // License: MIT
3
3
 
4
- highp float random(vec2 co)
4
+ #ifdef GL_ES
5
+ precision highp float;
6
+ #endif
7
+
8
+ float random(vec2 co)
5
9
  {
6
- highp float a = 12.9898;
7
- highp float b = 78.233;
8
- highp float c = 43758.5453;
9
- highp float dt= dot(co.xy ,vec2(a,b));
10
- highp float sn= mod(dt,3.14);
10
+ float a = 12.9898;
11
+ float b = 78.233;
12
+ float c = 43758.5453;
13
+ float dt= dot(co.xy ,vec2(a,b));
14
+ float sn= mod(dt,3.14);
11
15
  return fract(sin(sn) * c);
12
16
  }
13
17
  float voronoi( in vec2 x ) {
@@ -70,6 +74,6 @@ vec4 transition(vec2 uv) {
70
74
  color2 = mix(color2, dColor1, smoothstep(1.0, 0.5, progress));
71
75
  return mix(color1, color2, val);
72
76
  //gl_FragColor = mix(gl_FragColor, dColor, smoothstep(0.0, 0.5, progress));
73
-
77
+
74
78
  //gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);
75
79
  }
@@ -0,0 +1,26 @@
1
+ // Author: nwoeanhinnogaehr
2
+ // License: MIT
3
+ // Ported from https://gist.github.com/nwoeanhinnogaehr/b185145363d65751009b
4
+
5
+ // HSV functions from http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
6
+
7
+ vec3 hsv2rgb(vec3 c) {
8
+ const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
9
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
10
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
11
+ }
12
+
13
+ vec3 rgb2hsv(vec3 c) {
14
+ const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
15
+ vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
16
+ vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
17
+ float d = q.x - min(q.w, q.y);
18
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);
19
+ }
20
+
21
+ vec4 transition(vec2 uv) {
22
+ vec3 a = rgb2hsv(getFromColor(uv).rgb);
23
+ vec3 b = rgb2hsv(getToColor(uv).rgb);
24
+ vec3 m = mix(a, b, progress);
25
+ return vec4(hsv2rgb(m), 1.0);
26
+ }
@@ -0,0 +1,13 @@
1
+ // Author: martiniti
2
+ // License: MIT
3
+
4
+ vec4 transition (vec2 uv) {
5
+
6
+ float s = 2.0 - abs((uv.y - 0.5) / (progress - 1.0)) - 2.0 * progress;
7
+
8
+ return mix(
9
+ getFromColor(uv),
10
+ getToColor(uv),
11
+ smoothstep(0.5, 0.0, s)
12
+ );
13
+ }
@@ -0,0 +1,15 @@
1
+ // Author: martiniti
2
+ // License: MIT
3
+
4
+ vec4 transition (vec2 uv) {
5
+
6
+ float regress = 1.0 - progress;
7
+
8
+ float s = 2.0 - abs((uv.y - 0.5) / (regress - 1.0)) - 2.0 * regress;
9
+
10
+ return mix(
11
+ getFromColor(uv),
12
+ getToColor(uv),
13
+ smoothstep(0.0, 0.5, s)
14
+ );
15
+ }
@@ -0,0 +1,25 @@
1
+ // Author:zhmy
2
+ // License: MIT
3
+
4
+ const vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
5
+ const vec2 boundMin = vec2(0.0, 0.0);
6
+ const vec2 boundMax = vec2(1.0, 1.0);
7
+
8
+ bool inBounds (vec2 p) {
9
+ return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));
10
+ }
11
+
12
+ vec4 transition (vec2 uv) {
13
+ vec2 spfr,spto = vec2(-1.);
14
+
15
+ float size = mix(1.0, 3.0, progress*0.2);
16
+ spto = (uv + vec2(-0.5,-0.5))*vec2(size,size)+vec2(0.5,0.5);
17
+ spfr = (uv - vec2(1.-progress, 0.0));
18
+ if(inBounds(spfr)){
19
+ return getToColor(spfr);
20
+ }else if(inBounds(spto)){
21
+ return getFromColor(spto) * (1.0 - progress);
22
+ } else{
23
+ return black;
24
+ }
25
+ }
@@ -0,0 +1,21 @@
1
+ // Author: Ben Zhang
2
+ // License: MIT
3
+
4
+ uniform float strength; //= 0.6;
5
+ const float PI = 3.141592653589793;
6
+
7
+ vec4 transition (vec2 uv) {
8
+ vec4 from = getFromColor(uv);
9
+ vec4 to = getToColor(uv);
10
+
11
+ // Multipliers
12
+ float from_m = 1.0 - progress + sin(PI * progress) * strength;
13
+ float to_m = progress + sin(PI * progress) * strength;
14
+
15
+ return vec4(
16
+ from.r * from.a * from_m + to.r * to.a * to_m,
17
+ from.g * from.a * from_m + to.g * to.a * to_m,
18
+ from.b * from.a * from_m + to.b * to.a * to_m,
19
+ mix(from.a, to.a, progress)
20
+ );
21
+ }
@@ -0,0 +1,54 @@
1
+ // Author: JustKirillS
2
+ // License: MIT
3
+ // Ported from https://gist.github.com/JustKirillS/714f095318834f4d2375de872c53af1e
4
+
5
+ uniform ivec2 size; // = ivec2(4, 4)
6
+ uniform float pause; // = 0.1
7
+ uniform float dividerWidth; // = 0.005
8
+
9
+ float rand(vec2 co) {
10
+ return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
11
+ }
12
+
13
+ float getDelta(vec2 p) {
14
+ vec2 rectangleSize = 1.0 / vec2(size);
15
+ vec2 rectanglePos = floor(vec2(size) * p);
16
+ float top = rectangleSize.y * (rectanglePos.y + 1.0);
17
+ float bottom = rectangleSize.y * rectanglePos.y;
18
+ float left = rectangleSize.x * rectanglePos.x;
19
+ float right = rectangleSize.x * (rectanglePos.x + 1.0);
20
+ float minX = min(abs(p.x - left), abs(p.x - right));
21
+ float minY = min(abs(p.y - top), abs(p.y - bottom));
22
+ return min(minX, minY);
23
+ }
24
+
25
+ vec4 transition(vec2 uv) {
26
+ if (progress < pause) {
27
+ float currentProg = progress / pause;
28
+ float a = 1.0;
29
+ if (getDelta(uv) < dividerWidth) { a = 1.0 - currentProg; }
30
+ return mix(vec4(0.0, 0.0, 0.0, 1.0), getFromColor(uv), a);
31
+ } else if (progress < 1.0 - pause) {
32
+ if (getDelta(uv) < dividerWidth) {
33
+ return vec4(0.0, 0.0, 0.0, 1.0);
34
+ }
35
+ float currentProg = (progress - pause) / (1.0 - pause * 2.0);
36
+ vec2 rectanglePos = floor(vec2(size) * uv);
37
+ float r = rand(rectanglePos) - 0.1;
38
+ float cp = smoothstep(0.0, 1.0 - r, currentProg);
39
+ float rectangleSize = 1.0 / float(size.x);
40
+ float delta = rectanglePos.x * rectangleSize;
41
+ float offset = rectangleSize / 2.0 + delta;
42
+ vec2 p = uv;
43
+ p.x = (p.x - offset) / abs(cp - 0.5) * 0.5 + offset;
44
+ vec4 a = getFromColor(p);
45
+ vec4 b = getToColor(p);
46
+ float s = step(abs(float(size.x) * (uv.x - delta) - 0.5), abs(cp - 0.5));
47
+ return vec4(mix(b, a, step(cp, 0.5)).rgb * s, 1.0);
48
+ } else {
49
+ float currentProg = (progress - 1.0 + pause) / pause;
50
+ float a = 1.0;
51
+ if (getDelta(uv) < dividerWidth) { a = currentProg; }
52
+ return mix(vec4(0.0, 0.0, 0.0, 1.0), getToColor(uv), a);
53
+ }
54
+ }
@@ -0,0 +1,26 @@
1
+ // Author: martiniti
2
+ // License: MIT
3
+
4
+ uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)
5
+
6
+ float s = pow(2.0 * abs(progress - 0.5), 3.0);
7
+
8
+ vec4 transition(vec2 p) {
9
+
10
+ vec2 sq = p.xy / vec2(1.0).xy;
11
+
12
+ // bottom-left
13
+ vec2 bl = step(vec2(abs(1. - 2.*progress)), sq + .25);
14
+ float dist = bl.x * bl.y;
15
+
16
+ // top-right
17
+ vec2 tr = step(vec2(abs(1. - 2.*progress)), 1.25-sq);
18
+ dist *= 1. * tr.x * tr.y;
19
+
20
+ return mix(
21
+ progress < 0.5 ? getFromColor(p) : getToColor(p),
22
+ bgcolor,
23
+ step(s, dist)
24
+ );
25
+
26
+ }
@@ -0,0 +1,26 @@
1
+ // License: MIT
2
+ // Author: martiniti
3
+
4
+ uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)
5
+
6
+ vec4 transition(vec2 uv) {
7
+
8
+ float s = pow(2.0 * abs(progress - 0.5), 3.0);
9
+
10
+ vec2 q = uv.xy / vec2(1.0).xy;
11
+
12
+ // bottom-left
13
+ vec2 bl = step(vec2(1.0 - 2.0*abs(progress - 0.5)), q + 0.25);
14
+
15
+ // top-right
16
+ vec2 tr = step(vec2(1.0 - 2.0*abs(progress - 0.5)), 1.25 - q);
17
+
18
+ float dist = length(1.0 - bl.x * bl.y * tr.x * tr.y);
19
+
20
+ return mix(
21
+ progress < 0.5 ? getFromColor(uv) : getToColor(uv),
22
+ bgcolor,
23
+ step(s, dist)
24
+ );
25
+
26
+ }
@@ -0,0 +1,37 @@
1
+ // Author: Mark Craig
2
+ // mrmcsoftware on github and youtube ( http://www.youtube.com/MrMcSoftware )
3
+ // License: MIT
4
+
5
+ // Rolls Transition by Mark Craig (Copyright © 2022)
6
+
7
+ uniform int type; // = 0
8
+ uniform bool RotDown; // = false
9
+ // type (0-3): Rotate/Roll from which corner
10
+ // RotDown: if true rotate old image down, otherwise rotate old image up
11
+
12
+ #define M_PI 3.14159265358979323846
13
+
14
+ vec4 transition(vec2 uv)
15
+ {
16
+ float theta, c1, s1;
17
+ vec2 iResolution = vec2(ratio, 1.0);
18
+ vec2 uvi;
19
+ // I used if/else instead of switch in case it's an old GPU
20
+ if (type == 0) { theta = (RotDown ? M_PI : -M_PI) / 2.0 * progress; uvi.x = 1.0 - uv.x; uvi.y = uv.y; }
21
+ else if (type == 1) { theta = (RotDown ? M_PI : -M_PI) / 2.0 * progress; uvi = uv; }
22
+ else if (type == 2) { theta = (RotDown ? -M_PI : M_PI) / 2.0 * progress; uvi.x = uv.x; uvi.y = 1.0 - uv.y; }
23
+ else if (type == 3) { theta = (RotDown ? -M_PI : M_PI) / 2.0 * progress; uvi = 1.0 - uv; }
24
+ c1 = cos(theta); s1 = sin(theta);
25
+ vec2 uv2;
26
+ uv2.x = (uvi.x * iResolution.x * c1 - uvi.y * iResolution.y * s1);
27
+ uv2.y = (uvi.x * iResolution.x * s1 + uvi.y * iResolution.y * c1);
28
+ if ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y))
29
+ {
30
+ uv2 /= iResolution;
31
+ if (type == 0) { uv2.x = 1.0 - uv2.x; }
32
+ else if (type == 2) { uv2.y = 1.0 - uv2.y; }
33
+ else if (type == 3) { uv2 = 1.0 - uv2; }
34
+ return(getFromColor(uv2));
35
+ }
36
+ return(getToColor(uv));
37
+ }
@@ -0,0 +1,36 @@
1
+ // Author: Mark Craig
2
+ // mrmcsoftware on github and youtube ( http://www.youtube.com/MrMcSoftware )
3
+ // License: MIT
4
+
5
+ // RotateScaleVanish Transition by Mark Craig (Copyright © 2022)
6
+
7
+ uniform bool FadeInSecond; // = true
8
+ uniform bool ReverseEffect; // = false
9
+ uniform bool ReverseRotation; // = false
10
+
11
+ #define M_PI 3.14159265358979323846
12
+ #define _TWOPI 6.283185307179586476925286766559
13
+
14
+ vec4 transition(vec2 uv)
15
+ {
16
+ vec2 iResolution = vec2(ratio, 1.0);
17
+ float t = ReverseEffect ? 1.0 - progress : progress;
18
+ float theta = ReverseRotation ? _TWOPI * t : -_TWOPI * t;
19
+ float c1 = cos(theta);
20
+ float s1 = sin(theta);
21
+ float rad = max(0.00001, 1.0 - t);
22
+ float xc1 = (uv.x - 0.5) * iResolution.x;
23
+ float yc1 = (uv.y - 0.5) * iResolution.y;
24
+ float xc2 = (xc1 * c1 - yc1 * s1) / rad;
25
+ float yc2 = (xc1 * s1 + yc1 * c1) / rad;
26
+ vec2 uv2 = vec2(xc2 + iResolution.x / 2.0, yc2 + iResolution.y / 2.0);
27
+ vec4 col3;
28
+ vec4 ColorTo = ReverseEffect ? getFromColor(uv) : getToColor(uv);
29
+ if ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y))
30
+ {
31
+ uv2 /= iResolution;
32
+ col3 = ReverseEffect ? getToColor(uv2) : getFromColor(uv2);
33
+ }
34
+ else { col3 = FadeInSecond ? vec4(0.0, 0.0, 0.0, 1.0) : ColorTo; }
35
+ return((1.0 - t) * col3 + t * ColorTo); // could have used mix
36
+ }