gl-transitions 1.72.0 → 1.74.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-transitions",
3
- "version": "1.72.0",
3
+ "version": "1.74.0",
4
4
  "description": "The open collection of GL Transitions",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
package/sksl/Fold.sksl CHANGED
@@ -13,9 +13,9 @@ vec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv
13
13
  vec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }
14
14
 
15
15
  vec4 transition(vec2 uv) {
16
- vec4 a = getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));
17
- vec4 b = getToColor(uv / vec2(progress, 1.0));
18
- return mix(a, b, step(uv.x, progress));
16
+
17
+ if (progress == 0.0 || uv.x > progress) return getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));
18
+ return getToColor(uv / vec2(progress, 1.0));
19
19
  }
20
20
 
21
21
  half4 main(float2 _coord) {
@@ -1,5 +1,5 @@
1
1
  // old_tv_lost_signal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/old_tv_lost_signal.glsl
2
- // Author: mernking gitlab: Godswork
2
+ // Author: mernking (gitlab.com/Godswork)
3
3
  // License: MIT
4
4
  // Description: A crossfade with drifting tracking lines and tearing, like a TV losing its signal
5
5
 
@@ -47,7 +47,10 @@ float getWave(vec2 p){
47
47
  float offset = mix(40.0, 30.0, smoothstep(0.0, 1.0, x));
48
48
  float ease_degs = quadraticInOut(sin(degs));
49
49
  float deg_wave_pos = (ease_degs * magnitude) * sin(x * offset);
50
- return x + deg_wave_pos;
50
+
51
+
52
+
53
+ return x - max(smoothness, 0.01) * (1.0 - smoothstep(0.0, 0.1, x)) + deg_wave_pos;
51
54
  }
52
55
 
53
56
  vec4 transition(vec2 p) {
@@ -5,7 +5,7 @@
5
5
  // Ported from https://gist.github.com/nwoeanhinnogaehr/f6fc39f4cfcbb97f96a6
6
6
 
7
7
  vec4 transition(vec2 uv) {
8
- vec4 a = getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));
9
- vec4 b = getToColor(uv / vec2(progress, 1.0));
10
- return mix(a, b, step(uv.x, progress));
8
+ // Only sample the visible side: the other one divides by zero at progress 0 and 1.
9
+ if (progress == 0.0 || uv.x > progress) return getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));
10
+ return getToColor(uv / vec2(progress, 1.0));
11
11
  }
@@ -13,7 +13,7 @@
13
13
 
14
14
  //direction of movement : 0 : up, 1, down
15
15
  // @param Direction of the melt (false: up, true: down)
16
- uniform bool direction; // = 1
16
+ uniform bool direction; // = true
17
17
  //luminance threshold
18
18
  // @range(0, 1) Luminance threshold
19
19
  uniform float l_threshold; // = 0.8
@@ -1,4 +1,4 @@
1
- // Author: mernking gitlab: Godswork
1
+ // Author: mernking (gitlab.com/Godswork)
2
2
  // License: MIT
3
3
  // Description: A crossfade with drifting tracking lines and tearing, like a TV losing its signal
4
4
  // Tags: retro, glitch, scanlines
@@ -40,7 +40,10 @@ float getWave(vec2 p){
40
40
  float offset = mix(40.0, 30.0, smoothstep(0.0, 1.0, x));
41
41
  float ease_degs = quadraticInOut(sin(degs));
42
42
  float deg_wave_pos = (ease_degs * magnitude) * sin(x * offset);
43
- return x + deg_wave_pos;
43
+ // The soft edge reaches `smoothness` beyond the radius and the burn band 0.005 inside it:
44
+ // start the radius below both so nothing but the outgoing image shows at progress 0
45
+ // (unchanged from progress 0.1 on).
46
+ return x - max(smoothness, 0.01) * (1.0 - smoothstep(0.0, 0.1, x)) + deg_wave_pos;
44
47
  }
45
48
 
46
49
  vec4 transition(vec2 p) {