shaders 2.2.37 → 2.2.38

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 (42) hide show
  1. package/dist/core/{Blob-C_fYRjJF.js → Blob-Ck1tVOL_.js} +1 -1
  2. package/dist/core/{FloatingParticles-B6KvHecR.js → FloatingParticles-D95-rj4h.js} +6 -3
  3. package/dist/core/{Godrays-iMO6X606.js → Godrays-DCk1c8sQ.js} +5 -3
  4. package/dist/core/{Ripples-BAcLsbLr.js → Ripples-DKBIp3Qq.js} +1 -1
  5. package/dist/core/{SimplexNoise-CxF7Tl5O.js → SimplexNoise-CMMeggo6.js} +3 -3
  6. package/dist/core/{SineWave-SIEiE1O3.js → SineWave-DVVLqHPw.js} +5 -3
  7. package/dist/core/{Spiral-PsIc1BI9.js → Spiral-DDyVSeG_.js} +5 -3
  8. package/dist/core/{Strands-xsbd_3Bt.js → Strands-B9vY4uA7.js} +1 -1
  9. package/dist/core/{Swirl-CV1prOHF.js → Swirl-DoCDBZad.js} +1 -1
  10. package/dist/core/{WaveDistortion-BRgbfqt3.js → WaveDistortion-Bo2Ar13M.js} +3 -2
  11. package/dist/core/index.js +11 -11
  12. package/dist/core/shaders/Blob/index.js +2 -2
  13. package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
  14. package/dist/core/shaders/FloatingParticles/index.js +2 -1
  15. package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
  16. package/dist/core/shaders/Godrays/index.js +2 -1
  17. package/dist/core/shaders/Ripples/index.js +2 -2
  18. package/dist/core/shaders/SimplexNoise/index.d.ts +1 -1
  19. package/dist/core/shaders/SimplexNoise/index.js +2 -2
  20. package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
  21. package/dist/core/shaders/SineWave/index.js +2 -1
  22. package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
  23. package/dist/core/shaders/Spiral/index.js +2 -1
  24. package/dist/core/shaders/Strands/index.js +2 -2
  25. package/dist/core/shaders/Swirl/index.js +2 -2
  26. package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
  27. package/dist/core/shaders/WaveDistortion/index.js +2 -1
  28. package/dist/core/{time-DgRTVr2F.js → time-BZqyVJXt.js} +6 -1
  29. package/dist/core/utilities/time.d.ts +4 -1
  30. package/dist/core/utilities/time.d.ts.map +1 -1
  31. package/dist/react/{generatePresetCode-DtpUpaeM.js → generatePresetCode-CPcLELa5.js} +1 -1
  32. package/dist/react/index.js +1 -1
  33. package/dist/react/utils/generatePresetCode.js +1 -1
  34. package/dist/registry.js +2 -2
  35. package/dist/solid/utils/generatePresetCode.js +1 -1
  36. package/dist/svelte/{generatePresetCode-Yu_cJh3q.js → generatePresetCode-By5juLjK.js} +1 -1
  37. package/dist/svelte/index.js +1 -1
  38. package/dist/svelte/utils/generatePresetCode.js +1 -1
  39. package/dist/vue/{generatePresetCode-DnK2X66E.js → generatePresetCode-REXb9hnv.js} +1 -1
  40. package/dist/vue/index.js +1 -1
  41. package/dist/vue/utils/generatePresetCode.js +1 -1
  42. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
2
- import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
3
  import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
4
4
  import { dot, float, length, max, normalize, pow, reflect, screenUV, sin, smoothstep, vec2, vec3, vec4, viewportSize } from "three/tsl";
