gl-transitions 2.2.0 → 2.4.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 +64 -0
- package/compatibility.json +464 -0
- package/gl-transitions.js +1 -1
- package/gl-transitions.json +1 -1
- package/glsl3/Accordion.glsl +85 -0
- package/glsl3/Ascii.glsl +124 -0
- package/glsl3/BlockCover.glsl +87 -0
- package/glsl3/BloomDissolve.glsl +110 -0
- package/glsl3/BokehDissolve.glsl +123 -0
- package/glsl3/BrushWipe.glsl +100 -0
- package/glsl3/CameraShake.glsl +98 -0
- package/glsl3/CardSwipe.glsl +81 -0
- package/glsl3/ColorPanelWipe.glsl +75 -0
- package/glsl3/CurvedWipe.glsl +52 -0
- package/glsl3/Disintegrate.glsl +112 -0
- package/glsl3/EyeBlink.glsl +83 -0
- package/glsl3/FilmDissolve.glsl +49 -0
- package/glsl3/FilmStrip.glsl +105 -0
- package/glsl3/FlameWipe.glsl +154 -0
- package/glsl3/Gallery.glsl +133 -0
- package/glsl3/GooeyWipe.glsl +97 -0
- package/glsl3/InkBleed.glsl +96 -0
- package/glsl3/LensFlare.glsl +125 -0
- package/glsl3/LightRays.glsl +106 -0
- package/glsl3/LightWipe.glsl +89 -0
- package/glsl3/PhotoDevelop.glsl +59 -0
- package/glsl3/PlusWipe.glsl +38 -0
- package/glsl3/PopIn.glsl +57 -0
- package/glsl3/SmokeDissolve.glsl +102 -0
- package/glsl3/SplatterWipe.glsl +154 -0
- package/glsl3/StretchSlide.glsl +62 -0
- package/glsl3/VhsTracking.glsl +127 -0
- package/glsl3/WedgeWipe.glsl +35 -0
- package/index.js +1 -1
- package/layouts.json +1091 -17
- package/llms-full.txt +774 -304
- package/llms.txt +189 -160
- package/msl/Accordion.metal +421 -0
- package/msl/Ascii.metal +567 -0
- package/msl/BlockCover.metal +403 -0
- package/msl/BloomDissolve.metal +416 -0
- package/msl/BokehDissolve.metal +447 -0
- package/msl/BrushWipe.metal +488 -0
- package/msl/CameraShake.metal +393 -0
- package/msl/CardSwipe.metal +342 -0
- package/msl/ColorPanelWipe.metal +314 -0
- package/msl/CurvedWipe.metal +229 -0
- package/msl/Disintegrate.metal +468 -0
- package/msl/EyeBlink.metal +355 -0
- package/msl/FilmDissolve.metal +199 -0
- package/msl/FilmStrip.metal +429 -0
- package/msl/FlameWipe.metal +575 -0
- package/msl/Gallery.metal +813 -0
- package/msl/GooeyWipe.metal +398 -0
- package/msl/InkBleed.metal +409 -0
- package/msl/LensFlare.metal +455 -0
- package/msl/LightRays.metal +427 -0
- package/msl/LightWipe.metal +321 -0
- package/msl/PhotoDevelop.metal +245 -0
- package/msl/PlusWipe.metal +199 -0
- package/msl/PopIn.metal +245 -0
- package/msl/SmokeDissolve.metal +400 -0
- package/msl/SplatterWipe.metal +677 -0
- package/msl/StretchSlide.metal +243 -0
- package/msl/VhsTracking.metal +514 -0
- package/msl/WedgeWipe.metal +154 -0
- package/package.json +1 -1
- package/skills/gl-transitions/references/catalog.md +115 -39
- package/sksl/Accordion.sksl +94 -0
- package/sksl/Ascii.sksl +131 -0
- package/sksl/BlockCover.sksl +96 -0
- package/sksl/BloomDissolve.sksl +119 -0
- package/sksl/BokehDissolve.sksl +132 -0
- package/sksl/BrushWipe.sksl +109 -0
- package/sksl/CameraShake.sksl +108 -0
- package/sksl/CardSwipe.sksl +93 -0
- package/sksl/ColorPanelWipe.sksl +85 -0
- package/sksl/CurvedWipe.sksl +64 -0
- package/sksl/Disintegrate.sksl +117 -0
- package/sksl/EyeBlink.sksl +94 -0
- package/sksl/FilmDissolve.sksl +60 -0
- package/sksl/FilmStrip.sksl +114 -0
- package/sksl/FlameWipe.sksl +162 -0
- package/sksl/Gallery.sksl +139 -0
- package/sksl/GooeyWipe.sksl +109 -0
- package/sksl/InkBleed.sksl +109 -0
- package/sksl/LensFlare.sksl +135 -0
- package/sksl/LightRays.sksl +115 -0
- package/sksl/LightWipe.sksl +97 -0
- package/sksl/PhotoDevelop.sksl +72 -0
- package/sksl/PlusWipe.sksl +50 -0
- package/sksl/PopIn.sksl +69 -0
- package/sksl/SmokeDissolve.sksl +115 -0
- package/sksl/SplatterWipe.sksl +161 -0
- package/sksl/StretchSlide.sksl +74 -0
- package/sksl/VhsTracking.sksl +138 -0
- package/sksl/WedgeWipe.sksl +46 -0
- package/sksl/index.js +1 -1
- package/transitions/Accordion.glsl +84 -0
- package/transitions/Ascii.glsl +123 -0
- package/transitions/BlockCover.glsl +86 -0
- package/transitions/BloomDissolve.glsl +109 -0
- package/transitions/BokehDissolve.glsl +122 -0
- package/transitions/BrushWipe.glsl +99 -0
- package/transitions/CameraShake.glsl +97 -0
- package/transitions/CardSwipe.glsl +80 -0
- package/transitions/ColorPanelWipe.glsl +74 -0
- package/transitions/CurvedWipe.glsl +51 -0
- package/transitions/Disintegrate.glsl +111 -0
- package/transitions/EyeBlink.glsl +82 -0
- package/transitions/FilmDissolve.glsl +48 -0
- package/transitions/FilmStrip.glsl +104 -0
- package/transitions/FlameWipe.glsl +153 -0
- package/transitions/Gallery.glsl +132 -0
- package/transitions/GooeyWipe.glsl +96 -0
- package/transitions/InkBleed.glsl +95 -0
- package/transitions/LensFlare.glsl +124 -0
- package/transitions/LightRays.glsl +105 -0
- package/transitions/LightWipe.glsl +88 -0
- package/transitions/PhotoDevelop.glsl +58 -0
- package/transitions/PlusWipe.glsl +37 -0
- package/transitions/PopIn.glsl +56 -0
- package/transitions/SmokeDissolve.glsl +101 -0
- package/transitions/SplatterWipe.glsl +153 -0
- package/transitions/StretchSlide.glsl +61 -0
- package/transitions/VhsTracking.glsl +126 -0
- package/transitions/WedgeWipe.glsl +34 -0
- package/wgsl/Accordion.wgsl +376 -0
- package/wgsl/Ascii.wgsl +519 -0
- package/wgsl/BlockCover.wgsl +352 -0
- package/wgsl/BloomDissolve.wgsl +372 -0
- package/wgsl/BokehDissolve.wgsl +409 -0
- package/wgsl/BrushWipe.wgsl +443 -0
- package/wgsl/CameraShake.wgsl +348 -0
- package/wgsl/CardSwipe.wgsl +308 -0
- package/wgsl/ColorPanelWipe.wgsl +274 -0
- package/wgsl/CurvedWipe.wgsl +198 -0
- package/wgsl/Disintegrate.wgsl +426 -0
- package/wgsl/EyeBlink.wgsl +308 -0
- package/wgsl/FilmDissolve.wgsl +169 -0
- package/wgsl/FilmStrip.wgsl +381 -0
- package/wgsl/FlameWipe.wgsl +531 -0
- package/wgsl/Gallery.wgsl +741 -0
- package/wgsl/GooeyWipe.wgsl +353 -0
- package/wgsl/InkBleed.wgsl +366 -0
- package/wgsl/LensFlare.wgsl +406 -0
- package/wgsl/LightRays.wgsl +380 -0
- package/wgsl/LightWipe.wgsl +277 -0
- package/wgsl/PhotoDevelop.wgsl +213 -0
- package/wgsl/PlusWipe.wgsl +165 -0
- package/wgsl/PopIn.wgsl +213 -0
- package/wgsl/SmokeDissolve.wgsl +363 -0
- package/wgsl/SplatterWipe.wgsl +613 -0
- package/wgsl/StretchSlide.wgsl +213 -0
- package/wgsl/VhsTracking.wgsl +462 -0
- package/wgsl/WedgeWipe.wgsl +126 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// VhsTracking — GLSL ES 3.00, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/VhsTracking.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: Tape-tracking bands of white snow roll down the frame, tearing the lines around them, with smeared color, wobbling lines, a jittering strip at the bottom and a dropout flash, as the incoming image is recorded over the outgoing one under the densest band
|
|
5
|
+
// Tags: retro, glitch, noise, tape, scanlines
|
|
6
|
+
|
|
7
|
+
// @range(1, 4, 1) Number of noise bands rolling down (the first one carries the cut)
|
|
8
|
+
uniform int bands; // = 3
|
|
9
|
+
// @range(0, 1) Amount of snow and tearing in the bands
|
|
10
|
+
uniform float noise; // = 0.6
|
|
11
|
+
// @range(0, 1) How far the color smears to the right of the picture
|
|
12
|
+
uniform float bleed; // = 0.5
|
|
13
|
+
// @range(0, 1) How much the lines wobble sideways
|
|
14
|
+
uniform float wobble; // = 0.5
|
|
15
|
+
|
|
16
|
+
const float LINES = 220.0; // tape lines over the frame height
|
|
17
|
+
const float FRAMES = 40.0; // the noise changes this many times over the transition
|
|
18
|
+
const float BAND = 0.11; // half height of the main band
|
|
19
|
+
const float STRIP = 0.06; // height of the jittering strip at the bottom
|
|
20
|
+
const int TAPS = 6;
|
|
21
|
+
|
|
22
|
+
float hash12(vec2 v) {
|
|
23
|
+
vec3 v3 = fract(vec3(v.xyx) * 0.1031);
|
|
24
|
+
v3 += dot(v3, v3.yzx + 33.33);
|
|
25
|
+
return fract((v3.x + v3.y) * v3.z);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
vec2 mirror(vec2 v) {
|
|
29
|
+
return 1.0 - abs(1.0 - mod(v, 2.0));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// the tape image on the outgoing (or, once re-recorded, incoming) side, premultiplied
|
|
33
|
+
vec4 tape(vec2 p, bool fresh) {
|
|
34
|
+
p = mirror(p);
|
|
35
|
+
vec4 c = fresh ? getToColor(p) : getFromColor(p);
|
|
36
|
+
return vec4(c.rgb * c.a, c.a);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
float luma(vec3 c) {
|
|
40
|
+
return dot(c, vec3(0.299, 0.587, 0.114));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// how dense a band centered at y = c of half height w is on line y, with ragged edges
|
|
44
|
+
float bandDensity(float y, float c, float w, float jitter) {
|
|
45
|
+
float d = abs(y - c) / w + 0.35 * jitter;
|
|
46
|
+
return 1.0 - smoothstep(0.0, 1.0, d);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
vec4 transition(vec2 uv) {
|
|
50
|
+
// the effects build up quickly and settle at the end: exactly 0 at both ends
|
|
51
|
+
float h = clamp(2.5 * (1.0 - abs(2.0 * progress - 1.0)), 0.0, 1.0);
|
|
52
|
+
float env = h * h * (3.0 - 2.0 * h);
|
|
53
|
+
// a short dropout flash when the main band crosses the middle of the frame
|
|
54
|
+
float f = clamp(1.0 - abs(progress - 0.5) / 0.04, 0.0, 1.0);
|
|
55
|
+
float flash = f * f * (3.0 - 2.0 * f);
|
|
56
|
+
|
|
57
|
+
float frame = floor(progress * FRAMES);
|
|
58
|
+
float line = floor(uv.y * LINES);
|
|
59
|
+
float jitter = hash12(vec2(line, frame + 7.0)) - 0.5;
|
|
60
|
+
|
|
61
|
+
// the main band rolls from above the frame to below it; the incoming image is above it
|
|
62
|
+
float c0 = mix(1.0 + 1.2 * BAND, -1.2 * BAND, progress);
|
|
63
|
+
// (the cut is ragged, line by line)
|
|
64
|
+
bool fresh = uv.y > c0 + 0.8 * BAND * jitter;
|
|
65
|
+
float dens = bandDensity(uv.y, c0, BAND, jitter);
|
|
66
|
+
float tear = 1.0 - smoothstep(0.0, 1.0, abs(uv.y - c0) / (2.5 * BAND));
|
|
67
|
+
// thinner and weaker bands roll faster, wrapping around the frame
|
|
68
|
+
for (int i = 1; i < 4; i++) {
|
|
69
|
+
if (i < bands) {
|
|
70
|
+
float k = float(i);
|
|
71
|
+
float w = BAND * (0.35 + 0.2 * hash12(vec2(k, 3.0)));
|
|
72
|
+
float speed = 1.3 + 0.9 * k;
|
|
73
|
+
float cy = -w + (1.0 + 2.0 * w) * fract(hash12(vec2(k, 5.0)) - speed * progress);
|
|
74
|
+
dens = max(dens, 0.6 * bandDensity(uv.y, cy, w, jitter));
|
|
75
|
+
tear = max(tear, 0.5 * (1.0 - smoothstep(0.0, 1.0, abs(uv.y - cy) / (2.5 * w))));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
dens *= env;
|
|
79
|
+
tear *= env;
|
|
80
|
+
|
|
81
|
+
// horizontal displacement of the line: a slow wobble, a fine jitter and the tearing
|
|
82
|
+
float rowTear = hash12(vec2(floor(uv.y * LINES * 0.5), frame + 31.0)) - 0.5;
|
|
83
|
+
float dx = wobble * env * (0.006 * sin(uv.y * 7.0 + progress * 23.0) + 0.004 * jitter);
|
|
84
|
+
dx += (0.3 + 0.7 * noise) * tear * 0.18 * rowTear;
|
|
85
|
+
// the head-switching strip at the bottom: lines skewed sideways and jittering
|
|
86
|
+
float strip = env * (1.0 - smoothstep(0.0, STRIP, uv.y));
|
|
87
|
+
dx += strip * (0.03 + 0.06 * (1.0 - uv.y / STRIP)) * (0.6 + 0.8 * hash12(vec2(frame, 41.0)));
|
|
88
|
+
vec2 q = vec2(uv.x + dx, uv.y);
|
|
89
|
+
|
|
90
|
+
vec4 c = tape(q, fresh);
|
|
91
|
+
if (c.a <= 0.0) return vec4(0.0);
|
|
92
|
+
// chroma bleed: the color is smeared to the right of the luma
|
|
93
|
+
float len = bleed * (0.02 + 0.05 * dens) * env;
|
|
94
|
+
vec4 avg = c;
|
|
95
|
+
if (len > 0.0) {
|
|
96
|
+
avg = vec4(0.0);
|
|
97
|
+
for (int i = 0; i < TAPS; i++) {
|
|
98
|
+
float u = (float(i) + 0.5) / float(TAPS);
|
|
99
|
+
avg += tape(q - vec2(len * (0.4 + u), 0.0), fresh);
|
|
100
|
+
}
|
|
101
|
+
avg /= float(TAPS);
|
|
102
|
+
}
|
|
103
|
+
vec3 chroma = (avg.rgb - luma(avg.rgb)) / max(avg.a, 1e-5);
|
|
104
|
+
vec3 rgb = luma(c.rgb) + chroma * c.a; // premultiplied by c.a
|
|
105
|
+
// the signal fades and loses color under the bands
|
|
106
|
+
rgb = mix(rgb, vec3(luma(rgb)), 0.6 * dens);
|
|
107
|
+
|
|
108
|
+
// snow: short white streaks on the tape lines, denser in the bands
|
|
109
|
+
// (the streaks of each line start at a random offset so they never line up vertically)
|
|
110
|
+
vec2 cell = vec2(floor(uv.x * LINES * 0.3 * ratio + 40.0 * jitter), line);
|
|
111
|
+
float n = hash12(cell + frame * vec2(37.0, 17.0));
|
|
112
|
+
float amount = clamp(noise * max(1.3 * dens, 0.8 * strip) + 0.35 * flash, 0.0, 1.0);
|
|
113
|
+
float snow = amount > 0.0 ? smoothstep(1.0 - amount, 1.0 - 0.6 * amount, n) : 0.0;
|
|
114
|
+
snow *= 0.55 + 0.45 * hash12(cell.yx + frame);
|
|
115
|
+
// and a finer sparkle between them
|
|
116
|
+
float g = hash12(vec2(floor(uv.x * LINES * ratio), line) + frame * vec2(13.0, 29.0));
|
|
117
|
+
snow = max(snow, amount > 0.0 ? 0.7 * smoothstep(1.0 - 0.4 * amount, 1.0, g) : 0.0);
|
|
118
|
+
// and a few dark specks
|
|
119
|
+
float dark = g < 0.1 * amount ? 1.0 : 0.0;
|
|
120
|
+
// the dropout: whole stretches of a few lines go white
|
|
121
|
+
float group = floor(uv.y * LINES / 3.0);
|
|
122
|
+
float drop = step(1.0 - 0.15 * flash, hash12(vec2(group, floor(uv.x * 6.0 + 5.0 * hash12(vec2(group, frame))) + frame * 7.0)));
|
|
123
|
+
rgb *= 1.0 - 0.5 * dark;
|
|
124
|
+
rgb += (clamp(snow + drop + 0.12 * flash, 0.0, 1.0)) * (c.a - rgb);
|
|
125
|
+
|
|
126
|
+
return vec4(clamp(rgb / c.a, 0.0, 1.0), c.a);
|
|
127
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// WedgeWipe — GLSL ES 3.00, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WedgeWipe.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: Two hands sweep away from each other around the center, opening a widening wedge that reveals the incoming image
|
|
5
|
+
// Tags: wipe, radial, clock, wedge
|
|
6
|
+
|
|
7
|
+
#define PI 3.141592653589793
|
|
8
|
+
|
|
9
|
+
// @range(-180, 180) Direction the wedge opens from, in degrees clockwise from 12 o'clock
|
|
10
|
+
uniform float angle; // = 0.0
|
|
11
|
+
// @range(0, 0.2) Softness of the hands' edges
|
|
12
|
+
uniform float smoothness; // = 0.01
|
|
13
|
+
// @param Point the hands turn around
|
|
14
|
+
uniform vec2 center; // = vec2(0.5)
|
|
15
|
+
|
|
16
|
+
vec4 transition (vec2 uv) {
|
|
17
|
+
// At the end, float PI rounds above pi and sin(spread) can turn slightly negative
|
|
18
|
+
if (progress >= 1.0) return getToColor(uv);
|
|
19
|
+
// Measured in square pixels, so the angles are not stretched
|
|
20
|
+
vec2 q = (uv - center) * vec2(ratio, 1.0);
|
|
21
|
+
float a = radians(angle);
|
|
22
|
+
// Local frame: y along the starting direction, x across it (the wedge is symmetric)
|
|
23
|
+
vec2 p = vec2(abs(q.x * cos(a) - q.y * sin(a)), q.x * sin(a) + q.y * cos(a));
|
|
24
|
+
// Each hand has turned by half a turn at the end
|
|
25
|
+
float spread = PI * progress;
|
|
26
|
+
vec2 hand = vec2(sin(spread), cos(spread));
|
|
27
|
+
// Signed distance to the wedge: the nearest hand, negative inside
|
|
28
|
+
float l = length(p);
|
|
29
|
+
float d = length(p - hand * clamp(dot(p, hand), 0.0, l)) * sign(hand.y * p.x - hand.x * p.y);
|
|
30
|
+
// The soft edge keeps an even width and slides from outside to inside the hands,
|
|
31
|
+
// so nothing is revealed at the start and everything is at the end
|
|
32
|
+
float s = max(smoothness, 0.001);
|
|
33
|
+
float m = 1.0 - smoothstep(0.0, s, d + s * (1.0 - progress));
|
|
34
|
+
return mix(getFromColor(uv), getToColor(uv), m);
|
|
35
|
+
}
|