shaders 2.2.23 → 2.2.25

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 (213) hide show
  1. package/dist/core/AngularBlur-Dl2gwk68.js +64 -0
  2. package/dist/core/Ascii-Dha_QpT3.js +286 -0
  3. package/dist/core/Beam-CTN9Ni43.js +139 -0
  4. package/dist/core/Blob-CxFDZovO.js +218 -0
  5. package/dist/core/Blur-Y2FsmFk_.js +77 -0
  6. package/dist/core/Bulge-Cb-t0xqI.js +132 -0
  7. package/dist/core/CRTScreen-CtERsenz.js +112 -0
  8. package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
  9. package/dist/core/Checkerboard-CgB-egNY.js +83 -0
  10. package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
  11. package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
  12. package/dist/core/Circle-Daziv5d7.js +67 -0
  13. package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
  14. package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
  15. package/dist/core/Dither-D2Nf4p3w.js +66 -0
  16. package/dist/core/DotGrid-CzOwquo4.js +75 -0
  17. package/dist/core/Duotone-XuTN9tI7.js +65 -0
  18. package/dist/core/FilmGrain-D3-nbi12.js +28 -0
  19. package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
  20. package/dist/core/GlassTiles-CnjCvajI.js +69 -0
  21. package/dist/core/Glow-BluFc9be.js +75 -0
  22. package/dist/core/Godrays-ChLh_vGl.js +144 -0
  23. package/dist/core/Grayscale-DRny75A9.js +20 -0
  24. package/dist/core/Grid-DgyDa4H1.js +58 -0
  25. package/dist/core/GridDistortion-BAspCYvp.js +188 -0
  26. package/dist/core/Group-Dul7PUBl.js +14 -0
  27. package/dist/core/Halftone-Ifv5F_FT.js +65 -0
  28. package/dist/core/HueShift-De8ukMWs.js +31 -0
  29. package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
  30. package/dist/core/Invert-Fz0NtIJc.js +21 -0
  31. package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
  32. package/dist/core/LinearGradient-xbloQjzt.js +133 -0
  33. package/dist/core/Liquify-DMe1V5-O.js +175 -0
  34. package/dist/core/Pixelate-Cv8537Pj.js +37 -0
  35. package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
  36. package/dist/core/Posterize-3m3xkWOz.js +29 -0
  37. package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
  38. package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
  39. package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
  40. package/dist/core/Ripples-8XaZaXQF.js +117 -0
  41. package/dist/core/Saturation-CYFI1jzN.js +30 -0
  42. package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
  43. package/dist/core/SineWave-Dl3nFO1W.js +120 -0
  44. package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
  45. package/dist/core/Spherize-C-jZEUsN.js +128 -0
  46. package/dist/core/Spiral-BSB_R39p.js +132 -0
  47. package/dist/core/Strands-0stO5BMy.js +161 -0
  48. package/dist/core/Stretch-B645paha.js +133 -0
  49. package/dist/core/Swirl-CVnbawit.js +173 -0
  50. package/dist/core/TiltShift-0CxNRI6L.js +134 -0
  51. package/dist/core/Tritone-Daa-I5UD.js +76 -0
  52. package/dist/core/Twirl-2CJVZEtk.js +96 -0
  53. package/dist/core/Vibrance-DRtecEvb.js +30 -0
  54. package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
  55. package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
  56. package/dist/core/colorMixing-BXiTAqJU.js +69 -0
  57. package/dist/core/edges-Bn_OIa_h.js +26 -0
  58. package/dist/core/index.js +2257 -1604
  59. package/dist/core/shaderRegistry.d.ts.map +1 -1
  60. package/dist/core/shaders/AngularBlur/index.js +3 -7
  61. package/dist/core/shaders/Ascii/index.js +2 -6
  62. package/dist/core/shaders/Beam/index.d.ts +71 -0
  63. package/dist/core/shaders/Beam/index.d.ts.map +1 -0
  64. package/dist/core/shaders/Beam/index.js +4 -0
  65. package/dist/core/shaders/Blob/index.js +5 -9
  66. package/dist/core/shaders/Blur/index.js +2 -6
  67. package/dist/core/shaders/Bulge/index.js +4 -8
  68. package/dist/core/shaders/CRTScreen/index.js +2 -6
  69. package/dist/core/shaders/ChannelBlur/index.js +2 -6
  70. package/dist/core/shaders/Checkerboard/index.js +4 -8
  71. package/dist/core/shaders/ChromaFlow/index.js +3 -7
  72. package/dist/core/shaders/ChromaticAberration/index.js +3 -7
  73. package/dist/core/shaders/Circle/index.js +3 -7
  74. package/dist/core/shaders/CursorTrail/index.js +4 -8
  75. package/dist/core/shaders/DiffuseBlur/index.js +4 -8
  76. package/dist/core/shaders/Dither/index.js +3 -7
  77. package/dist/core/shaders/DotGrid/index.js +3 -7
  78. package/dist/core/shaders/Duotone/index.js +4 -8
  79. package/dist/core/shaders/FilmGrain/index.js +2 -6
  80. package/dist/core/shaders/FloatingParticles/index.js +3 -7
  81. package/dist/core/shaders/GlassTiles/index.js +2 -6
  82. package/dist/core/shaders/Glow/index.js +2 -6
  83. package/dist/core/shaders/Godrays/index.js +3 -7
  84. package/dist/core/shaders/Grayscale/index.js +2 -8
  85. package/dist/core/shaders/Grid/index.js +3 -7
  86. package/dist/core/shaders/GridDistortion/index.js +4 -8
  87. package/dist/core/shaders/Group/index.js +2 -6
  88. package/dist/core/shaders/Halftone/index.js +3 -7
  89. package/dist/core/shaders/HueShift/index.js +2 -8
  90. package/dist/core/shaders/ImageTexture/index.js +2 -6
  91. package/dist/core/shaders/Invert/index.js +2 -6
  92. package/dist/core/shaders/LinearBlur/index.js +3 -7
  93. package/dist/core/shaders/LinearGradient/index.js +4 -8
  94. package/dist/core/shaders/Liquify/index.js +4 -8
  95. package/dist/core/shaders/Pixelate/index.js +2 -6
  96. package/dist/core/shaders/PolarCoordinates/index.js +4 -8
  97. package/dist/core/shaders/Posterize/index.js +2 -7
  98. package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
  99. package/dist/core/shaders/RadialGradient/index.js +4 -8
  100. package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
  101. package/dist/core/shaders/Ripples/index.js +5 -9
  102. package/dist/core/shaders/Saturation/index.js +2 -8
  103. package/dist/core/shaders/SimplexNoise/index.js +5 -9
  104. package/dist/core/shaders/SineWave/index.js +3 -7
  105. package/dist/core/shaders/SolidColor/index.js +3 -7
  106. package/dist/core/shaders/Spherize/index.js +3 -7
  107. package/dist/core/shaders/Spiral/index.js +4 -8
  108. package/dist/core/shaders/Strands/index.js +4 -8
  109. package/dist/core/shaders/Stretch/index.js +4 -8
  110. package/dist/core/shaders/Swirl/index.js +5 -9
  111. package/dist/core/shaders/TiltShift/index.js +3 -7
  112. package/dist/core/shaders/Tritone/index.js +4 -8
  113. package/dist/core/shaders/Twirl/index.js +4 -8
  114. package/dist/core/shaders/Vibrance/index.js +2 -8
  115. package/dist/core/shaders/WaveDistortion/index.js +4 -8
  116. package/dist/core/shaders/ZoomBlur/index.js +3 -7
  117. package/dist/core/telemetry/index.js +189 -157
  118. package/dist/core/time-CTJvRUZ4.js +10 -0
  119. package/dist/core/transformations-DxfQXZWi.js +4715 -0
  120. package/dist/react/components/Beam.d.ts +31 -0
  121. package/dist/react/components/Beam.d.ts.map +1 -0
  122. package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
  123. package/dist/react/index.d.ts +1 -0
  124. package/dist/react/index.d.ts.map +1 -1
  125. package/dist/react/index.js +7649 -104600
  126. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  127. package/dist/react/utils/generatePresetCode.js +2 -5
  128. package/dist/registry.js +224 -0
  129. package/dist/solid/components/Beam.d.ts +28 -0
  130. package/dist/solid/components/Beam.d.ts.map +1 -0
  131. package/dist/solid/index.d.ts +1 -0
  132. package/dist/solid/index.d.ts.map +1 -1
  133. package/dist/solid/index.js +6691 -102524
  134. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  135. package/dist/solid/utils/generatePresetCode.js +586 -537
  136. package/dist/svelte/components/Beam.svelte.d.ts +19 -0
  137. package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
  138. package/dist/svelte/index.d.ts +1 -0
  139. package/dist/svelte/index.js +6175 -102455
  140. package/dist/svelte/utils/generatePresetCode.js +2 -5
  141. package/dist/vue/components/Beam.vue.d.ts +57 -0
  142. package/dist/vue/components/Beam.vue.d.ts.map +1 -0
  143. package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
  144. package/dist/vue/index.d.ts +1 -0
  145. package/dist/vue/index.d.ts.map +1 -1
  146. package/dist/vue/index.js +6929 -103492
  147. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  148. package/dist/vue/utils/generatePresetCode.js +2 -5
  149. package/package.json +12 -1
  150. package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
  151. package/dist/core/Ascii-BT0-K_vw.js +0 -196
  152. package/dist/core/Blob-BlQ_1T_8.js +0 -169
  153. package/dist/core/Blur-421AjWLH.js +0 -64
  154. package/dist/core/Bulge-CZRVoR6C.js +0 -103
  155. package/dist/core/CRTScreen-C_U9g_IR.js +0 -91
  156. package/dist/core/ChannelBlur-5pzcB6Zv.js +0 -89
  157. package/dist/core/Checkerboard-CrQkqXhD.js +0 -75
  158. package/dist/core/ChromaFlow-CNrQdL8f.js +0 -134
  159. package/dist/core/ChromaticAberration-D9H7O17Y.js +0 -82
  160. package/dist/core/Circle-DnLaDn8V.js +0 -62
  161. package/dist/core/ColorAdjustment-CKwpE_4M.js +0 -14
  162. package/dist/core/CursorTrail-NY6n97VG.js +0 -105
  163. package/dist/core/DiffuseBlur-C_n01ABk.js +0 -69
  164. package/dist/core/Dither-4s-c4zh4.js +0 -61
  165. package/dist/core/DotGrid-BYl8XdMi.js +0 -61
  166. package/dist/core/Duotone-DbewOoB4.js +0 -66
  167. package/dist/core/FilmGrain-zA_-knOw.js +0 -28
  168. package/dist/core/FloatingParticles-BhVnqMsE.js +0 -160
  169. package/dist/core/GlassTiles-CFI57glh.js +0 -52
  170. package/dist/core/Glow-CQgl3IoS.js +0 -66
  171. package/dist/core/Godrays-BHMix_Bh.js +0 -105
  172. package/dist/core/Grayscale-CAEFLteL.js +0 -21
  173. package/dist/core/Grid-DlM-rVbZ.js +0 -50
  174. package/dist/core/GridDistortion-ZOZphSAT.js +0 -147
  175. package/dist/core/Group-BQAs3RiH.js +0 -17
  176. package/dist/core/Halftone-ci4ga-_J.js +0 -55
  177. package/dist/core/HueShift-CyxzPcJV.js +0 -32
  178. package/dist/core/ImageTexture-CdAGsPuH.js +0 -105
  179. package/dist/core/Invert-iPsiIqNZ.js +0 -20
  180. package/dist/core/LinearBlur-BEaaoIk-.js +0 -56
  181. package/dist/core/LinearGradient-DR_7RxLX.js +0 -111
  182. package/dist/core/Liquify-Bi02_ugh.js +0 -139
  183. package/dist/core/Pixelate-CSsdT1rr.js +0 -38
  184. package/dist/core/PolarCoordinates-D626ml58.js +0 -103
  185. package/dist/core/Posterize-DhZkMaC7.js +0 -46
  186. package/dist/core/ProgressiveBlur-CGtCfLF8.js +0 -102
  187. package/dist/core/RadialGradient-C0_WzmbH.js +0 -71
  188. package/dist/core/RectangularCoordinates-DfXw7fhI.js +0 -92
  189. package/dist/core/Ripples-DkemN3eh.js +0 -106
  190. package/dist/core/Saturation-Dup81Pnq.js +0 -31
  191. package/dist/core/SimplexNoise-BYEiCjDj.js +0 -94
  192. package/dist/core/SineWave-C6MRPtsy.js +0 -107
  193. package/dist/core/SolidColor-BZHRczgb.js +0 -22
  194. package/dist/core/Spherize-DOAnDx2l.js +0 -103
  195. package/dist/core/Spiral-BMjnWXh1.js +0 -115
  196. package/dist/core/Strands-BOVsuJLe.js +0 -125
  197. package/dist/core/Stretch-D6bHc6yp.js +0 -103
  198. package/dist/core/Swirl-BFoc0ImG.js +0 -148
  199. package/dist/core/TSLBase-BFMvTOak.js +0 -8053
  200. package/dist/core/TiltShift-BiNvvhzj.js +0 -114
  201. package/dist/core/Tritone-gdx2AA0m.js +0 -75
  202. package/dist/core/Twirl-BsV8YbqC.js +0 -82
  203. package/dist/core/Vibrance-C182fbSw.js +0 -31
  204. package/dist/core/WaveDistortion-CmaS2zDB.js +0 -132
  205. package/dist/core/ZoomBlur-DLf5xQ16.js +0 -56
  206. package/dist/core/colorMixing--dhzx0ch.js +0 -21
  207. package/dist/core/edges-CDzKsauJ.js +0 -15
  208. package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
  209. package/dist/core/time-DbRMw6Jm.js +0 -10
  210. package/dist/core/transformations-CsrIJXh-.js +0 -3992
  211. package/dist/react/generatePresetCode-DaS7jkcT.js +0 -626
  212. package/dist/svelte/generatePresetCode-DaS7jkcT.js +0 -626
  213. package/dist/vue/generatePresetCode-Cd1B-Y9j.js +0 -632
