gl-transitions 3.1.0 → 3.3.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 +46 -0
- package/compatibility.json +306 -0
- package/gl-transitions.js +1 -1
- package/gl-transitions.json +1 -1
- package/glsl3/CardDeal.glsl +146 -0
- package/glsl3/CircleBurst.glsl +77 -0
- package/glsl3/CodeRain.glsl +114 -0
- package/glsl3/CurtainRise.glsl +71 -0
- package/glsl3/EchoSlide.glsl +93 -0
- package/glsl3/GeometricCollage.glsl +241 -0
- package/glsl3/GravityLens.glsl +66 -0
- package/glsl3/HingedSquares.glsl +121 -0
- package/glsl3/HorizontalHold.glsl +62 -0
- package/glsl3/LayoutGrid.glsl +147 -0
- package/glsl3/ProjectorThrow.glsl +75 -0
- package/glsl3/Reassemble.glsl +156 -0
- package/glsl3/RingSpin.glsl +112 -0
- package/glsl3/Shockwave.glsl +103 -0
- package/glsl3/ShoreWash.glsl +150 -0
- package/glsl3/ShutterWipe.glsl +68 -0
- package/glsl3/SpotlightWipe.glsl +63 -0
- package/glsl3/StopMotion.glsl +118 -0
- package/glsl3/Vaporize.glsl +125 -0
- package/index.js +1 -1
- package/layouts.json +725 -1
- package/llms-full.txt +734 -422
- package/llms.txt +238 -219
- package/msl/CardDeal.metal +539 -0
- package/msl/CircleBurst.metal +351 -0
- package/msl/CodeRain.metal +451 -0
- package/msl/CurtainRise.metal +263 -0
- package/msl/EchoSlide.metal +438 -0
- package/msl/GeometricCollage.metal +1188 -0
- package/msl/GravityLens.metal +236 -0
- package/msl/HingedSquares.metal +564 -0
- package/msl/HorizontalHold.metal +286 -0
- package/msl/LayoutGrid.metal +544 -0
- package/msl/ProjectorThrow.metal +313 -0
- package/msl/Reassemble.metal +667 -0
- package/msl/RingSpin.metal +474 -0
- package/msl/Shockwave.metal +256 -0
- package/msl/ShoreWash.metal +538 -0
- package/msl/ShutterWipe.metal +286 -0
- package/msl/SpotlightWipe.metal +217 -0
- package/msl/StopMotion.metal +551 -0
- package/msl/Vaporize.metal +462 -0
- package/package.json +1 -1
- package/skills/gl-transitions/references/catalog.md +94 -44
- package/sksl/CardDeal.sksl +156 -0
- package/sksl/CircleBurst.sksl +84 -0
- package/sksl/CodeRain.sksl +124 -0
- package/sksl/CurtainRise.sksl +84 -0
- package/sksl/EchoSlide.sksl +99 -0
- package/sksl/GeometricCollage.sksl +242 -0
- package/sksl/GravityLens.sksl +77 -0
- package/sksl/HingedSquares.sksl +124 -0
- package/sksl/HorizontalHold.sksl +74 -0
- package/sksl/LayoutGrid.sksl +156 -0
- package/sksl/ProjectorThrow.sksl +85 -0
- package/sksl/Reassemble.sksl +166 -0
- package/sksl/RingSpin.sksl +121 -0
- package/sksl/Shockwave.sksl +116 -0
- package/sksl/ShoreWash.sksl +159 -0
- package/sksl/ShutterWipe.sksl +80 -0
- package/sksl/SpotlightWipe.sksl +74 -0
- package/sksl/StopMotion.sksl +126 -0
- package/sksl/Vaporize.sksl +134 -0
- package/sksl/index.js +1 -1
- package/transitions/CardDeal.glsl +145 -0
- package/transitions/CircleBurst.glsl +76 -0
- package/transitions/CodeRain.glsl +113 -0
- package/transitions/CurtainRise.glsl +70 -0
- package/transitions/EchoSlide.glsl +92 -0
- package/transitions/GeometricCollage.glsl +240 -0
- package/transitions/GravityLens.glsl +65 -0
- package/transitions/HingedSquares.glsl +120 -0
- package/transitions/HorizontalHold.glsl +61 -0
- package/transitions/LayoutGrid.glsl +146 -0
- package/transitions/ProjectorThrow.glsl +74 -0
- package/transitions/Reassemble.glsl +155 -0
- package/transitions/RingSpin.glsl +111 -0
- package/transitions/Shockwave.glsl +102 -0
- package/transitions/ShoreWash.glsl +149 -0
- package/transitions/ShutterWipe.glsl +67 -0
- package/transitions/SpotlightWipe.glsl +62 -0
- package/transitions/StopMotion.glsl +117 -0
- package/transitions/Vaporize.glsl +124 -0
- package/wgsl/CardDeal.wgsl +496 -0
- package/wgsl/CircleBurst.wgsl +310 -0
- package/wgsl/CodeRain.wgsl +415 -0
- package/wgsl/CurtainRise.wgsl +235 -0
- package/wgsl/EchoSlide.wgsl +386 -0
- package/wgsl/GeometricCollage.wgsl +1075 -0
- package/wgsl/GravityLens.wgsl +206 -0
- package/wgsl/HingedSquares.wgsl +506 -0
- package/wgsl/HorizontalHold.wgsl +243 -0
- package/wgsl/LayoutGrid.wgsl +495 -0
- package/wgsl/ProjectorThrow.wgsl +274 -0
- package/wgsl/Reassemble.wgsl +609 -0
- package/wgsl/RingSpin.wgsl +426 -0
- package/wgsl/Shockwave.wgsl +226 -0
- package/wgsl/ShoreWash.wgsl +492 -0
- package/wgsl/ShutterWipe.wgsl +252 -0
- package/wgsl/SpotlightWipe.wgsl +186 -0
- package/wgsl/StopMotion.wgsl +496 -0
- package/wgsl/Vaporize.wgsl +420 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// RingSpin — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RingSpin.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The frame is cut into concentric rings that spin like the dials of a combination lock, in alternating directions and blurred with speed, one after another from the center outward; each ring overshoots a little and locks into place on 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 int rings;
|
|
16
|
+
|
|
17
|
+
uniform int square;
|
|
18
|
+
|
|
19
|
+
uniform int turns;
|
|
20
|
+
|
|
21
|
+
uniform float stagger;
|
|
22
|
+
|
|
23
|
+
uniform float blur;
|
|
24
|
+
|
|
25
|
+
uniform float settle;
|
|
26
|
+
|
|
27
|
+
const float PI = 3.141592653589793;
|
|
28
|
+
|
|
29
|
+
const float SETTLE = 0.2;
|
|
30
|
+
|
|
31
|
+
const float GAP = 0.0035;
|
|
32
|
+
const float RIM = 0.012;
|
|
33
|
+
const float EDGE = 0.0015;
|
|
34
|
+
|
|
35
|
+
vec2 mirrorUV(vec2 v) {
|
|
36
|
+
return 1.0 - abs(1.0 - mod(v, 2.0));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
vec2 rotate(vec2 v, float a) {
|
|
40
|
+
float c = cos(a), s = sin(a);
|
|
41
|
+
return vec2(c * v.x + s * v.y, c * v.y - s * v.x);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
float ringDelay(float n) {
|
|
45
|
+
float m = max(n - 1.0, 1.0);
|
|
46
|
+
return min(clamp(stagger, 0.0, 0.8) / m, 0.7 / (1.0 + 0.7 * m));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
float ringTime(float i, float n) {
|
|
50
|
+
float d = ringDelay(n);
|
|
51
|
+
return progress >= 1.0 ? 1.0 : clamp((progress - d * i) / (1.0 - d * (n - 1.0)), 0.0, 1.0);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
float activity(float i, float n) {
|
|
55
|
+
float t = ringTime(i, n);
|
|
56
|
+
return smoothstep(0.0, 0.08, t) * (1.0 - smoothstep(0.88, 1.0, t));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
float spin(float t, float total) {
|
|
60
|
+
float amp = 0.1 * settle * sign(total);
|
|
61
|
+
float stopT = 1.0 - SETTLE;
|
|
62
|
+
|
|
63
|
+
float v1 = amp * PI * stopT / (total * SETTLE);
|
|
64
|
+
float u = clamp(t / stopT, 0.0, 1.0);
|
|
65
|
+
float b = clamp((t - stopT) / SETTLE, 0.0, 1.0);
|
|
66
|
+
return total * (u * u * (3.0 - 2.0 * u) + v1 * (u * u * u - u * u)) + amp * sin(PI * b) * (1.0 - b) * (1.0 - b);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
vec4 transition(vec2 uv) {
|
|
70
|
+
vec2 aspect = vec2(ratio, 1.0);
|
|
71
|
+
vec2 c = (uv - 0.5) * aspect;
|
|
72
|
+
float r = (square != 0) ? max(abs(c.x), abs(c.y)) : length(c);
|
|
73
|
+
float n = clamp(float(rings), 1.0, 12.0);
|
|
74
|
+
float w = ((square != 0) ? 0.5 * max(ratio, 1.0) : length(0.5 * aspect)) / n;
|
|
75
|
+
float f = r / w;
|
|
76
|
+
float i = min(floor(f), n - 1.0);
|
|
77
|
+
float t = ringTime(i, n);
|
|
78
|
+
|
|
79
|
+
vec4 col;
|
|
80
|
+
if (t <= 0.0) col = getFromColor(uv);
|
|
81
|
+
else if (t >= 1.0) col = getToColor(uv);
|
|
82
|
+
else {
|
|
83
|
+
float total = 2.0 * PI * max(float(turns), 1.0) * (mod(i, 2.0) < 0.5 ? 1.0 : -1.0);
|
|
84
|
+
float a = spin(t, total);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
float u = min(t / (1.0 - SETTLE), 1.0);
|
|
88
|
+
float omega = abs(total) * 6.0 * u * (1.0 - u) / ((1.0 - SETTLE) * (1.0 - ringDelay(n) * (n - 1.0)));
|
|
89
|
+
float span = blur * min(omega * 0.015, 0.1 / max(r, 0.01));
|
|
90
|
+
|
|
91
|
+
float m = smoothstep(0.3, 0.5, t);
|
|
92
|
+
col = vec4(0.0);
|
|
93
|
+
float ws = 0.0;
|
|
94
|
+
for (int k = 0; k < 8; k++) {
|
|
95
|
+
float x = float(k) / 7.0 - 0.5;
|
|
96
|
+
vec2 q = mirrorUV(rotate(c, a + span * x) / aspect + 0.5);
|
|
97
|
+
vec4 s = mix(getFromColor(q), getToColor(q), m);
|
|
98
|
+
col += (1.0 - abs(x)) * s;
|
|
99
|
+
ws += 1.0 - abs(x);
|
|
100
|
+
}
|
|
101
|
+
col /= ws;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
float bj = clamp(floor(f + 0.5), 1.0, max(n - 1.0, 1.0));
|
|
107
|
+
float act = n > 1.5 ? max(activity(bj - 1.0, n), activity(bj, n)) : 0.0;
|
|
108
|
+
float d = (f - bj) * w;
|
|
109
|
+
vec2 nr = (square != 0) ? (abs(c.x) > abs(c.y) ? vec2(sign(c.x), 0.0) : vec2(0.0, sign(c.y))) : c / max(r, 1e-4);
|
|
110
|
+
|
|
111
|
+
float light = -sign(d) * dot(nr, vec2(-0.6, 0.8)) * (1.0 - smoothstep(GAP, GAP + RIM, abs(d))) * act;
|
|
112
|
+
col.rgb = light > 0.0 ? mix(col.rgb, vec3(col.a), 0.35 * light) : col.rgb * (1.0 + 0.45 * light);
|
|
113
|
+
col.rgb *= 1.0 - 0.85 * act * (1.0 - smoothstep(GAP - EDGE, GAP + EDGE, abs(d)));
|
|
114
|
+
return col;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
half4 main(float2 _coord) {
|
|
118
|
+
vec2 _uv = _coord / _resolution;
|
|
119
|
+
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
120
|
+
return half4(_c.rgb * _c.a, _c.a);
|
|
121
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Shockwave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shockwave.glsl
|
|
2
|
+
// Author: Gilad Levi, github @Giladx
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A diagonal shockwave breaks the outgoing image into tiny falling glass tiles. Each tile slips away with a brief chromatic split and neon edge glow, revealing the incoming image beneath it.
|
|
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 tileSize;
|
|
16
|
+
|
|
17
|
+
uniform float scatter;
|
|
18
|
+
|
|
19
|
+
uniform float diagonal;
|
|
20
|
+
|
|
21
|
+
uniform float prism;
|
|
22
|
+
|
|
23
|
+
uniform float glow;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
float toseeHash(vec2 p) {
|
|
27
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
vec4 transition(vec2 uv) {
|
|
31
|
+
|
|
32
|
+
if (progress <= 0.0) return getFromColor(uv);
|
|
33
|
+
if (progress >= 1.0) return getToColor(uv);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
float size = max(tileSize, 0.008);
|
|
37
|
+
vec2 grid = max(vec2(1.0), floor(vec2(ratio, 1.0) / size));
|
|
38
|
+
vec2 cell = floor(uv * grid);
|
|
39
|
+
vec2 cellUV = fract(uv * grid);
|
|
40
|
+
vec2 centerUV = (cell + 0.5) / grid;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
float sweep = mix(
|
|
44
|
+
centerUV.x,
|
|
45
|
+
0.64 * centerUV.x + 0.36 * (1.0 - centerUV.y),
|
|
46
|
+
clamp(diagonal, 0.0, 1.0)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
float noise = toseeHash(cell);
|
|
50
|
+
float start = 0.62 * sweep + 0.07 * noise;
|
|
51
|
+
float t = clamp((progress - start) / 0.29, 0.0, 1.0);
|
|
52
|
+
float movement = t * clamp(scatter, 0.0, 1.5);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
float wobble = toseeHash(cell + vec2(19.3, 7.7)) * 2.0 - 1.0;
|
|
56
|
+
vec2 drift = vec2(0.65 * wobble, -0.95) * movement;
|
|
57
|
+
vec2 movingCellUV = cellUV - drift;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
float inside =
|
|
61
|
+
step(0.012, movingCellUV.x) *
|
|
62
|
+
step(movingCellUV.x, 0.988) *
|
|
63
|
+
step(0.012, movingCellUV.y) *
|
|
64
|
+
step(movingCellUV.y, 0.988);
|
|
65
|
+
|
|
66
|
+
float tileShape = mix(1.0, inside, smoothstep(0.0, 0.13, t));
|
|
67
|
+
float oldVisibility = 1.0 - smoothstep(0.48, 0.87, t);
|
|
68
|
+
float oldMask = tileShape * oldVisibility;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
vec2 oldUV = clamp(uv - drift / grid, 0.0, 1.0);
|
|
72
|
+
vec4 oldColor = getFromColor(oldUV);
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
float flare = sin(3.14159265 * t);
|
|
76
|
+
vec2 shift = vec2(0.006, -0.002) * prism * flare;
|
|
77
|
+
vec4 offsetColor = getFromColor(
|
|
78
|
+
clamp(oldUV + shift, 0.0, 1.0)
|
|
79
|
+
);
|
|
80
|
+
oldColor.r = offsetColor.r;
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
vec4 result = mix(getToColor(uv), oldColor, oldMask);
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
float edgeDistance = min(
|
|
87
|
+
min(movingCellUV.x, 1.0 - movingCellUV.x),
|
|
88
|
+
min(movingCellUV.y, 1.0 - movingCellUV.y)
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
float edge =
|
|
92
|
+
(1.0 - smoothstep(0.0, 0.10, edgeDistance)) * inside;
|
|
93
|
+
|
|
94
|
+
vec3 cyan = vec3(0.12, 0.95, 1.0);
|
|
95
|
+
vec3 pink = vec3(1.0, 0.20, 0.65);
|
|
96
|
+
|
|
97
|
+
vec3 rimColor = mix(
|
|
98
|
+
cyan,
|
|
99
|
+
pink,
|
|
100
|
+
toseeHash(cell + vec2(5.4, 28.6))
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
result.rgb = clamp(
|
|
104
|
+
result.rgb + rimColor * edge * flare * glow * oldMask * 0.60,
|
|
105
|
+
0.0,
|
|
106
|
+
1.0
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
half4 main(float2 _coord) {
|
|
113
|
+
vec2 _uv = _coord / _resolution;
|
|
114
|
+
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
115
|
+
return half4(_c.rgb * _c.a, _c.a);
|
|
116
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// ShoreWash — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ShoreWash.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A thin sheet of water runs up over the outgoing image like the last of a wave on a beach, its lobed front edged with bubbly foam; it slows, stops just past the far edge and drains back, leaving the incoming image wet and glossy as it dries
|
|
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 vec2 direction;
|
|
16
|
+
|
|
17
|
+
uniform float foam;
|
|
18
|
+
|
|
19
|
+
uniform float refraction;
|
|
20
|
+
|
|
21
|
+
uniform vec4 water;
|
|
22
|
+
|
|
23
|
+
const float AA = 0.002;
|
|
24
|
+
|
|
25
|
+
const float LOBE = 0.06;
|
|
26
|
+
|
|
27
|
+
const float LACE = 0.3;
|
|
28
|
+
|
|
29
|
+
const float CELL = 0.045;
|
|
30
|
+
|
|
31
|
+
const float RUNUP = 0.4;
|
|
32
|
+
|
|
33
|
+
const float FOAMW = 0.1;
|
|
34
|
+
|
|
35
|
+
float hash12(vec2 p) {
|
|
36
|
+
vec3 p3 = fract(vec3(p.xyx) * 0.1031);
|
|
37
|
+
p3 += dot(p3, p3.yzx + 33.33);
|
|
38
|
+
return fract((p3.x + p3.y) * p3.z);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
vec2 hash22(vec2 p) {
|
|
42
|
+
vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));
|
|
43
|
+
p3 += dot(p3, p3.yzx + 33.33);
|
|
44
|
+
return fract((p3.xx + p3.yz) * p3.zy);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
float vnoise(vec2 p) {
|
|
48
|
+
vec2 i = floor(p);
|
|
49
|
+
vec2 f = fract(p);
|
|
50
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
51
|
+
return mix(
|
|
52
|
+
mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),
|
|
53
|
+
mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x),
|
|
54
|
+
f.y
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
float bubbles(vec2 p, float density) {
|
|
59
|
+
vec2 i = floor(p);
|
|
60
|
+
vec2 f = fract(p);
|
|
61
|
+
float d1 = 8.0;
|
|
62
|
+
float d2 = 8.0;
|
|
63
|
+
for (int y = -1; y <= 1; y++) {
|
|
64
|
+
for (int x = -1; x <= 1; x++) {
|
|
65
|
+
vec2 o = vec2(float(x), float(y));
|
|
66
|
+
vec2 c = o + 0.15 + 0.7 * hash22(i + o) - f;
|
|
67
|
+
float d = dot(c, c);
|
|
68
|
+
if (d < d1) {
|
|
69
|
+
d2 = d1;
|
|
70
|
+
d1 = d;
|
|
71
|
+
} else if (d < d2) {
|
|
72
|
+
d2 = d;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
float e = sqrt(d2) - sqrt(d1);
|
|
77
|
+
float w = 0.12 + 0.6 * density;
|
|
78
|
+
return (1.0 - smoothstep(w - 0.12, w + 0.12, e)) * smoothstep(0.0, 0.35, density);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
vec2 mirror(vec2 v) {
|
|
82
|
+
return 1.0 - abs(1.0 - mod(v, 2.0));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
vec4 transition(vec2 uv) {
|
|
86
|
+
vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);
|
|
87
|
+
vec2 q = (uv - 0.5) * vec2(ratio, 1.0);
|
|
88
|
+
|
|
89
|
+
float a = dot(q, dir);
|
|
90
|
+
float b = dot(q, vec2(-dir.y, dir.x));
|
|
91
|
+
|
|
92
|
+
float extent = 0.5 * (abs(dir.x) * ratio + abs(dir.y));
|
|
93
|
+
float start = -extent - LOBE - 0.1;
|
|
94
|
+
float stop = extent + LOBE + 0.01;
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
float up = clamp(progress / RUNUP, 0.0, 1.0);
|
|
98
|
+
float back = clamp((progress - RUNUP) / (1.0 - RUNUP), 0.0, 1.0);
|
|
99
|
+
float front = mix(start, stop, 1.0 - pow(1.0 - up, 1.6)) - (stop - start) * pow(back, 1.5);
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
float lobes = vnoise(vec2(b * 7.0 + 3.1, progress * 2.0)) * 0.7 + vnoise(vec2(b * 17.0, 5.0 + progress * 3.0)) * 0.3;
|
|
103
|
+
float behind = front + LOBE * (lobes - 0.5) * 2.0 - a;
|
|
104
|
+
float sheet = smoothstep(-AA, AA, behind);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
float swapped = max(smoothstep(0.01, 0.8 * FOAMW, behind), (progress < RUNUP ? sheet : 1.0) * smoothstep(RUNUP - 0.08, RUNUP, progress));
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
vec2 rp = vec2(a * 20.0, b * 5.0 + 3.0 * vnoise(q * 4.0)) - vec2(7.0 * min(progress, RUNUP) - 5.0 * back, 0.0);
|
|
112
|
+
float n0 = vnoise(rp);
|
|
113
|
+
vec2 g = (vnoise(rp + vec2(0.15, 0.0)) - n0) / 0.15 * dir + (vnoise(rp + vec2(0.0, 0.15)) - n0) / 0.15 * vec2(-dir.y, dir.x);
|
|
114
|
+
|
|
115
|
+
float thick = sheet * smoothstep(0.0, 0.12, behind);
|
|
116
|
+
vec2 off = g * refraction * thick * vec2(1.0 / ratio, 1.0);
|
|
117
|
+
|
|
118
|
+
vec4 c = mix(getFromColor(mirror(uv + off)), getToColor(mirror(uv + off)), swapped);
|
|
119
|
+
c.rgb = mix(c.rgb, water.rgb, water.a * sheet * (0.3 + 0.7 * smoothstep(0.0, 0.35, behind)));
|
|
120
|
+
|
|
121
|
+
float glint = pow(max(dot(normalize(vec3(-g, 3.0)), normalize(vec3(-0.3, 0.6, 1.0))), 0.0), 14.0);
|
|
122
|
+
c.rgb += glint * 0.4 * thick;
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
float wet = (1.0 - sheet) * exp(min(behind, 0.0) * 2.5) * smoothstep(RUNUP, RUNUP + 0.05, progress) * (1.0 - smoothstep(0.7, 1.0, progress));
|
|
126
|
+
c.rgb *= mix(vec3(1.0), c.rgb, 0.55 * wet);
|
|
127
|
+
c.rgb += 0.1 * wet * smoothstep(0.4, 0.9, vnoise(vec2(a * 30.0, b * 6.0)));
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
vec2 lp = vec2(a - 0.4 * (progress < RUNUP ? front : stop), b) / CELL;
|
|
133
|
+
|
|
134
|
+
float patches = smoothstep(0.45, 0.8, 0.6 * vnoise(lp * vec2(0.4, 0.1) + 4.0) + 0.4 * vnoise(lp * 0.3 + 9.0));
|
|
135
|
+
float bandW = FOAMW * (0.5 + vnoise(vec2(b * 25.0, 2.0)));
|
|
136
|
+
float density = (1.0 - smoothstep(0.0, bandW, behind)) * (1.0 - smoothstep(RUNUP - 0.05, RUNUP + 0.12, progress));
|
|
137
|
+
density = max(density, 0.55 * patches * (1.0 - smoothstep(0.0, LACE, behind)) * (1.0 - 0.5 * back));
|
|
138
|
+
density = max(density, 0.9 * (1.0 - smoothstep(0.0, 0.012 + 0.02 * vnoise(vec2(b * 40.0, 1.0)), behind)));
|
|
139
|
+
density *= sheet;
|
|
140
|
+
|
|
141
|
+
float f = 0.0;
|
|
142
|
+
if (density > 0.0) {
|
|
143
|
+
f = max(bubbles(lp, density), 0.85 * bubbles(lp * 1.7 + 7.0, density * 0.9));
|
|
144
|
+
f = max(f, 0.45 * smoothstep(0.15, 0.7, density)) * foam;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
c.rgb *= 1.0 - 0.25 * sheet * foam * (1.0 - f) * smoothstep(0.0, 0.6, density);
|
|
148
|
+
c.rgb = mix(c.rgb, vec3(0.97, 0.98, 0.97), clamp(f, 0.0, 1.0));
|
|
149
|
+
|
|
150
|
+
float sh = smoothstep(-0.03, 0.0, behind);
|
|
151
|
+
c.rgb *= 1.0 - 0.35 * (1.0 - sheet) * sh * sh * (1.0 - smoothstep(RUNUP - 0.05, RUNUP, progress));
|
|
152
|
+
return c;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
half4 main(float2 _coord) {
|
|
156
|
+
vec2 _uv = _coord / _resolution;
|
|
157
|
+
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
158
|
+
return half4(_c.rgb * _c.a, _c.a);
|
|
159
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// ShutterWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ShutterWipe.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A camera's focal-plane shutter fires across the frame, seen through the camera's gate: thin metal blades fan down from a tight stack above it until they overlap over the whole frame, then keep running down and stack below it, uncovering the incoming image from the 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
|
+
uniform int blades;
|
|
16
|
+
|
|
17
|
+
uniform float tilt;
|
|
18
|
+
|
|
19
|
+
uniform float gate;
|
|
20
|
+
|
|
21
|
+
uniform vec4 color;
|
|
22
|
+
|
|
23
|
+
const float STACK = 0.016;
|
|
24
|
+
const float REST = 0.05;
|
|
25
|
+
|
|
26
|
+
vec4 transition(vec2 uv) {
|
|
27
|
+
float n = clamp(float(blades), 3.0, 10.0);
|
|
28
|
+
|
|
29
|
+
float h = 1.7 / n + 0.02;
|
|
30
|
+
float pile = (n - 1.0) * STACK;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
float travel = 1.0 + 2.0 * REST + h + pile;
|
|
34
|
+
vec2 t = clamp((progress - vec2(0.0, 0.3)) / 0.7, 0.0, 1.0);
|
|
35
|
+
vec2 pos = 1.0 + REST + vec2(0.0, pile) - travel * t * t * (3.0 - 2.0 * t);
|
|
36
|
+
vec2 vel = travel * 6.0 * t * (1.0 - t) / 0.7;
|
|
37
|
+
|
|
38
|
+
float x = (uv.x - 0.5) * ratio;
|
|
39
|
+
|
|
40
|
+
vec4 col = progress < 0.5 ? getFromColor(uv) : getToColor(uv);
|
|
41
|
+
|
|
42
|
+
for (int i = 0; i < 10; i++) {
|
|
43
|
+
float k = float(i) / (n - 1.0);
|
|
44
|
+
if (k < 1.0001) {
|
|
45
|
+
float v = mix(vel.x, vel.y, k);
|
|
46
|
+
|
|
47
|
+
float d = uv.y - mix(pos.x, pos.y, k) + tilt * 0.1 * v * x;
|
|
48
|
+
|
|
49
|
+
float aa = 0.002 + 0.005 * v;
|
|
50
|
+
float sh = (1.0 - smoothstep(0.0, 0.03 + 0.012 * v, -d)) * (1.0 - smoothstep(-aa, aa, d));
|
|
51
|
+
col.rgb *= 1.0 - 0.65 * color.a * sh * sh;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
float l = clamp(d / h, 0.0, 1.0);
|
|
56
|
+
float lip = smoothstep(0.003, 0.007, d) * (1.0 - smoothstep(0.007, 0.014, d));
|
|
57
|
+
float s = (uv.y - d - 0.55 + 0.3 * x) * 2.5;
|
|
58
|
+
float sheen = 0.3 * exp(-s * s) * (1.0 - l) * (1.0 - l);
|
|
59
|
+
vec3 metal = color.rgb * (1.3 - 0.75 * l) + (0.25 * lip + sheen) * (0.6 + 0.4 * color.rgb) * color.a;
|
|
60
|
+
metal *= 0.4 + 0.6 * smoothstep(0.0, 0.005, d);
|
|
61
|
+
float cover = smoothstep(-aa, aa, d) * (1.0 - smoothstep(h - aa, h + aa, d));
|
|
62
|
+
col = mix(col, vec4(clamp(metal, 0.0, 1.0), color.a), cover);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
float g = gate * smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));
|
|
67
|
+
vec2 c = abs(uv - 0.5) * vec2(ratio, 1.0) - vec2(0.5 * ratio, 0.5) + 1.5 * g;
|
|
68
|
+
float e = length(max(c, 0.0)) + min(max(c.x, c.y), 0.0) - 0.5 * g;
|
|
69
|
+
float on = smoothstep(0.0, 0.002, gate) * smoothstep(0.0, 0.04, progress) * (1.0 - smoothstep(0.96, 1.0, progress));
|
|
70
|
+
|
|
71
|
+
col.rgb *= 1.0 - 0.5 * color.a * on * smoothstep(-0.4 * g - 0.001, 0.0, e);
|
|
72
|
+
vec3 housing = min(color.rgb * (1.5 - smoothstep(0.0, 0.2 * g + 0.001, e)), 1.0);
|
|
73
|
+
return mix(col, vec4(housing, color.a), on * smoothstep(-0.002, 0.002, e));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
half4 main(float2 _coord) {
|
|
77
|
+
vec2 _uv = _coord / _resolution;
|
|
78
|
+
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
79
|
+
return half4(_c.rgb * _c.a, _c.a);
|
|
80
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// SpotlightWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpotlightWipe.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The stage lights go down on the outgoing image and a soft oval spotlight searches across it along a curved path, comes to rest and lights the incoming image inside it, then widens until the stage lights come back up on 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 vec2 center;
|
|
16
|
+
|
|
17
|
+
uniform float size;
|
|
18
|
+
|
|
19
|
+
uniform float darkness;
|
|
20
|
+
|
|
21
|
+
uniform vec3 warmth;
|
|
22
|
+
|
|
23
|
+
const float FLAT = 0.72;
|
|
24
|
+
|
|
25
|
+
const float LIT = 0.74;
|
|
26
|
+
|
|
27
|
+
vec2 path(float t, vec2 c) {
|
|
28
|
+
vec2 a = vec2(0.08, 0.3);
|
|
29
|
+
vec2 b = vec2(0.35, 1.15);
|
|
30
|
+
vec2 d = vec2(1.05, 0.95);
|
|
31
|
+
float s = 1.0 - t;
|
|
32
|
+
return s * s * s * a + 3.0 * s * s * t * b + 3.0 * s * t * t * d + t * t * t * c;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
vec4 transition(vec2 uv) {
|
|
36
|
+
vec2 asp = vec2(ratio, 1.0);
|
|
37
|
+
float p = progress;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
float t = clamp(p / 0.5, 0.0, 1.0);
|
|
42
|
+
t = t * t * (3.0 - 2.0 * t);
|
|
43
|
+
vec2 c = path(t, center);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
vec2 far = max(center, 1.0 - center) * asp;
|
|
47
|
+
float full = length(vec2(far.x, far.y / FLAT)) / LIT;
|
|
48
|
+
float g = smoothstep(0.44, 1.0, p);
|
|
49
|
+
float radius = mix(0.5 * size, full, g * (0.3 + 0.7 * g));
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
vec2 q = (uv - c) * asp;
|
|
53
|
+
float r = length(vec2(q.x, q.y / FLAT)) / radius;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
float core = 1.0 - smoothstep(0.72, 1.08, r);
|
|
57
|
+
float ring = (r - 0.9) / 0.09;
|
|
58
|
+
float spot = max(core * (1.0 - 0.1 * r * r), 0.12 * (1.0 - smoothstep(0.9, 2.4, r))) + 0.16 * exp(-ring * ring);
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
float s = darkness * smoothstep(0.0, 0.18, p) * (1.0 - smoothstep(0.72, 1.0, p));
|
|
62
|
+
vec3 light = 1.0 - s + s * spot * warmth;
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
float lit = smoothstep(0.42, 0.58, p) * (1.0 - smoothstep(LIT, 1.0, r));
|
|
66
|
+
vec4 col = mix(getFromColor(uv), getToColor(uv), lit);
|
|
67
|
+
return vec4(col.rgb * light, col.a);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
half4 main(float2 _coord) {
|
|
71
|
+
vec2 _uv = _coord / _resolution;
|
|
72
|
+
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
73
|
+
return half4(_c.rgb * _c.a, _c.a);
|
|
74
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// StopMotion — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StopMotion.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The outgoing image is a paper cutout that jerks off the frame in choppy stop-motion steps, with a tiny new tilt and offset each step and a drop shadow, while the incoming cutout jerks in the same way and lands
|
|
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 steps;
|
|
16
|
+
|
|
17
|
+
uniform float jitter;
|
|
18
|
+
|
|
19
|
+
uniform float shadow;
|
|
20
|
+
|
|
21
|
+
uniform vec4 backColor;
|
|
22
|
+
|
|
23
|
+
uniform vec4 rimColor;
|
|
24
|
+
|
|
25
|
+
const float SHRINK = 0.2;
|
|
26
|
+
const float RIM = 0.012;
|
|
27
|
+
const float RADIUS = 0.006;
|
|
28
|
+
const float AA = 0.0015;
|
|
29
|
+
|
|
30
|
+
float hash11(float p) {
|
|
31
|
+
p = fract(p * 0.1031);
|
|
32
|
+
p *= p + 33.33;
|
|
33
|
+
p *= p + p;
|
|
34
|
+
return fract(p);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
float roundedBox(vec2 q, vec2 b, float r) {
|
|
38
|
+
vec2 d = abs(q) - b + r;
|
|
39
|
+
return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - r;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
vec4 premultiply(vec4 c) {
|
|
43
|
+
return vec4(c.rgb * c.a, c.a);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
float offFrame(vec2 h, float a) {
|
|
47
|
+
return 0.5 * ratio + abs(cos(a)) * h.x + abs(sin(a)) * h.y + 0.08;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
vec2 cutoutSize(float s, float l) {
|
|
51
|
+
return (0.5 * vec2(ratio, 1.0) + RIM * l) * s;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
vec4 drawCutout(vec4 col, vec2 q, vec2 c, float a, float s, float l, bool incoming) {
|
|
55
|
+
vec2 asp = vec2(ratio, 1.0);
|
|
56
|
+
vec2 halfImage = 0.5 * asp;
|
|
57
|
+
vec2 halfCut = halfImage + RIM * l;
|
|
58
|
+
float rad = RADIUS * l;
|
|
59
|
+
float ca = cos(a), sa = sin(a);
|
|
60
|
+
mat2 unrotate = mat2(ca, -sa, sa, ca);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
vec2 rs = unrotate * (q - c - vec2(0.018, -0.026) * l) / s;
|
|
65
|
+
vec2 ss = clamp(rs / asp + 0.5, 0.0, 1.0);
|
|
66
|
+
float sAlpha = max(incoming ? getToColor(ss).a : getFromColor(ss).a, rimColor.a);
|
|
67
|
+
float ds = roundedBox(rs, halfCut, rad) * s;
|
|
68
|
+
float blur = 0.004 + 0.016 * l;
|
|
69
|
+
col.rgb *= 1.0 - clamp(shadow, 0.0, 1.0) * 0.75 * l * sAlpha * (1.0 - smoothstep(-blur, blur, ds));
|
|
70
|
+
|
|
71
|
+
vec2 r = unrotate * (q - c) / s;
|
|
72
|
+
float dCut = roundedBox(r, halfCut, rad) * s;
|
|
73
|
+
float dImage = roundedBox(r, halfImage, 0.0) * s;
|
|
74
|
+
float cutCover = clamp(0.5 - dCut / AA, 0.0, 1.0);
|
|
75
|
+
float imageCover = clamp(0.5 - dImage / AA, 0.0, 1.0);
|
|
76
|
+
vec2 st = clamp(r / asp + 0.5, 0.0, 1.0);
|
|
77
|
+
vec4 img = premultiply(incoming ? getToColor(st) : getFromColor(st));
|
|
78
|
+
|
|
79
|
+
vec4 cut = mix(premultiply(rimColor), img, imageCover) * cutCover;
|
|
80
|
+
return cut + col * (1.0 - cut.a);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
vec4 transition(vec2 uv) {
|
|
84
|
+
float n = float(steps < 2 ? 2 : steps);
|
|
85
|
+
|
|
86
|
+
float k = floor(progress * n + 0.5);
|
|
87
|
+
if (k <= 0.0) return getFromColor(uv);
|
|
88
|
+
if (k >= n) return getToColor(uv);
|
|
89
|
+
|
|
90
|
+
vec2 q = (uv - 0.5) * vec2(ratio, 1.0);
|
|
91
|
+
float j = clamp(jitter, 0.0, 1.0);
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
float l0 = min(k / 2.0, 1.0);
|
|
95
|
+
float m0 = clamp((k - 1.0) / (0.45 * n), 0.0, 1.0);
|
|
96
|
+
m0 = m0 * m0 * (0.4 + 0.6 * m0);
|
|
97
|
+
float s0 = 1.0 - SHRINK * l0;
|
|
98
|
+
float a0 = 0.22 * m0 + l0 * j * 0.2 * (hash11(k) - 0.5);
|
|
99
|
+
vec2 c0 = vec2(-offFrame(cutoutSize(s0, l0), a0) * m0, 0.05 * m0 * m0)
|
|
100
|
+
+ l0 * j * vec2(0.07 * (hash11(k + 100.0) - 0.5), 0.05 * (hash11(k + 200.0) - 0.5));
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
float l1 = min((n - k) / 2.0, 1.0);
|
|
104
|
+
float m1 = clamp((n - 2.0 - k) / (0.45 * n), 0.0, 1.0);
|
|
105
|
+
m1 = m1 * m1 * (0.4 + 0.6 * m1);
|
|
106
|
+
float s1 = 1.0 - SHRINK * l1;
|
|
107
|
+
float a1 = -0.25 * m1 + l1 * j * 0.2 * (hash11(k + 300.0) - 0.5);
|
|
108
|
+
vec2 c1 = vec2(offFrame(cutoutSize(s1, l1), a1) * m1, -0.06 * m1 * m1)
|
|
109
|
+
+ l1 * j * vec2(0.07 * (hash11(k + 400.0) - 0.5), 0.05 * (hash11(k + 500.0) - 0.5));
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
vec4 col = premultiply(backColor);
|
|
113
|
+
if (m0 < 1.0) col = drawCutout(col, q, c0, a0, s0, l0, false);
|
|
114
|
+
if (m1 < 1.0) col = drawCutout(col, q, c1, a1, s1, l1, true);
|
|
115
|
+
if (col.a <= 0.0) return vec4(0.0);
|
|
116
|
+
col.rgb /= col.a;
|
|
117
|
+
|
|
118
|
+
col.rgb *= 1.0 - 0.04 * j * hash11(k + 600.0);
|
|
119
|
+
return col;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
half4 main(float2 _coord) {
|
|
123
|
+
vec2 _uv = _coord / _resolution;
|
|
124
|
+
vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);
|
|
125
|
+
return half4(_c.rgb * _c.a, _c.a);
|
|
126
|
+
}
|