gl-transitions 2.5.0 → 3.0.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.
- package/CHANGELOG.md +33 -0
- package/README.md +16 -1
- package/compatibility.json +56 -170
- package/gl-transitions.js +1 -1
- package/gl-transitions.json +1 -1
- package/glsl3/BandWipe.glsl +67 -0
- package/glsl3/BowTie.glsl +1 -1
- package/glsl3/DirectionalWipe.glsl +1 -1
- package/glsl3/GlintDissolve.glsl +125 -0
- package/glsl3/InsetWipe.glsl +58 -0
- package/glsl3/LightningFlash.glsl +200 -0
- package/glsl3/WarpSpeed.glsl +120 -0
- package/index.js +1 -1
- package/layouts.json +191 -198
- package/llms-full.txt +452 -515
- package/llms.txt +197 -204
- package/msl/BandWipe.metal +353 -0
- package/msl/BowTie.metal +1 -1
- package/msl/DirectionalWipe.metal +1 -1
- package/msl/GlintDissolve.metal +558 -0
- package/msl/InsetWipe.metal +232 -0
- package/msl/LightningFlash.metal +1038 -0
- package/msl/WarpSpeed.metal +549 -0
- package/package.json +1 -1
- package/skills/gl-transitions/references/catalog.md +36 -37
- package/sksl/BandWipe.sksl +77 -0
- package/sksl/BowTie.sksl +1 -1
- package/sksl/DirectionalWipe.sksl +1 -1
- package/sksl/GlintDissolve.sksl +136 -0
- package/sksl/InsetWipe.sksl +70 -0
- package/sksl/LightningFlash.sksl +202 -0
- package/sksl/WarpSpeed.sksl +131 -0
- package/sksl/index.js +1 -1
- package/transitions/BandWipe.glsl +66 -0
- package/transitions/BowTie.glsl +1 -1
- package/transitions/DirectionalWipe.glsl +1 -1
- package/transitions/GlintDissolve.glsl +124 -0
- package/transitions/InsetWipe.glsl +57 -0
- package/transitions/LightningFlash.glsl +199 -0
- package/transitions/WarpSpeed.glsl +119 -0
- package/wgsl/BandWipe.wgsl +319 -0
- package/wgsl/BowTie.wgsl +1 -1
- package/wgsl/DirectionalWipe.wgsl +1 -1
- package/wgsl/GlintDissolve.wgsl +519 -0
- package/wgsl/InsetWipe.wgsl +200 -0
- package/wgsl/LightningFlash.wgsl +964 -0
- package/wgsl/WarpSpeed.wgsl +497 -0
- package/glsl3/BlockDissolve.glsl +0 -16
- package/glsl3/BowTieVertical.glsl +0 -117
- package/glsl3/Box.glsl +0 -33
- package/glsl3/LinearBlur.glsl +0 -30
- package/glsl3/MosaicBlend.glsl +0 -21
- package/glsl3/MosaicFade.glsl +0 -20
- package/glsl3/RotateFade.glsl +0 -22
- package/glsl3/ScaleIn.glsl +0 -18
- package/glsl3/WipeDown.glsl +0 -12
- package/glsl3/WipeLeft.glsl +0 -12
- package/glsl3/WipeRight.glsl +0 -12
- package/glsl3/WipeUp.glsl +0 -12
- package/msl/BlockDissolve.metal +0 -108
- package/msl/BowTieVertical.metal +0 -375
- package/msl/Box.metal +0 -204
- package/msl/LinearBlur.metal +0 -169
- package/msl/MosaicBlend.metal +0 -136
- package/msl/MosaicFade.metal +0 -137
- package/msl/RotateFade.metal +0 -116
- package/msl/ScaleIn.metal +0 -111
- package/msl/WipeDown.metal +0 -105
- package/msl/WipeLeft.metal +0 -105
- package/msl/WipeRight.metal +0 -105
- package/msl/WipeUp.metal +0 -105
- package/sksl/BlockDissolve.sksl +0 -29
- package/sksl/BowTieVertical.sksl +0 -130
- package/sksl/Box.sksl +0 -47
- package/sksl/LinearBlur.sksl +0 -44
- package/sksl/MosaicBlend.sksl +0 -34
- package/sksl/MosaicFade.sksl +0 -33
- package/sksl/RotateFade.sksl +0 -34
- package/sksl/ScaleIn.sksl +0 -32
- package/sksl/WipeDown.sksl +0 -26
- package/sksl/WipeLeft.sksl +0 -26
- package/sksl/WipeRight.sksl +0 -26
- package/sksl/WipeUp.sksl +0 -26
- package/transitions/BlockDissolve.glsl +0 -15
- package/transitions/BowTieVertical.glsl +0 -116
- package/transitions/Box.glsl +0 -32
- package/transitions/LinearBlur.glsl +0 -29
- package/transitions/MosaicBlend.glsl +0 -20
- package/transitions/MosaicFade.glsl +0 -19
- package/transitions/RotateFade.glsl +0 -21
- package/transitions/ScaleIn.glsl +0 -17
- package/transitions/WipeDown.glsl +0 -11
- package/transitions/WipeLeft.glsl +0 -11
- package/transitions/WipeRight.glsl +0 -11
- package/transitions/WipeUp.glsl +0 -11
- package/wgsl/BlockDissolve.wgsl +0 -78
- package/wgsl/BowTieVertical.wgsl +0 -331
- package/wgsl/Box.wgsl +0 -176
- package/wgsl/LinearBlur.wgsl +0 -131
- package/wgsl/MosaicBlend.wgsl +0 -108
- package/wgsl/MosaicFade.wgsl +0 -107
- package/wgsl/RotateFade.wgsl +0 -85
- package/wgsl/ScaleIn.wgsl +0 -79
- package/wgsl/WipeDown.wgsl +0 -77
- package/wgsl/WipeLeft.wgsl +0 -77
- package/wgsl/WipeRight.wgsl +0 -77
- package/wgsl/WipeUp.wgsl +0 -77
package/sksl/BowTieVertical.sksl
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// BowTieVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTieVertical.glsl
|
|
2
|
-
// Author: huynx
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: Two triangles grow from the top and bottom edges into a bow tie that reveals the incoming image
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
float check(vec2 p1, vec2 p2, vec2 p3)
|
|
16
|
-
{
|
|
17
|
-
return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
bool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)
|
|
21
|
-
{
|
|
22
|
-
bool b1, b2, b3;
|
|
23
|
-
b1 = check(pt, p1, p2) < 0.0;
|
|
24
|
-
b2 = check(pt, p2, p3) < 0.0;
|
|
25
|
-
b3 = check(pt, p3, p1) < 0.0;
|
|
26
|
-
return ((b1 == b2) && (b2 == b3));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
bool in_top_triangle(vec2 p){
|
|
30
|
-
vec2 vertex1, vertex2, vertex3;
|
|
31
|
-
vertex1 = vec2(0.5, progress);
|
|
32
|
-
vertex2 = vec2(0.5-progress, 0.0);
|
|
33
|
-
vertex3 = vec2(0.5+progress, 0.0);
|
|
34
|
-
if (PointInTriangle(p, vertex1, vertex2, vertex3))
|
|
35
|
-
{
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
bool in_bottom_triangle(vec2 p){
|
|
42
|
-
vec2 vertex1, vertex2, vertex3;
|
|
43
|
-
vertex1 = vec2(0.5, 1.0 - progress);
|
|
44
|
-
vertex2 = vec2(0.5-progress, 1.0);
|
|
45
|
-
vertex3 = vec2(0.5+progress, 1.0);
|
|
46
|
-
if (PointInTriangle(p, vertex1, vertex2, vertex3))
|
|
47
|
-
{
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)
|
|
54
|
-
{
|
|
55
|
-
vec2 lineDir = bot1 - top;
|
|
56
|
-
vec2 perpDir = vec2(lineDir.y, -lineDir.x);
|
|
57
|
-
vec2 dirToPt1 = bot1 - testPt;
|
|
58
|
-
float dist1 = abs(dot(normalize(perpDir), dirToPt1));
|
|
59
|
-
|
|
60
|
-
lineDir = bot2 - top;
|
|
61
|
-
perpDir = vec2(lineDir.y, -lineDir.x);
|
|
62
|
-
dirToPt1 = bot2 - testPt;
|
|
63
|
-
float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);
|
|
64
|
-
|
|
65
|
-
if (min_dist < 0.005) {
|
|
66
|
-
return min_dist / 0.005;
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return 1.0;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
vec4 transition (vec2 uv) {
|
|
74
|
-
if (in_top_triangle(uv))
|
|
75
|
-
{
|
|
76
|
-
if (progress < 0.1)
|
|
77
|
-
{
|
|
78
|
-
return getFromColor(uv);
|
|
79
|
-
}
|
|
80
|
-
if (uv.y < 0.5)
|
|
81
|
-
{
|
|
82
|
-
vec2 vertex1 = vec2(0.5, progress);
|
|
83
|
-
vec2 vertex2 = vec2(0.5-progress, 0.0);
|
|
84
|
-
vec2 vertex3 = vec2(0.5+progress, 0.0);
|
|
85
|
-
return mix(
|
|
86
|
-
getFromColor(uv),
|
|
87
|
-
getToColor(uv),
|
|
88
|
-
blur_edge(vertex2, vertex3, vertex1, uv)
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
else
|
|
92
|
-
{
|
|
93
|
-
if (progress > 0.0)
|
|
94
|
-
{
|
|
95
|
-
return getToColor(uv);
|
|
96
|
-
}
|
|
97
|
-
else
|
|
98
|
-
{
|
|
99
|
-
return getFromColor(uv);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else if (in_bottom_triangle(uv))
|
|
104
|
-
{
|
|
105
|
-
if (uv.y >= 0.5)
|
|
106
|
-
{
|
|
107
|
-
vec2 vertex1 = vec2(0.5, 1.0-progress);
|
|
108
|
-
vec2 vertex2 = vec2(0.5-progress, 1.0);
|
|
109
|
-
vec2 vertex3 = vec2(0.5+progress, 1.0);
|
|
110
|
-
return mix(
|
|
111
|
-
getFromColor(uv),
|
|
112
|
-
getToColor(uv),
|
|
113
|
-
blur_edge(vertex2, vertex3, vertex1, uv)
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
else
|
|
117
|
-
{
|
|
118
|
-
return getFromColor(uv);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
return getFromColor(uv);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
half4 main(float2 _coord) {
|
|
127
|
-
vec2 _uv = _coord / _resolution;
|
|
128
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
129
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
130
|
-
}
|
package/sksl/Box.sksl
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Box — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Box.glsl
|
|
2
|
-
// Author: lql
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: The outgoing image shrinks into a box, toward the center or a corner, revealing the incoming one
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
uniform int rectIn;
|
|
16
|
-
|
|
17
|
-
uniform int location;
|
|
18
|
-
|
|
19
|
-
vec4 transition(vec2 uv) {
|
|
20
|
-
float p = rectIn == 1 ? 1.0 - progress : progress;
|
|
21
|
-
float x1, y1, x2, y2;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (location == 0) {
|
|
25
|
-
x1 = y1 = 0.5 * (1.0 - p);
|
|
26
|
-
x2 = y2 = 1.0 - x1;
|
|
27
|
-
} else {
|
|
28
|
-
|
|
29
|
-
x1 = (location == 1 || location == 2) ? 0.0 : 1.0 - p;
|
|
30
|
-
y1 = (location == 1 || location == 3) ? 1.0 - p : 0.0;
|
|
31
|
-
x2 = (location == 1 || location == 2) ? p : 1.0;
|
|
32
|
-
y2 = (location == 1 || location == 3) ? 1.0 : p;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
float in_rect = step(x1, uv.x) * step(uv.x, x2) * step(y1, uv.y) * step(uv.y, y2);
|
|
37
|
-
in_rect = rectIn == 1 ? 1.0 - in_rect : in_rect;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return mix(getFromColor(uv), getToColor(uv), in_rect);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
half4 main(float2 _coord) {
|
|
44
|
-
vec2 _uv = _coord / _resolution;
|
|
45
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
46
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
47
|
-
}
|
package/sksl/LinearBlur.sksl
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// LinearBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LinearBlur.glsl
|
|
2
|
-
// Author: gre
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: A crossfade through a blur
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
uniform float intensity;
|
|
16
|
-
const int passes = 6;
|
|
17
|
-
|
|
18
|
-
vec4 transition(vec2 uv) {
|
|
19
|
-
vec4 c1 = vec4(0.0);
|
|
20
|
-
vec4 c2 = vec4(0.0);
|
|
21
|
-
|
|
22
|
-
float disp = intensity*(0.5-distance(0.5, progress));
|
|
23
|
-
for (int xi=0; xi<passes; xi++)
|
|
24
|
-
{
|
|
25
|
-
float x = float(xi) / float(passes) - 0.5;
|
|
26
|
-
for (int yi=0; yi<passes; yi++)
|
|
27
|
-
{
|
|
28
|
-
float y = float(yi) / float(passes) - 0.5;
|
|
29
|
-
vec2 v = vec2(x,y);
|
|
30
|
-
float d = disp;
|
|
31
|
-
c1 += getFromColor( uv + d*v);
|
|
32
|
-
c2 += getToColor( uv + d*v);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
c1 /= float(passes*passes);
|
|
36
|
-
c2 /= float(passes*passes);
|
|
37
|
-
return mix(c1, c2, progress);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
half4 main(float2 _coord) {
|
|
41
|
-
vec2 _uv = _coord / _resolution;
|
|
42
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
43
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
44
|
-
}
|
package/sksl/MosaicBlend.sksl
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// MosaicBlend — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MosaicBlend.glsl
|
|
2
|
-
// Author: Sergey Kosarevsky
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: Both images break into large blocks that blend, then sharpen into the incoming image
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
uniform float pixelSize;
|
|
16
|
-
|
|
17
|
-
vec4 transition(vec2 uv) {
|
|
18
|
-
float T = progress;
|
|
19
|
-
float half_ = 0.5;
|
|
20
|
-
float size = (T < half_) ? mix(1.0, pixelSize, T / half_) : mix(pixelSize, 1.0, (T - half_) / half_);
|
|
21
|
-
float D = size * 0.005;
|
|
22
|
-
|
|
23
|
-
vec2 UV = (uv - 0.5) / D;
|
|
24
|
-
vec2 coord = clamp(D * (ceil(UV - 0.5)) + 0.5, 0.0, 1.0);
|
|
25
|
-
vec4 C0 = getFromColor(coord);
|
|
26
|
-
vec4 C1 = getToColor(coord);
|
|
27
|
-
return mix(C0, C1, T);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
half4 main(float2 _coord) {
|
|
31
|
-
vec2 _uv = _coord / _resolution;
|
|
32
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
33
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
34
|
-
}
|
package/sksl/MosaicFade.sksl
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// MosaicFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MosaicFade.glsl
|
|
2
|
-
// Author: YueDev
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: Both images break into mosaic blocks that blend, then sharpen into the incoming image
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
uniform float mosaicNum;
|
|
16
|
-
|
|
17
|
-
vec2 getMosaicUV(vec2 uv) {
|
|
18
|
-
float mosaicWidth = 2.0 / mosaicNum * min(progress, 1.0 - progress);
|
|
19
|
-
float mX = floor(uv.x / mosaicWidth) + 0.5;
|
|
20
|
-
float mY = floor(uv.y / mosaicWidth) + 0.5;
|
|
21
|
-
return vec2(mX * mosaicWidth, mY * mosaicWidth);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
vec4 transition (vec2 uv) {
|
|
25
|
-
vec2 mosaicUV = min(progress, 1.0 - progress) == 0.0 ? uv : getMosaicUV(uv);
|
|
26
|
-
return mix(getFromColor(mosaicUV), getToColor(mosaicUV), progress * progress);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
half4 main(float2 _coord) {
|
|
30
|
-
vec2 _uv = _coord / _resolution;
|
|
31
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
32
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
33
|
-
}
|
package/sksl/RotateFade.sksl
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// RotateFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateFade.glsl
|
|
2
|
-
// Author: haiyoucuv
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: The images spin around the center while crossfading
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
vec2 rotate2D(in vec2 uv, in float angle){
|
|
16
|
-
|
|
17
|
-
return uv * mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
|
18
|
-
}
|
|
19
|
-
vec4 transition (vec2 uv) {
|
|
20
|
-
|
|
21
|
-
vec2 p = fract(rotate2D(uv - 0.5, progress * 3.1415926 * 2.0) + 0.5);
|
|
22
|
-
|
|
23
|
-
return mix(
|
|
24
|
-
getFromColor(p),
|
|
25
|
-
getToColor(p),
|
|
26
|
-
progress
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
half4 main(float2 _coord) {
|
|
31
|
-
vec2 _uv = _coord / _resolution;
|
|
32
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
33
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
34
|
-
}
|
package/sksl/ScaleIn.sksl
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// ScaleIn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ScaleIn.glsl
|
|
2
|
-
// Author: haiyoucuv
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: The incoming image scales in from the center while fading in
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
vec4 scale(in vec2 uv){
|
|
16
|
-
uv = 0.5 + (uv - 0.5) * progress;
|
|
17
|
-
return getToColor(uv);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
vec4 transition (vec2 uv) {
|
|
21
|
-
return mix(
|
|
22
|
-
getFromColor(uv),
|
|
23
|
-
scale(uv),
|
|
24
|
-
progress
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
half4 main(float2 _coord) {
|
|
29
|
-
vec2 _uv = _coord / _resolution;
|
|
30
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
31
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
32
|
-
}
|
package/sksl/WipeDown.sksl
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// WipeDown — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeDown.glsl
|
|
2
|
-
// Author: Jake Nelson
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: A hard-edged wipe from top to bottom
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
vec4 transition(vec2 uv) {
|
|
16
|
-
vec2 p=uv.xy/vec2(1.0).xy;
|
|
17
|
-
vec4 a=getFromColor(p);
|
|
18
|
-
vec4 b=getToColor(p);
|
|
19
|
-
return mix(a, b, step(1.0-p.y,progress));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
half4 main(float2 _coord) {
|
|
23
|
-
vec2 _uv = _coord / _resolution;
|
|
24
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
25
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
26
|
-
}
|
package/sksl/WipeLeft.sksl
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// WipeLeft — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeLeft.glsl
|
|
2
|
-
// Author: Jake Nelson
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: A hard-edged wipe from right to left
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
vec4 transition(vec2 uv) {
|
|
16
|
-
vec2 p=uv.xy/vec2(1.0).xy;
|
|
17
|
-
vec4 a=getFromColor(p);
|
|
18
|
-
vec4 b=getToColor(p);
|
|
19
|
-
return mix(a, b, step(1.0-p.x,progress));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
half4 main(float2 _coord) {
|
|
23
|
-
vec2 _uv = _coord / _resolution;
|
|
24
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
25
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
26
|
-
}
|
package/sksl/WipeRight.sksl
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// WipeRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeRight.glsl
|
|
2
|
-
// Author: Jake Nelson
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: A hard-edged wipe from left to right
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
vec4 transition(vec2 uv) {
|
|
16
|
-
vec2 p=uv.xy/vec2(1.0).xy;
|
|
17
|
-
vec4 a=getFromColor(p);
|
|
18
|
-
vec4 b=getToColor(p);
|
|
19
|
-
return mix(a, b, step(0.0+p.x,progress));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
half4 main(float2 _coord) {
|
|
23
|
-
vec2 _uv = _coord / _resolution;
|
|
24
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
25
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
26
|
-
}
|
package/sksl/WipeUp.sksl
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// WipeUp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeUp.glsl
|
|
2
|
-
// Author: Jake Nelson
|
|
3
|
-
// License: MIT
|
|
4
|
-
// Description: A hard-edged wipe from bottom to top
|
|
5
|
-
|
|
6
|
-
uniform shader _from;
|
|
7
|
-
uniform shader _to;
|
|
8
|
-
uniform float2 _resolution;
|
|
9
|
-
uniform float progress;
|
|
10
|
-
uniform float ratio;
|
|
11
|
-
|
|
12
|
-
vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
13
|
-
vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
|
|
14
|
-
|
|
15
|
-
vec4 transition(vec2 uv) {
|
|
16
|
-
vec2 p=uv.xy/vec2(1.0).xy;
|
|
17
|
-
vec4 a=getFromColor(p);
|
|
18
|
-
vec4 b=getToColor(p);
|
|
19
|
-
return mix(a, b, step(0.0+p.y,progress));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
half4 main(float2 _coord) {
|
|
23
|
-
vec2 _uv = _coord / _resolution;
|
|
24
|
-
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
25
|
-
return half4(_c.rgb * _c.a, _c.a);
|
|
26
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Author: nwoeanhinnogaehr
|
|
2
|
-
// License: MIT
|
|
3
|
-
// Description: The incoming image appears in small random blocks
|
|
4
|
-
// Tags: dissolve, blocks, noise
|
|
5
|
-
// Ported from https://gist.github.com/nwoeanhinnogaehr/b93818de23d4511fde10
|
|
6
|
-
|
|
7
|
-
uniform float blocksize; // = 0.02
|
|
8
|
-
|
|
9
|
-
float rand(vec2 co) {
|
|
10
|
-
return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
vec4 transition(vec2 uv) {
|
|
14
|
-
return mix(getFromColor(uv), getToColor(uv), step(rand(floor(uv / blocksize)), progress));
|
|
15
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
// Author: huynx
|
|
2
|
-
// License: MIT
|
|
3
|
-
// Description: Two triangles grow from the top and bottom edges into a bow tie that reveals the incoming image
|
|
4
|
-
// Tags: wipe, shape, vertical
|
|
5
|
-
|
|
6
|
-
float check(vec2 p1, vec2 p2, vec2 p3)
|
|
7
|
-
{
|
|
8
|
-
return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
bool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)
|
|
12
|
-
{
|
|
13
|
-
bool b1, b2, b3;
|
|
14
|
-
b1 = check(pt, p1, p2) < 0.0;
|
|
15
|
-
b2 = check(pt, p2, p3) < 0.0;
|
|
16
|
-
b3 = check(pt, p3, p1) < 0.0;
|
|
17
|
-
return ((b1 == b2) && (b2 == b3));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
bool in_top_triangle(vec2 p){
|
|
21
|
-
vec2 vertex1, vertex2, vertex3;
|
|
22
|
-
vertex1 = vec2(0.5, progress);
|
|
23
|
-
vertex2 = vec2(0.5-progress, 0.0);
|
|
24
|
-
vertex3 = vec2(0.5+progress, 0.0);
|
|
25
|
-
if (PointInTriangle(p, vertex1, vertex2, vertex3))
|
|
26
|
-
{
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
bool in_bottom_triangle(vec2 p){
|
|
33
|
-
vec2 vertex1, vertex2, vertex3;
|
|
34
|
-
vertex1 = vec2(0.5, 1.0 - progress);
|
|
35
|
-
vertex2 = vec2(0.5-progress, 1.0);
|
|
36
|
-
vertex3 = vec2(0.5+progress, 1.0);
|
|
37
|
-
if (PointInTriangle(p, vertex1, vertex2, vertex3))
|
|
38
|
-
{
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)
|
|
45
|
-
{
|
|
46
|
-
vec2 lineDir = bot1 - top;
|
|
47
|
-
vec2 perpDir = vec2(lineDir.y, -lineDir.x);
|
|
48
|
-
vec2 dirToPt1 = bot1 - testPt;
|
|
49
|
-
float dist1 = abs(dot(normalize(perpDir), dirToPt1));
|
|
50
|
-
|
|
51
|
-
lineDir = bot2 - top;
|
|
52
|
-
perpDir = vec2(lineDir.y, -lineDir.x);
|
|
53
|
-
dirToPt1 = bot2 - testPt;
|
|
54
|
-
float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);
|
|
55
|
-
|
|
56
|
-
if (min_dist < 0.005) {
|
|
57
|
-
return min_dist / 0.005;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return 1.0;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
vec4 transition (vec2 uv) {
|
|
66
|
-
if (in_top_triangle(uv))
|
|
67
|
-
{
|
|
68
|
-
if (progress < 0.1)
|
|
69
|
-
{
|
|
70
|
-
return getFromColor(uv);
|
|
71
|
-
}
|
|
72
|
-
if (uv.y < 0.5)
|
|
73
|
-
{
|
|
74
|
-
vec2 vertex1 = vec2(0.5, progress);
|
|
75
|
-
vec2 vertex2 = vec2(0.5-progress, 0.0);
|
|
76
|
-
vec2 vertex3 = vec2(0.5+progress, 0.0);
|
|
77
|
-
return mix(
|
|
78
|
-
getFromColor(uv),
|
|
79
|
-
getToColor(uv),
|
|
80
|
-
blur_edge(vertex2, vertex3, vertex1, uv)
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
else
|
|
84
|
-
{
|
|
85
|
-
if (progress > 0.0)
|
|
86
|
-
{
|
|
87
|
-
return getToColor(uv);
|
|
88
|
-
}
|
|
89
|
-
else
|
|
90
|
-
{
|
|
91
|
-
return getFromColor(uv);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else if (in_bottom_triangle(uv))
|
|
96
|
-
{
|
|
97
|
-
if (uv.y >= 0.5)
|
|
98
|
-
{
|
|
99
|
-
vec2 vertex1 = vec2(0.5, 1.0-progress);
|
|
100
|
-
vec2 vertex2 = vec2(0.5-progress, 1.0);
|
|
101
|
-
vec2 vertex3 = vec2(0.5+progress, 1.0);
|
|
102
|
-
return mix(
|
|
103
|
-
getFromColor(uv),
|
|
104
|
-
getToColor(uv),
|
|
105
|
-
blur_edge(vertex2, vertex3, vertex1, uv)
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
else
|
|
109
|
-
{
|
|
110
|
-
return getFromColor(uv);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return getFromColor(uv);
|
|
115
|
-
}
|
|
116
|
-
}
|
package/transitions/Box.glsl
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Author: lql
|
|
2
|
-
// License: MIT
|
|
3
|
-
// Description: The outgoing image shrinks into a box, toward the center or a corner, revealing the incoming one
|
|
4
|
-
// Tags: box, zoom, shape
|
|
5
|
-
uniform int rectIn; // =1
|
|
6
|
-
// center:0, left_top:1, left_bottom:2, right_top:3, right_bottom:4
|
|
7
|
-
// @range(0, 4, 1) Where the box goes: 0 center, 1 left top, 2 left bottom, 3 right top, 4 right bottom
|
|
8
|
-
uniform int location; // =0
|
|
9
|
-
|
|
10
|
-
vec4 transition(vec2 uv) {
|
|
11
|
-
float p = rectIn == 1 ? 1.0 - progress : progress;
|
|
12
|
-
float x1, y1, x2, y2;
|
|
13
|
-
|
|
14
|
-
// Determine rectangle coordinates based on location
|
|
15
|
-
if (location == 0) {
|
|
16
|
-
x1 = y1 = 0.5 * (1.0 - p);
|
|
17
|
-
x2 = y2 = 1.0 - x1;
|
|
18
|
-
} else {
|
|
19
|
-
// Calculate the x and y coordinates based on the location
|
|
20
|
-
x1 = (location == 1 || location == 2) ? 0.0 : 1.0 - p;
|
|
21
|
-
y1 = (location == 1 || location == 3) ? 1.0 - p : 0.0;
|
|
22
|
-
x2 = (location == 1 || location == 2) ? p : 1.0;
|
|
23
|
-
y2 = (location == 1 || location == 3) ? 1.0 : p;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Determine if the point is inside the rectangle
|
|
27
|
-
float in_rect = step(x1, uv.x) * step(uv.x, x2) * step(y1, uv.y) * step(uv.y, y2);
|
|
28
|
-
in_rect = rectIn == 1 ? 1.0 - in_rect : in_rect;
|
|
29
|
-
|
|
30
|
-
// Mix colors based on the in_rect value
|
|
31
|
-
return mix(getFromColor(uv), getToColor(uv), in_rect);
|
|
32
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Author: gre
|
|
2
|
-
// License: MIT
|
|
3
|
-
// Description: A crossfade through a blur
|
|
4
|
-
// Tags: blur, blend
|
|
5
|
-
// @param Amount of blur
|
|
6
|
-
uniform float intensity; // = 0.1
|
|
7
|
-
const int passes = 6;
|
|
8
|
-
|
|
9
|
-
vec4 transition(vec2 uv) {
|
|
10
|
-
vec4 c1 = vec4(0.0);
|
|
11
|
-
vec4 c2 = vec4(0.0);
|
|
12
|
-
|
|
13
|
-
float disp = intensity*(0.5-distance(0.5, progress));
|
|
14
|
-
for (int xi=0; xi<passes; xi++)
|
|
15
|
-
{
|
|
16
|
-
float x = float(xi) / float(passes) - 0.5;
|
|
17
|
-
for (int yi=0; yi<passes; yi++)
|
|
18
|
-
{
|
|
19
|
-
float y = float(yi) / float(passes) - 0.5;
|
|
20
|
-
vec2 v = vec2(x,y);
|
|
21
|
-
float d = disp;
|
|
22
|
-
c1 += getFromColor( uv + d*v);
|
|
23
|
-
c2 += getToColor( uv + d*v);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
c1 /= float(passes*passes);
|
|
27
|
-
c2 /= float(passes*passes);
|
|
28
|
-
return mix(c1, c2, progress);
|
|
29
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Author: Sergey Kosarevsky
|
|
2
|
-
// License: MIT
|
|
3
|
-
// Description: Both images break into large blocks that blend, then sharpen into the incoming image
|
|
4
|
-
// Tags: pixelate, mosaic, blend
|
|
5
|
-
// Ported from https://gist.github.com/corporateshark/21d2fdd24c706952dc8c
|
|
6
|
-
|
|
7
|
-
uniform float pixelSize; // = 50.0
|
|
8
|
-
|
|
9
|
-
vec4 transition(vec2 uv) {
|
|
10
|
-
float T = progress;
|
|
11
|
-
float half_ = 0.5;
|
|
12
|
-
float size = (T < half_) ? mix(1.0, pixelSize, T / half_) : mix(pixelSize, 1.0, (T - half_) / half_);
|
|
13
|
-
float D = size * 0.005;
|
|
14
|
-
// Remap UV to center the mosaic pattern
|
|
15
|
-
vec2 UV = (uv - 0.5) / D;
|
|
16
|
-
vec2 coord = clamp(D * (ceil(UV - 0.5)) + 0.5, 0.0, 1.0);
|
|
17
|
-
vec4 C0 = getFromColor(coord);
|
|
18
|
-
vec4 C1 = getToColor(coord);
|
|
19
|
-
return mix(C0, C1, T);
|
|
20
|
-
}
|