@@ -0,0 +1,132 @@
1
+ import { i as transformColorSpace, o as transformPosition, r as transformColor, t as colorSpaceOptions } from "./transformations-DxfQXZWi.js";
2
+ import { t as mixColors } from "./colorMixing-BXiTAqJU.js";
3
+ import * as TSL from "three/tsl";
4
+ const componentDefinition = {
5
+ name: "Spiral",
6
+ category: "Base Layers",
7
+ description: "Rotating spiral pattern with animated movement",
8
+ acceptsUVContext: true,
9
+ props: {
10
+ colorA: {
11
+ default: "#000000",
12
+ transform: transformColor,
13
+ description: "Background color",
14
+ ui: {
15
+ type: "color",
16
+ label: "Color A"
17
+ }
18
+ },
19
+ colorB: {
20
+ default: "#ffffff",
21
+ transform: transformColor,
22
+ description: "Spiral stroke color",
23
+ ui: {
24
+ type: "color",
25
+ label: "Color B"
26
+ }
27
+ },
28
+ strokeWidth: {
29
+ default: .5,
30
+ description: "Thickness of spiral stroke",
31
+ ui: {
32
+ type: "range",
33
+ min: 0,
34
+ max: 2,
35
+ step: .01,
36
+ label: "Stroke Width"
37
+ }
38
+ },
39
+ strokeFalloff: {
40
+ default: 0,
41
+ description: "Stroke losing width further from center",
42
+ ui: {
43
+ type: "range",
44
+ min: 0,
45
+ max: 1,
46
+ step: .01,
47
+ label: "Stroke Falloff"
48
+ }
49
+ },
50
+ softness: {
51
+ default: 0,
52
+ description: "Color transition sharpness (0 = hard edge, 1 = smooth fade)",
53
+ ui: {
54
+ type: "range",
55
+ min: 0,
56
+ max: 1,
57
+ step: .01,
58
+ label: "Softness"
59
+ }
60
+ },
61
+ speed: {
62
+ default: 1,
63
+ description: "Animation speed (negative values reverse direction)",
64
+ ui: {
65
+ type: "range",
66
+ min: -3,
67
+ max: 3,
68
+ step: .1,
69
+ label: "Speed"
70
+ }
71
+ },
72
+ center: {
73
+ default: {
74
+ x: .5,
75
+ y: .5
76
+ },
77
+ transform: transformPosition,
78
+ description: "The center point of the spiral",
79
+ ui: {
80
+ type: "position",
81
+ label: "Center"
82
+ }
83
+ },
84
+ scale: {
85
+ default: 1,
86
+ description: "Scale factor for spiral bands (higher = more bands, lower = fewer bands)",
87
+ ui: {
88
+ type: "range",
89
+ min: .1,
90
+ max: 5,
91
+ step: .1,
92
+ label: "Scale"
93
+ }
94
+ },
95
+ colorSpace: {
96
+ default: "linear",
97
+ transform: transformColorSpace,
98
+ description: "Color space for color interpolation",
99
+ ui: {
100
+ type: "select",
101
+ options: colorSpaceOptions,
102
+ label: "Color Space"
103
+ }
104
+ }
105
+ },
106
+ fragmentNode: ({ uniforms, uvContext }) => {
107
+ const { vec2: vec2$1, vec4: vec4$1, float: float$1, atan: atan$1, length, clamp: clamp$1, fract, abs: abs$1, mix: mix$1, smoothstep, screenUV: screenUV$1, time, fwidth, viewportSize: viewportSize$1 } = TSL;
108
+ const baseUV = uvContext ?? screenUV$1;
109
+ const aspect = viewportSize$1.x.div(viewportSize$1.y);
110
+ const aspectCorrectedUV = vec2$1(baseUV.x.mul(aspect), baseUV.y);
111
+ const centerPos = vec2$1(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
112
+ const uv = aspectCorrectedUV.sub(centerPos);
113
+ const t = time.mul(uniforms.speed.uniform);
114
+ const l = length(uv);
115
+ const adjustedLength = l;
116
+ const angle = atan$1(uv.y, uv.x).sub(t);
117
+ const TWO_PI = float$1(6.283185307);
118
+ const angleNormalised = angle.div(TWO_PI);
119
+ const offset = adjustedLength.mul(uniforms.scale.uniform).add(angleNormalised);
120
+ const shape = abs$1(fract(offset).sub(.5)).mul(2);
121
+ const baseWidth = clamp$1(uniforms.strokeWidth.uniform, uniforms.strokeFalloff.uniform.mul(.005), 1);
122
+ const falloffAmount = clamp$1(uniforms.strokeFalloff.uniform, 0, 1).mul(l).oneMinus();
123
+ const width = baseWidth.mul(falloffAmount);
124
+ const fw = fwidth(offset);
125
+ const pixelSize = mix$1(float$1(4).sub(smoothstep(.05, .4, uniforms.strokeWidth.uniform.mul(2)).mul(smoothstep(.05, .4, uniforms.strokeWidth.uniform.oneMinus().mul(2))).mul(3)).mul(fw), fwidth(shape), clamp$1(fw, 0, 1));
126
+ const res = smoothstep(width.sub(pixelSize).sub(uniforms.softness.uniform), width.add(pixelSize).add(uniforms.softness.uniform), shape);
127
+ const mixedColor = mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, res, uniforms.colorSpace.uniform);
128
+ return vec4$1(mixedColor.rgb, mixedColor.a);
129
+ }
130
+ };
131
+ var Spiral_default = componentDefinition;
132
+ export { componentDefinition as n, Spiral_default as t };
@@ -0,0 +1,161 @@
1
+ import { t as createAnimatedTime } from "./time-CTJvRUZ4.js";
2
+ import { o as transformPosition, r as transformColor } from "./transformations-DxfQXZWi.js";
3
+ import * as TSL from "three/tsl";
4
+ const componentDefinition = {
5
+ name: "Strands",
6
+ category: "Base Layers",
7
+ description: "Procedural wavy strands with layered animation",
8
+ requiresRTT: false,
9
+ requiresChild: false,
10
+ acceptsUVContext: true,
11
+ props: {
12
+ speed: {
13
+ default: .5,
14
+ description: "Overall animation speed",
15
+ ui: {
16
+ type: "range",
17
+ min: 0,
18
+ max: 1,
19
+ step: .01,
20
+ label: "Speed"
21
+ }
22
+ },
23
+ amplitude: {
24
+ default: 1,
25
+ description: "Wave height amplitude",
26
+ ui: {
27
+ type: "range",
28
+ min: 0,
29
+ max: 5,
30
+ step: .1,
31
+ label: "Amplitude"
32
+ }
33
+ },
34
+ frequency: {
35
+ default: 1,
36
+ description: "Wave frequency",
37
+ ui: {
38
+ type: "range",
39
+ min: 0,
40
+ max: 5,
41
+ step: .01,
42
+ label: "Frequency"
43
+ }
44
+ },
45
+ lineCount: {
46
+ default: 12,
47
+ description: "Number of wave lines",
48
+ ui: {
49
+ type: "range",
50
+ min: 4,
51
+ max: 32,
52
+ step: 1,
53
+ label: "Line Count"
54
+ }
55
+ },
56
+ lineWidth: {
57
+ default: .1,
58
+ description: "Width of wave lines",
59
+ ui: {
60
+ type: "range",
61
+ min: .01,
62
+ max: .5,
63
+ step: .01,
64
+ label: "Line Width"
65
+ }
66
+ },
67
+ waveColor: {
68
+ default: "#f1c907",
69
+ transform: transformColor,
70
+ description: "Color of the waves",
71
+ ui: {
72
+ type: "color",
73
+ label: "Wave Color"
74
+ }
75
+ },
76
+ pinEdges: {
77
+ default: true,
78
+ description: "Pin waves at edges (fade effect)",
79
+ ui: {
80
+ type: "checkbox",
81
+ label: "Pin Edges"
82
+ }
83
+ },
84
+ start: {
85
+ default: {
86
+ x: 0,
87
+ y: .5
88
+ },
89
+ transform: transformPosition,
90
+ description: "Starting point of the waves",
91
+ ui: {
92
+ type: "position",
93
+ label: "Start"
94
+ }
95
+ },
96
+ end: {
97
+ default: {
98
+ x: 1,
99
+ y: .5
100
+ },
101
+ transform: transformPosition,
102
+ description: "Ending point of the waves",
103
+ ui: {
104
+ type: "position",
105
+ label: "End"
106
+ }
107
+ }
108
+ },
109
+ fragmentNode: (params) => {
110
+ const { uniforms, uvContext } = params;
111
+ const { vec2: vec2$1, vec4: vec4$1, cos: cos$1, abs: abs$1, smoothstep, mix: mix$1, max: max$1, screenUV: screenUV$1, viewportSize: viewportSize$1, float: float$1, Fn } = TSL;
112
+ const baseUV = uvContext ?? screenUV$1;
113
+ const t = createAnimatedTime(params, uniforms.speed);
114
+ const random = Fn(([time]) => {
115
+ return cos$1(time).add(cos$1(time.mul(1.2).add(1.6))).add(cos$1(time.mul(1.4).add(1.5))).div(3);
116
+ });
117
+ return Fn(([uv]) => {
118
+ const aspectRatio = viewportSize$1.x.div(viewportSize$1.y);
119
+ const startPos = vec2$1(uniforms.start.uniform.x.mul(aspectRatio), uniforms.start.uniform.y.oneMinus());
120
+ const endPos = vec2$1(uniforms.end.uniform.x.mul(aspectRatio), uniforms.end.uniform.y.oneMinus());
121
+ const aspectUV = vec2$1(uv.x.mul(aspectRatio), uv.y);
122
+ const direction = endPos.sub(startPos);
123
+ const length = direction.length();
124
+ const normalizedDir = direction.div(length);
125
+ const perpDir = vec2$1(normalizedDir.y.negate(), normalizedDir.x);
126
+ const relativePos = aspectUV.sub(startPos);
127
+ const progress = relativePos.dot(normalizedDir).div(length);
128
+ const distFromLine = relativePos.dot(perpDir);
129
+ const waveCoord = progress.mul(10);
130
+ const perpCoord = distFromLine.mul(10);
131
+ const edgeFade = uniforms.pinEdges.uniform.select(smoothstep(float$1(0), float$1(.1), progress).mul(smoothstep(float$1(1), float$1(.9), progress)), float$1(1));
132
+ const horizontalFade = uniforms.pinEdges.uniform.select(cos$1(progress.mul(6.28)).mul(.5).add(.5).oneMinus(), float$1(1));
133
+ const verticalFade = cos$1(progress.mul(6.28)).mul(.5).add(.5).oneMinus();
134
+ const linesColor = vec4$1(0, 0, 0, 0).toVar();
135
+ const maxLines = uniforms.lineCount.uniform;
136
+ for (let i = 0; i < 32; i++) {
137
+ const lineActive = float$1(i).lessThan(maxLines);
138
+ const lineIndex = float$1(i);
139
+ const normalizedIndex = lineIndex.div(maxLines);
140
+ const offsetFreq = float$1(.5);
141
+ const offsetSpeed = float$1(1.33);
142
+ const offsetTime = t.mul(offsetSpeed);
143
+ const offsetPosition = lineIndex.add(waveCoord.mul(offsetFreq));
144
+ const rand = random(offsetPosition.add(offsetTime)).mul(.5).add(.5);
145
+ const halfWidth = mix$1(float$1(.01), uniforms.lineWidth.uniform, rand.mul(horizontalFade)).mul(.5);
146
+ const minSpread = float$1(.6);
147
+ const maxSpread = float$1(2);
148
+ const offset = random(offsetPosition.add(offsetTime.mul(normalizedIndex.add(1)))).mul(mix$1(minSpread, maxSpread, horizontalFade)).mul(uniforms.amplitude.uniform);
149
+ const linePosition = random(waveCoord.mul(uniforms.frequency.uniform).add(t)).mul(horizontalFade).mul(uniforms.amplitude.uniform).add(offset);
150
+ const dist = abs$1(perpCoord.sub(linePosition));
151
+ const lineEdgeSoftness = float$1(.01);
152
+ const line = smoothstep(halfWidth.add(lineEdgeSoftness), halfWidth.sub(lineEdgeSoftness), dist);
153
+ const lineContribution = vec4$1(uniforms.waveColor.uniform.r, uniforms.waveColor.uniform.g, uniforms.waveColor.uniform.b, line).mul(rand);
154
+ linesColor.assign(max$1(linesColor, lineActive.select(lineContribution, vec4$1(0, 0, 0, 0))));
155
+ }
156
+ return linesColor.mul(vec4$1(1, 1, 1, verticalFade.mul(edgeFade)));
157
+ })(baseUV);
158
+ }
159
+ };
160
+ var Strands_default = componentDefinition;
161
+ export { componentDefinition as n, Strands_default as t };
@@ -0,0 +1,133 @@
1
+ import { t as applyEdgeHandling } from "./edges-Bn_OIa_h.js";
2
+ import { a as transformEdges, o as transformPosition } from "./transformations-DxfQXZWi.js";
3
+ import * as TSL from "three/tsl";
4
+ const componentDefinition = {
5
+ name: "Stretch",
6
+ category: "Distortions",
7
+ description: "Stretch content towards a direction from a center point",
8
+ requiresRTT: true,
9
+ requiresChild: true,
10
+ props: {
11
+ center: {
12
+ default: {
13
+ x: .5,
14
+ y: .5
15
+ },
16
+ transform: transformPosition,
17
+ description: "The center point of the stretch effect",
18
+ ui: {
19
+ type: "position",
20
+ label: "Center"
21
+ }
22
+ },
23
+ strength: {
24
+ default: 1,
25
+ description: "The intensity of the stretch effect",
26
+ ui: {
27
+ type: "range",
28
+ min: 0,
29
+ max: 1,
30
+ step: .01,
31
+ label: "Strength"
32
+ }
33
+ },
34
+ angle: {
35
+ default: 0,
36
+ description: "The direction of the stretch in degrees",
37
+ ui: {
38
+ type: "range",
39
+ min: 0,
40
+ max: 360,
41
+ step: 1,
42
+ label: "Angle"
43
+ }
44
+ },
45
+ falloff: {
46
+ default: 0,
47
+ description: "Controls the sharpness of the transition (0 = sharp edge, 1 = gradual transition)",
48
+ ui: {
49
+ type: "range",
50
+ min: 0,
51
+ max: 1,
52
+ step: .01,
53
+ label: "Falloff"
54
+ }
55
+ },
56
+ edges: {
57
+ default: "stretch",
58
+ description: "How to handle edges when distortion pushes content out of bounds",
59
+ transform: transformEdges,
60
+ ui: {
61
+ type: "select",
62
+ options: [
63
+ {
64
+ label: "Stretch",
65
+ value: "stretch"
66
+ },
67
+ {
68
+ label: "Transparent",
69
+ value: "transparent"
70
+ },
71
+ {
72
+ label: "Mirror",
73
+ value: "mirror"
74
+ },
75
+ {
76
+ label: "Wrap",
77
+ value: "wrap"
78
+ }
79
+ ],
80
+ label: "Edges"
81
+ }
82
+ }
83
+ },
84
+ uvTransformNode: ({ uv, uniforms, viewportSize: viewportSize$1 }) => {
85
+ const { vec2: vec2$1, float: float$1, sin: sin$1, cos: cos$1 } = TSL;
86
+ const aspect = viewportSize$1.x.div(viewportSize$1.y);
87
+ const aspectCorrectedUV = vec2$1(uv.x.mul(aspect), uv.y);
88
+ const centerPos = vec2$1(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
89
+ const delta = aspectCorrectedUV.sub(centerPos);
90
+ const angleRad = uniforms.angle.uniform.mul(Math.PI / 180);
91
+ const directionVector = vec2$1(cos$1(angleRad), sin$1(angleRad));
92
+ const projection = delta.dot(directionVector);
93
+ const perpendicular = delta.sub(directionVector.mul(projection));
94
+ const falloffAmount = uniforms.falloff.uniform;
95
+ const transitionWidth = TSL.mix(float$1(.001), float$1(75), falloffAmount);
96
+ const effectMask = TSL.clamp(projection.div(transitionWidth), float$1(0), float$1(1));
97
+ const scaledStrength = uniforms.strength.uniform.mul(float$1(100));
98
+ const stretchFactor = float$1(1).add(scaledStrength.mul(effectMask));
99
+ const finalProjection = projection.div(stretchFactor);
100
+ const stretchedDelta = directionVector.mul(finalProjection).add(perpendicular);
101
+ const stretchedUV = centerPos.add(stretchedDelta);
102
+ return vec2$1(stretchedUV.x.div(aspect), stretchedUV.y);
103
+ },
104
+ fragmentNode: ({ uniforms, childNode, onCleanup }) => {
105
+ const { vec2: vec2$1, vec4: vec4$1, screenUV: screenUV$1, viewportSize: viewportSize$1, convertToTexture: convertToTexture$1, float: float$1, sin: sin$1, cos: cos$1 } = TSL;
106
+ if (!childNode) return vec4$1(0, 0, 0, 0);
107
+ const childTexture = convertToTexture$1(childNode);
108
+ onCleanup(() => {
109
+ if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
110
+ });
111
+ const aspect = viewportSize$1.x.div(viewportSize$1.y);
112
+ const aspectCorrectedUV = vec2$1(screenUV$1.x.mul(aspect), screenUV$1.y);
113
+ const centerPos = vec2$1(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
114
+ const delta = aspectCorrectedUV.sub(centerPos);
115
+ const angleRad = uniforms.angle.uniform.mul(Math.PI / 180);
116
+ const directionVector = vec2$1(cos$1(angleRad), sin$1(angleRad));
117
+ const projection = delta.dot(directionVector);
118
+ const parallel = directionVector.mul(projection);
119
+ const perpendicular = delta.sub(parallel);
120
+ const falloffAmount = uniforms.falloff.uniform;
121
+ const transitionWidth = TSL.mix(float$1(.001), float$1(75), falloffAmount);
122
+ const effectMask = TSL.clamp(projection.div(transitionWidth), float$1(0), float$1(1));
123
+ const scaledStrength = uniforms.strength.uniform.mul(float$1(100));
124
+ const stretchFactor = float$1(1).add(scaledStrength.mul(effectMask));
125
+ const finalProjection = projection.div(stretchFactor);
126
+ const stretchedDelta = directionVector.mul(finalProjection).add(perpendicular);
127
+ const stretchedUV = centerPos.add(stretchedDelta);
128
+ const finalUV = vec2$1(stretchedUV.x.div(aspect), stretchedUV.y);
129
+ return applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform);
130
+ }
131
+ };
132
+ var Stretch_default = componentDefinition;
133
+ export { componentDefinition as n, Stretch_default as t };
@@ -0,0 +1,173 @@
1
+ import { t as createAnimatedTime } from "./time-CTJvRUZ4.js";
2
+ import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-DxfQXZWi.js";
3
+ import { t as mixColors } from "./colorMixing-BXiTAqJU.js";
4
+ import * as TSL from "three/tsl";
5
+ const componentDefinition = {
6
+ name: "Swirl",
7
+ category: "Base Layers",
8
+ description: "Flowing swirl pattern with multi-layered noise",
9
+ acceptsUVContext: true,
10
+ props: {
11
+ colorA: {
12
+ default: "#1275d8",
13
+ description: "Primary gradient color",
14
+ transform: transformColor,
15
+ ui: {
16
+ type: "color",
17
+ label: "Primary Color"
18
+ }
19
+ },
20
+ colorB: {
21
+ default: "#e19136",
22
+ description: "Secondary gradient color",
23
+ transform: transformColor,
24
+ ui: {
25
+ type: "color",
26
+ label: "Secondary Color"
27
+ }
28
+ },
29
+ speed: {
30
+ default: 1,
31
+ description: "Flow animation speed",
32
+ ui: {
33
+ type: "range",
34
+ min: 0,
35
+ max: 5,
36
+ step: .1,
37
+ label: "Speed"
38
+ }
39
+ },
40
+ detail: {
41
+ default: 1,
42
+ description: "Level of detail and intricacy in the swirl patterns",
43
+ ui: {
44
+ type: "range",
45
+ min: 0,
46
+ max: 10,
47
+ step: .1,
48
+ label: "Detail"
49
+ }
50
+ },
51
+ blend: {
52
+ default: 50,
53
+ description: "Skew color balance toward A (lower values) or B (higher values)",
54
+ ui: {
55
+ type: "range",
56
+ min: 0,
57
+ max: 100,
58
+ step: 1,
59
+ label: "Blend"
60
+ }
61
+ },
62
+ coarseX: {
63
+ default: 50,
64
+ description: "Horizontal frequency for coarse/base layer",
65
+ ui: {
66
+ type: "range",
67
+ min: 0,
68
+ max: 100,
69
+ step: 1,
70
+ label: "Coarse X"
71
+ }
72
+ },
73
+ coarseY: {
74
+ default: 50,
75
+ description: "Vertical frequency for coarse/base layer",
76
+ ui: {
77
+ type: "range",
78
+ min: 0,
79
+ max: 100,
80
+ step: 1,
81
+ label: "Coarse Y"
82
+ }
83
+ },
84
+ mediumX: {
85
+ default: 50,
86
+ description: "Horizontal frequency for medium detail layer",
87
+ ui: {
88
+ type: "range",
89
+ min: 0,
90
+ max: 100,
91
+ step: 1,
92
+ label: "Medium X"
93
+ }
94
+ },
95
+ mediumY: {
96
+ default: 50,
97
+ description: "Vertical frequency for medium detail layer",
98
+ ui: {
99
+ type: "range",
100
+ min: 0,
101
+ max: 100,
102
+ step: 1,
103
+ label: "Medium Y"
104
+ }
105
+ },
106
+ fineX: {
107
+ default: 50,
108
+ description: "Horizontal frequency for fine detail layer",
109
+ ui: {
110
+ type: "range",
111
+ min: 0,
112
+ max: 100,
113
+ step: 1,
114
+ label: "Fine X"
115
+ }
116
+ },
117
+ fineY: {
118
+ default: 50,
119
+ description: "Vertical frequency for fine detail layer",
120
+ ui: {
121
+ type: "range",
122
+ min: 0,
123
+ max: 100,
124
+ step: 1,
125
+ label: "Fine Y"
126
+ }
127
+ },
128
+ colorSpace: {
129
+ default: "linear",
130
+ transform: transformColorSpace,
131
+ description: "Color space for color interpolation",
132
+ ui: {
133
+ type: "select",
134
+ options: colorSpaceOptions,
135
+ label: "Color Space"
136
+ }
137
+ }
138
+ },
139
+ fragmentNode: (params) => {
140
+ const { uniforms, uvContext } = params;
141
+ const { vec2: vec2$1, vec4: vec4$1, float: float$1, screenUV: screenUV$1, sin: sin$1, cos: cos$1, smoothstep } = TSL;
142
+ const uvCoords = uvContext ?? screenUV$1;
143
+ const t = createAnimatedTime(params, uniforms.speed);
144
+ const detail = uniforms.detail.uniform;
145
+ const scaleCoarse = float$1(.02);
146
+ const scaleMedium = float$1(.028);
147
+ const scaleFine = float$1(.056);
148
+ const freq1 = detail;
149
+ const coarseScaleX = uniforms.coarseX.uniform.mul(scaleCoarse);
150
+ const coarseScaleY = uniforms.coarseY.uniform.mul(scaleCoarse);
151
+ const distort1 = vec2$1(uvCoords.x.add(sin$1(uvCoords.y.mul(freq1.mul(coarseScaleY).mul(1.7)).add(t.mul(.8))).mul(.12)), uvCoords.y.add(cos$1(uvCoords.x.mul(freq1.mul(coarseScaleX).mul(1.3)).sub(t.mul(.6))).mul(.12)));
152
+ const pattern1 = sin$1(distort1.x.mul(freq1.mul(coarseScaleX).mul(2.1)).add(distort1.y.mul(freq1.mul(coarseScaleY).mul(1.8))).add(t.mul(.4)));
153
+ const freq2 = detail.mul(1.4);
154
+ const mediumScaleX = uniforms.mediumX.uniform.mul(scaleMedium);
155
+ const mediumScaleY = uniforms.mediumY.uniform.mul(scaleMedium);
156
+ const distort2 = vec2$1(distort1.x.add(cos$1(distort1.y.mul(freq2.mul(mediumScaleY).mul(1.9)).sub(t.mul(.5))).mul(.06)), distort1.y.add(sin$1(distort1.x.mul(freq2.mul(mediumScaleX).mul(2.3)).add(t.mul(.7))).mul(.06)));
157
+ const pattern2 = cos$1(distort2.x.mul(freq2.mul(mediumScaleX).mul(1.6)).sub(distort2.y.mul(freq2.mul(mediumScaleY).mul(2.4))).add(t.mul(.3)));
158
+ const freq3 = detail.mul(2.8);
159
+ const fineScaleX = uniforms.fineX.uniform.mul(scaleFine);
160
+ const fineScaleY = uniforms.fineY.uniform.mul(scaleFine);
161
+ const distort3 = vec2$1(distort2.x.add(sin$1(distort2.y.mul(freq3.mul(fineScaleY).mul(1.1)).add(t.mul(.9))).mul(.03)), distort2.y.add(cos$1(distort2.x.mul(freq3.mul(fineScaleX).mul(.9)).sub(t.mul(.4))).mul(.03)));
162
+ const pattern3 = sin$1(distort3.x.mul(freq3.mul(fineScaleX).mul(1.3)).add(distort3.y.mul(freq3.mul(fineScaleY).mul(1.7))).sub(t.mul(.6)));
163
+ const combinedPattern = pattern1.mul(.5).add(pattern2.mul(.3)).add(pattern3.mul(.2));
164
+ const blendBias = uniforms.blend.uniform.sub(50).mul(.006);
165
+ const blendFactor = smoothstep(.3, .7, combinedPattern.mul(.5).add(.5).add(blendBias));
166
+ const colorMix = mixColors(uniforms.colorA.uniform, uniforms.colorB.uniform, blendFactor, uniforms.colorSpace.uniform);
167
+ const shimmer = sin$1(t.mul(2.5).add(combinedPattern.mul(8))).mul(.015).add(1);
168
+ const finalColor = colorMix.mul(shimmer);
169
+ return vec4$1(finalColor.rgb, finalColor.a);
170
+ }
171
+ };
172
+ var Swirl_default = componentDefinition;
173
+ export { componentDefinition as n, Swirl_default as t };