5
5
  const componentDefinition = {
@@ -1,4 +1,5 @@
1
1
  import { r as transformColor } from "./transformations-YbhRK-rd.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
2
3
  import { Fn, cos, dot, float, floor, fract, length, min, mix, screenUV, sin, smoothstep, time, vec2, vec3, vec4, viewportSize } from "three/tsl";
3
4
  var hash1_2 = Fn(([p]) => {
4
5
  return fract(sin(dot(p, vec2(127.1, 311.7))).mul(43758.5453123));
@@ -145,8 +146,10 @@ const componentDefinition = {
145
146
  }
146
147
  }
147
148
  },
148
- fragmentNode: ({ uniforms, childNode }) => {
149
+ fragmentNode: (params) => {
150
+ const { uniforms, childNode } = params;
149
151
  const baseUV = screenUV;
152
+ const animTime = createAnimatedTime(params, uniforms.speed);
150
153
  const renderParticle = Fn(([uv$2]) => {
151
154
  const rootUV = floor(uv$2);
152
155
  const localPos = fract(uv$2);
@@ -184,7 +187,7 @@ const componentDefinition = {
184
187
  const offset = vec2(0).toVar();
185
188
  const angleRad = uniforms.angle.uniform.mul(3.14159).div(180);
186
189
  const baseMovementDir = vec2(cos(angleRad), sin(angleRad));
187
- const baseMovement = time.mul(baseMovementDir).mul(uniforms.speed.uniform);
190
+ const baseMovement = animTime.mul(baseMovementDir);
188
191
  const speedVar = uniforms.speedVariance.uniform;
189
192
  const angleVar = uniforms.angleVariance.uniform.mul(3.14159).div(180);
190
193
  for (let i = 0; i < 4; i++) {
@@ -194,7 +197,7 @@ const componentDefinition = {
194
197
  const angleDelta = layerHash.y.sub(.5).mul(angleVar).mul(2);
195
198
  const variedAngle = angleRad.add(angleDelta);
196
199
  const variedDir = vec2(cos(variedAngle), sin(variedAngle));
197
- const movement = baseMovement.mul(speedMod).add(variedDir.sub(baseMovementDir).mul(time).mul(uniforms.speed.uniform));
200
+ const movement = baseMovement.mul(speedMod).add(variedDir.sub(baseMovementDir).mul(animTime));
198
201
  const layerParticles = renderParticle(uv$2.mul(size).add(movement).add(offset)).mul(alpha);
199
202
  particles$1.assign(particles$1.add(layerActive.select(layerParticles, vec3(0))));
200
203
  offset.assign(offset.add(layerHash.mul(10)));
@@ -1,5 +1,6 @@
1
1
  import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
2
- import { Fn, PI, abs, atan, clamp, float, length, mix, pow, screenUV, sin, smoothstep, time, vec2, vec4 } from "three/tsl";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
+ import { Fn, PI, abs, atan, clamp, float, length, mix, pow, screenUV, sin, smoothstep, vec2, vec4 } from "three/tsl";
3
4
  const componentDefinition = {
4
5
  name: "Godrays",
5
6
  category: "Base Layers",
@@ -81,7 +82,8 @@ const componentDefinition = {
81
82
  }
82
83
  }
83
84
  },
84
- fragmentNode: ({ uniforms }) => {
85
+ fragmentNode: (params) => {
86
+ const { uniforms } = params;
85
87
  const uv$1 = screenUV;
86
88
  const centerPos = vec2(uniforms.center.uniform.x, uniforms.center.uniform.y.oneMinus());
87
89
  const shapeUV = uv$1.sub(centerPos);
@@ -105,8 +107,8 @@ const componentDefinition = {
105
107
  const nLeft = pow(valueNoise(left), intensity);
106
108
  return mix(pow(valueNoise(right), intensity), nLeft, smoothstep(-.15, .15, uv$2.x));
107
109
  });
110
+ const animTime = createAnimatedTime(params, uniforms.speed).mul(.2);
108
111
  const rayEffect = Fn(() => {
109
- const animTime = time.mul(uniforms.speed.uniform).mul(.2);
110
112
  const radius = length(shapeUV);
111
113
  const spots = float(6.5).mul(abs(uniforms.spotty.uniform));
112
114
  const intensityCalc = float(4).sub(float(3).mul(clamp(uniforms.intensity.uniform, 0, 1)));
@@ -1,5 +1,5 @@
1
1
  import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
2
- import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
3
  import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
4
4
  import { distance, float, screenUV, sin, smoothstep, vec2, viewportSize } from "three/tsl";
5
5
  const componentDefinition = {
@@ -1,5 +1,5 @@
1
1
  import { r as transformColor } from "./transformations-YbhRK-rd.js";
2
- import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
3
  import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
4
4
  import { clamp, exp, float, mx_noise_float, screenUV, vec2, vec3, viewportSize } from "three/tsl";
5
5
  const componentDefinition = {
@@ -17,7 +17,7 @@ const componentDefinition = {
17
17
  }
18
18
  },
19
19
  colorB: {
20
- default: "#000000",
20
+ default: "transparent",
21
21
  description: "Second color",
22
22
  transform: transformColor,
23
23
  ui: {
@@ -90,7 +90,7 @@ const componentDefinition = {
90
90
  const pos = aspectCorrectedUV.mul(exp(uniforms.scale.uniform)).add(uniforms.seed.uniform);
91
91
  const noise = mx_noise_float(vec3(pos.x, pos.y, animTime.mul(.5)));
92
92
  const contrastMultiplier = uniforms.contrast.uniform.add(1);
93
- const k = clamp(0, 1, noise.mul(contrastMultiplier).add(uniforms.balance.uniform).mul(.5).add(.5));
93
+ const k = clamp(noise.mul(contrastMultiplier).add(uniforms.balance.uniform).mul(.5).add(.5), 0, 1);
94
94
  return mixColors(uniforms.colorB.uniform, uniforms.colorA.uniform, k, float(0));
95
95
  }
96
96
  };
@@ -1,5 +1,6 @@
1
1
  import { n as transformAngle, r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
2
- import { PI, abs, cos, radians, screenUV, sin, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
+ import { PI, abs, cos, radians, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
3
4
  const componentDefinition = {
4
5
  name: "SineWave",
5
6
  category: "Base Layers",
@@ -94,7 +95,8 @@ const componentDefinition = {
94
95
  }
95
96
  }
96
97
  },
97
- fragmentNode: ({ uniforms }) => {
98
+ fragmentNode: (params) => {
99
+ const { uniforms } = params;
98
100
  const uv$1 = screenUV;
99
101
  const aspect = viewportSize.x.div(viewportSize.y);
100
102
  const aspectCorrectedUV = vec2(uv$1.x.mul(aspect), uv$1.y);
@@ -105,7 +107,7 @@ const componentDefinition = {
105
107
  const sinAngle = sin(angleRad);
106
108
  const rotatedX = centeredUV.x.mul(cosAngle).sub(centeredUV.y.mul(sinAngle));
107
109
  const rotatedY = centeredUV.x.mul(sinAngle).add(centeredUV.y.mul(cosAngle));
108
- const animatedTime = time.mul(uniforms.speed.uniform);
110
+ const animatedTime = createAnimatedTime(params, uniforms.speed);
109
111
  const sineWave = sin(rotatedX.mul(uniforms.frequency.uniform).mul(PI.mul(2)).add(animatedTime)).mul(uniforms.amplitude.uniform);
110
112
  const distanceFromWave = abs(rotatedY.sub(sineWave));
111
113
  const halfThickness = uniforms.thickness.uniform.mul(.5);
@@ -1,6 +1,7 @@
1
1
  import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
2
3
  import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
3
- import { abs, atan, clamp, float, fract, fwidth, length, mix, screenUV, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
4
+ import { abs, atan, clamp, float, fract, fwidth, length, mix, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
4
5
  const componentDefinition = {
5
6
  name: "Spiral",
6
7
  category: "Base Layers",
@@ -102,13 +103,14 @@ const componentDefinition = {
102
103
  }
103
104
  }
104
105
  },
105
- fragmentNode: ({ uniforms }) => {
106
+ fragmentNode: (params) => {
107
+ const { uniforms } = params;
106
108
  const baseUV = screenUV;
107
109
  const aspect = viewportSize.x.div(viewportSize.y);
108
110
  const aspectCorrectedUV = vec2(baseUV.x.mul(aspect), baseUV.y);
109
111
  const centerPos = vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
110
112
  const uv$1 = aspectCorrectedUV.sub(centerPos);
111
- const t = time.mul(uniforms.speed.uniform);
113
+ const t = createAnimatedTime(params, uniforms.speed);
112
114
  const l = length(uv$1);
113
115
  const adjustedLength = l;
114
116
  const angle = atan(uv$1.y, uv$1.x).sub(t);
@@ -1,5 +1,5 @@
1
1
  import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
2
- import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
3
  import { Fn, abs, cos, float, max, mix, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
4
4
  const componentDefinition = {
5
5
  name: "Strands",
@@ -1,5 +1,5 @@
1
1
  import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
2
- import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
2
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
3
3
  import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
4
4
  import { cos, screenUV, sin, smoothstep, vec2, vec4 } from "three/tsl";
5
5
  const componentDefinition = {
@@ -1,6 +1,7 @@
1
1
  import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
2
2
  import { o as transformEdges } from "./transformations-YbhRK-rd.js";
3
- import { PI, abs, convertToTexture, cos, float, fract, screenUV, sin, step, time, vec2, vec4 } from "three/tsl";
3
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
4
+ import { PI, abs, convertToTexture, cos, float, fract, screenUV, sin, step, vec2, vec4 } from "three/tsl";
4
5
  const componentDefinition = {
5
6
  name: "WaveDistortion",
6
7
  category: "Distortions",
@@ -118,7 +119,7 @@ const componentDefinition = {
118
119
  const { uniforms, childNode, onCleanup } = params;
119
120
  if (!childNode) return vec4(0, 0, 0, 0);
120
121
  const uvCoord = screenUV;
121
- const t = time.mul(uniforms.speed.uniform).mul(.5);
122
+ const t = createAnimatedTime(params, uniforms.speed).mul(.5);
122
123
  const angleRad = uniforms.angle.uniform.mul(PI).div(180);
123
124
  const cosAngle = cos(angleRad);
124
125
  const sinAngle = sin(angleRad);
@@ -1,11 +1,11 @@
1
1
  import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
2
2
  import { a as transformColorUpdate, c as transformPositionUpdate, r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
3
- import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
3
+ import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
4
4
  import { n as componentDefinition } from "./AngularBlur-CuwAjUOA.js";
5
5
  import { n as componentDefinition$1 } from "./Ascii-Dxk6VaBp.js";
6
6
  import "./colorMixing-CZPFmiT4.js";
7
7
  import { n as componentDefinition$2 } from "./Beam-CbG4MkLo.js";
8
- import { n as componentDefinition$3 } from "./Blob-C_fYRjJF.js";
8
+ import { n as componentDefinition$3 } from "./Blob-Ck1tVOL_.js";
9
9
  import { n as componentDefinition$4 } from "./Blur-k37gOaRA.js";
10
10
  import { n as componentDefinition$5 } from "./BrightnessContrast-CaErceqR.js";
11
11
  import { n as componentDefinition$6 } from "./Bulge-BVcWo6On.js";
@@ -21,10 +21,10 @@ import { n as componentDefinition$15 } from "./Dither-C1KyBYuE.js";
21
21
  import { n as componentDefinition$16 } from "./DotGrid-ll8XCA0p.js";
22
22
  import { n as componentDefinition$17 } from "./Duotone-d2gQJr4M.js";
23
23
  import { n as componentDefinition$18 } from "./FilmGrain-3h6TIe1T.js";
24
- import { n as componentDefinition$19 } from "./FloatingParticles-B6KvHecR.js";
24
+ import { n as componentDefinition$19 } from "./FloatingParticles-D95-rj4h.js";
25
25
  import { n as componentDefinition$20 } from "./GlassTiles-DqT67iqr.js";
26
26
  import { n as componentDefinition$21 } from "./Glow-BYNKuw0E.js";
27
- import { n as componentDefinition$22 } from "./Godrays-iMO6X606.js";
27
+ import { n as componentDefinition$22 } from "./Godrays-DCk1c8sQ.js";
28
28
  import { n as componentDefinition$23 } from "./Grayscale-BH3tLDGN.js";
29
29
  import { n as componentDefinition$24 } from "./Grid-CdslWvoH.js";
30
30
  import { n as componentDefinition$25 } from "./GridDistortion-D-iiGELF.js";
@@ -43,22 +43,22 @@ import { n as componentDefinition$37 } from "./Posterize-XoAqPWv2.js";
43
43
  import { n as componentDefinition$38 } from "./ProgressiveBlur-RuAm_BKx.js";
44
44
  import { n as componentDefinition$39 } from "./RadialGradient-BfFuRbIl.js";
45
45
  import { n as componentDefinition$40 } from "./RectangularCoordinates-CiW3J4UT.js";
46
- import { n as componentDefinition$41 } from "./Ripples-BAcLsbLr.js";
46
+ import { n as componentDefinition$41 } from "./Ripples-DKBIp3Qq.js";
47
47
  import { n as componentDefinition$42 } from "./Saturation-DVVlpikK.js";
48
48
  import { n as componentDefinition$43 } from "./Sharpness-cw57bW0s.js";
49
- import { n as componentDefinition$44 } from "./SimplexNoise-CxF7Tl5O.js";
50
- import { n as componentDefinition$45 } from "./SineWave-SIEiE1O3.js";
49
+ import { n as componentDefinition$44 } from "./SimplexNoise-CMMeggo6.js";
50
+ import { n as componentDefinition$45 } from "./SineWave-DVVLqHPw.js";
51
51
  import { n as componentDefinition$46 } from "./SolidColor-zYROg_aE.js";
52
52
  import { n as componentDefinition$47 } from "./Spherize-tsKMpSaS.js";
53
- import { n as componentDefinition$48 } from "./Spiral-PsIc1BI9.js";
54
- import { n as componentDefinition$49 } from "./Strands-xsbd_3Bt.js";
53
+ import { n as componentDefinition$48 } from "./Spiral-DDyVSeG_.js";
54
+ import { n as componentDefinition$49 } from "./Strands-B9vY4uA7.js";
55
55
  import { n as componentDefinition$50 } from "./Stretch-BhHjbcqd.js";
56
- import { n as componentDefinition$51 } from "./Swirl-CV1prOHF.js";
56
+ import { n as componentDefinition$51 } from "./Swirl-DoCDBZad.js";
57
57
  import { n as componentDefinition$52 } from "./TiltShift-BYQjUHpn.js";
58
58
  import { n as componentDefinition$53 } from "./Tritone-CJW8YTyB.js";
59
59
  import { n as componentDefinition$54 } from "./Twirl-5k_XPd51.js";
60
60
  import { n as componentDefinition$55 } from "./Vibrance-c25pkbWj.js";
61
- import { n as componentDefinition$56 } from "./WaveDistortion-BRgbfqt3.js";
61
+ import { n as componentDefinition$56 } from "./WaveDistortion-Bo2Ar13M.js";
62
62
  import { n as componentDefinition$57 } from "./ZoomBlur-DEozXA8U.js";
63
63
  import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, WebGPURenderer } from "three/webgpu";
64
64
  import { WebGLRenderer } from "three";
@@ -1,5 +1,5 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import "../../time-DgRTVr2F.js";
2
+ import "../../time-BZqyVJXt.js";
3
3
  import "../../colorMixing-CZPFmiT4.js";
4
- import { n as componentDefinition, t as Blob_default } from "../../Blob-C_fYRjJF.js";
4
+ import { n as componentDefinition, t as Blob_default } from "../../Blob-Ck1tVOL_.js";
5
5
  export { componentDefinition, Blob_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/FloatingParticles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAiClE,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA0MnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/FloatingParticles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAkClE,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA8MnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import { n as componentDefinition, t as FloatingParticles_default } from "../../FloatingParticles-B6KvHecR.js";
2
+ import "../../time-BZqyVJXt.js";
3
+ import { n as componentDefinition, t as FloatingParticles_default } from "../../FloatingParticles-D95-rj4h.js";
3
4
  export { componentDefinition, FloatingParticles_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Godrays/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAMvE,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAA;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAsJnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Godrays/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAOvE,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAA;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAyJnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import { n as componentDefinition, t as Godrays_default } from "../../Godrays-iMO6X606.js";
2
+ import "../../time-BZqyVJXt.js";
3
+ import { n as componentDefinition, t as Godrays_default } from "../../Godrays-DCk1c8sQ.js";
3
4
  export { componentDefinition, Godrays_default as default };
@@ -1,5 +1,5 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import "../../time-DgRTVr2F.js";
2
+ import "../../time-BZqyVJXt.js";
3
3
  import "../../colorMixing-CZPFmiT4.js";
4
- import { n as componentDefinition, t as Ripples_default } from "../../Ripples-BAcLsbLr.js";
4
+ import { n as componentDefinition, t as Ripples_default } from "../../Ripples-DKBIp3Qq.js";
5
5
  export { componentDefinition, Ripples_default as default };
@@ -12,7 +12,7 @@ export interface ComponentProps {
12
12
  * Second color
13
13
  *
14
14
  * Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`).
15
- * @default "#000000"
15
+ * @default "transparent"
16
16
  */
17
17
  colorB: string;
18
18
  /**
@@ -1,5 +1,5 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import "../../time-DgRTVr2F.js";
2
+ import "../../time-BZqyVJXt.js";
3
3
  import "../../colorMixing-CZPFmiT4.js";
4
- import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-CxF7Tl5O.js";
4
+ import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-CMMeggo6.js";
5
5
  export { componentDefinition, SimplexNoise_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/SineWave/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAErG,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,QAAQ,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IACjD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAsInE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/SineWave/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAGrG,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,QAAQ,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IACjD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAuInE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import { n as componentDefinition, t as SineWave_default } from "../../SineWave-SIEiE1O3.js";
2
+ import "../../time-BZqyVJXt.js";
3
+ import { n as componentDefinition, t as SineWave_default } from "../../SineWave-DVVLqHPw.js";
3
4
  export { componentDefinition, SineWave_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Spiral/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAyC,MAAM,qCAAqC,CAAA;AAG7H,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAyHnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Spiral/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAyC,MAAM,qCAAqC,CAAA;AAI7H,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA2HnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
+ import "../../time-BZqyVJXt.js";
2
3
  import "../../colorMixing-CZPFmiT4.js";
3
- import { n as componentDefinition, t as Spiral_default } from "../../Spiral-PsIc1BI9.js";
4
+ import { n as componentDefinition, t as Spiral_default } from "../../Spiral-DDyVSeG_.js";
4
5
  export { componentDefinition, Spiral_default as default };
@@ -1,4 +1,4 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import "../../time-DgRTVr2F.js";
3
- import { n as componentDefinition, t as Strands_default } from "../../Strands-xsbd_3Bt.js";
2
+ import "../../time-BZqyVJXt.js";
3
+ import { n as componentDefinition, t as Strands_default } from "../../Strands-B9vY4uA7.js";
4
4
  export { componentDefinition, Strands_default as default };
@@ -1,5 +1,5 @@
1
1
  import "../../transformations-YbhRK-rd.js";
2
- import "../../time-DgRTVr2F.js";
2
+ import "../../time-BZqyVJXt.js";
3
3
  import "../../colorMixing-CZPFmiT4.js";
4
- import { n as componentDefinition, t as Swirl_default } from "../../Swirl-CV1prOHF.js";
4
+ import { n as componentDefinition, t as Swirl_default } from "../../Swirl-DoCDBZad.js";
5
5
  export { componentDefinition, Swirl_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/WaveDistortion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAOvE,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAmLnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/WaveDistortion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAQvE,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAmLnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import "../../edges-Bd7GP4s2.js";
2
2
  import "../../transformations-YbhRK-rd.js";
3
- import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-BRgbfqt3.js";
3
+ import "../../time-BZqyVJXt.js";
4
+ import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-Bo2Ar13M.js";
4
5
  export { componentDefinition, WaveDistortion_default as default };
@@ -1,6 +1,11 @@
1
1
  import { uniform } from "three/tsl";
2
+ var accumulatedTimeCache = /* @__PURE__ */ new WeakMap();
2
3
  const createAnimatedTime = (params, speedUniform, seedUniform) => {
3
- const accumulatedTime = uniform(0);
4
+ let accumulatedTime = accumulatedTimeCache.get(speedUniform);
5
+ if (!accumulatedTime) {
6
+ accumulatedTime = uniform(0);
7
+ accumulatedTimeCache.set(speedUniform, accumulatedTime);
8
+ }
4
9
  params.onBeforeRender(({ deltaTime }) => {
5
10
  accumulatedTime.value += deltaTime * speedUniform.uniform.value;
6
11
  });
@@ -4,6 +4,9 @@ import { FragmentNodeParams } from '../types';
4
4
  * Creates an animated time value that accumulates based on speed and deltaTime.
5
5
  * This prevents the animation from rewinding when speed changes to 0, instead it pauses.
6
6
  *
7
+ * Uses WeakMap caching to ensure the same uniform is reused across multiple
8
+ * compositions of the same node (e.g., when used as both visible layer and mask).
9
+ *
7
10
  * @param params - Fragment node parameters containing onBeforeRender callback
8
11
  * @param speedUniform - The uniform controlling animation speed
9
12
  * @param seedUniform - Optional uniform for time offset/variation
@@ -19,5 +22,5 @@ export declare const createAnimatedTime: (params: FragmentNodeParams, speedUnifo
19
22
  uniform: any;
20
23
  }, seedUniform?: {
21
24
  uniform: any;
22
- }) => import('three/src/nodes/math/OperatorNode.js').default | import('three/webgpu').UniformNode<number>;
25
+ }) => import('three/src/nodes/math/OperatorNode.js').default | import('three/webgpu').UniformNode<unknown>;
23
26
  //# sourceMappingURL=time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utilities/time.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAA;AAEvD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,WACnB,kBAAkB,gBACZ;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,gBAChB;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,wGAiBjC,CAAA"}
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utilities/time.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAA;AASvD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB,WACnB,kBAAkB,gBACZ;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,gBAChB;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,yGA0BjC,CAAA"}
@@ -421,7 +421,7 @@ var shaderMetadata = {
421
421
  "opacity": 1,
422
422
  "blendMode": "normal",
423
423
  "colorA": "#ffffff",
424
- "colorB": "#000000",
424
+ "colorB": "transparent",
425
425
  "scale": 2,
426
426
  "balance": 0,
427
427
  "contrast": 0,
@@ -1,4 +1,4 @@
1
- import { n as generatePresetCode } from "./generatePresetCode-DtpUpaeM.js";
1
+ import { n as generatePresetCode } from "./generatePresetCode-CPcLELa5.js";
2
2
  import { createContext, useContext, useEffect, useMemo, useRef } from "react";
3
3
  import { createUniformsMap, shaderRenderer } from "../core/index.js";
4
4
  import { componentDefinition } from "../core/shaders/AngularBlur/index.js";
@@ -1,2 +1,2 @@
1
- import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-DtpUpaeM.js";
1
+ import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-CPcLELa5.js";
2
2
  export { availableComponents, generatePresetCode };
package/dist/registry.js CHANGED
@@ -5011,7 +5011,7 @@ export const shaderRegistry = [
5011
5011
  }
5012
5012
  },
5013
5013
  "colorB": {
5014
- "default": "#000000",
5014
+ "default": "transparent",
5015
5015
  "description": "Second color",
5016
5016
  "ui": {
5017
5017
  "type": "color",
@@ -5089,7 +5089,7 @@ export const shaderRegistry = [
5089
5089
  "type": "color",
5090
5090
  "label": "Color B"
5091
5091
  },
5092
- "default": "#000000",
5092
+ "default": "transparent",
5093
5093
  "description": "Second color"
5094
5094
  },
5095
5095
  "scale": {
@@ -423,7 +423,7 @@ const shaderMetadata = {
423
423
  "opacity": 1,
424
424
  "blendMode": "normal",
425
425
  "colorA": "#ffffff",
426
- "colorB": "#000000",
426
+ "colorB": "transparent",
427
427
  "scale": 2,
428
428
  "balance": 0,
429
429
  "contrast": 0,
@@ -421,7 +421,7 @@ var shaderMetadata = {
421
421
  "opacity": 1,
422
422
  "blendMode": "normal",
423
423
  "colorA": "#ffffff",
424
- "colorB": "#000000",
424
+ "colorB": "transparent",
425
425
  "scale": 2,
426
426
  "balance": 0,
427
427
  "contrast": 0,
@@ -1,4 +1,4 @@
1
- import { n as generatePresetCode } from "./generatePresetCode-Yu_cJh3q.js";
1
+ import { n as generatePresetCode } from "./generatePresetCode-By5juLjK.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as $ from "svelte/internal/client";
4
4
  import { getContext, onDestroy, onMount, setContext } from "svelte";
@@ -1,2 +1,2 @@
1
- import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-Yu_cJh3q.js";
1
+ import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-By5juLjK.js";
2
2
  export { availableComponents, generatePresetCode };
@@ -419,7 +419,7 @@ var shaderMetadata = {
419
419
  "opacity": 1,
420
420
  "blendMode": "normal",
421
421
  "colorA": "#ffffff",
422
- "colorB": "#000000",
422
+ "colorB": "transparent",
423
423
  "scale": 2,
424
424
  "balance": 0,
425
425
  "contrast": 0,
package/dist/vue/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as generatePresetCode } from "./generatePresetCode-DnK2X66E.js";
1
+ import { n as generatePresetCode } from "./generatePresetCode-REXb9hnv.js";
2
2
  import { computed, createElementBlock, createElementVNode, defineComponent, effectScope, inject, mergeDefaults, mergeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, toValue, watch } from "vue";
3
3
  import { createUniformsMap, shaderRenderer } from "../core/index.js";
4
4
  import { componentDefinition } from "../core/shaders/AngularBlur/index.js";
@@ -1,2 +1,2 @@
1
- import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-DnK2X66E.js";
1
+ import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-REXb9hnv.js";
2
2
  export { availableComponents, generatePresetCode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shaders",
3
- "version": "2.2.37",
3
+ "version": "2.2.38",
4
4
  "description": "Declarative shader components for Vue, React, and Svelte",
5
5
  "author": "Simon Le Marchant<https://github.com/marchantweb>",
6
6
  "homepage": "https://shaders.com/",