shaders 2.2.24 → 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 (193) 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 -1606
  59. package/dist/core/shaders/AngularBlur/index.js +3 -7
  60. package/dist/core/shaders/Ascii/index.js +2 -6
  61. package/dist/core/shaders/Beam/index.js +4 -8
  62. package/dist/core/shaders/Blob/index.js +5 -9
  63. package/dist/core/shaders/Blur/index.js +2 -6
  64. package/dist/core/shaders/Bulge/index.js +4 -8
  65. package/dist/core/shaders/CRTScreen/index.js +2 -6
  66. package/dist/core/shaders/ChannelBlur/index.js +2 -6
  67. package/dist/core/shaders/Checkerboard/index.js +4 -8
  68. package/dist/core/shaders/ChromaFlow/index.js +3 -7
  69. package/dist/core/shaders/ChromaticAberration/index.js +3 -7
  70. package/dist/core/shaders/Circle/index.js +3 -7
  71. package/dist/core/shaders/CursorTrail/index.js +4 -8
  72. package/dist/core/shaders/DiffuseBlur/index.js +4 -8
  73. package/dist/core/shaders/Dither/index.js +3 -7
  74. package/dist/core/shaders/DotGrid/index.js +3 -7
  75. package/dist/core/shaders/Duotone/index.js +4 -8
  76. package/dist/core/shaders/FilmGrain/index.js +2 -6
  77. package/dist/core/shaders/FloatingParticles/index.js +3 -7
  78. package/dist/core/shaders/GlassTiles/index.js +2 -6
  79. package/dist/core/shaders/Glow/index.js +2 -6
  80. package/dist/core/shaders/Godrays/index.js +3 -7
  81. package/dist/core/shaders/Grayscale/index.js +2 -8
  82. package/dist/core/shaders/Grid/index.js +3 -7
  83. package/dist/core/shaders/GridDistortion/index.js +4 -8
  84. package/dist/core/shaders/Group/index.js +2 -6
  85. package/dist/core/shaders/Halftone/index.js +3 -7
  86. package/dist/core/shaders/HueShift/index.js +2 -8
  87. package/dist/core/shaders/ImageTexture/index.js +2 -6
  88. package/dist/core/shaders/Invert/index.js +2 -6
  89. package/dist/core/shaders/LinearBlur/index.js +3 -7
  90. package/dist/core/shaders/LinearGradient/index.js +4 -8
  91. package/dist/core/shaders/Liquify/index.js +4 -8
  92. package/dist/core/shaders/Pixelate/index.js +2 -6
  93. package/dist/core/shaders/PolarCoordinates/index.js +4 -8
  94. package/dist/core/shaders/Posterize/index.js +2 -7
  95. package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
  96. package/dist/core/shaders/RadialGradient/index.js +4 -8
  97. package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
  98. package/dist/core/shaders/Ripples/index.js +5 -9
  99. package/dist/core/shaders/Saturation/index.js +2 -8
  100. package/dist/core/shaders/SimplexNoise/index.js +5 -9
  101. package/dist/core/shaders/SineWave/index.js +3 -7
  102. package/dist/core/shaders/SolidColor/index.js +3 -7
  103. package/dist/core/shaders/Spherize/index.js +3 -7
  104. package/dist/core/shaders/Spiral/index.js +4 -8
  105. package/dist/core/shaders/Strands/index.js +4 -8
  106. package/dist/core/shaders/Stretch/index.js +4 -8
  107. package/dist/core/shaders/Swirl/index.js +5 -9
  108. package/dist/core/shaders/TiltShift/index.js +3 -7
  109. package/dist/core/shaders/Tritone/index.js +4 -8
  110. package/dist/core/shaders/Twirl/index.js +4 -8
  111. package/dist/core/shaders/Vibrance/index.js +2 -8
  112. package/dist/core/shaders/WaveDistortion/index.js +4 -8
  113. package/dist/core/shaders/ZoomBlur/index.js +3 -7
  114. package/dist/core/telemetry/index.js +189 -157
  115. package/dist/core/time-CTJvRUZ4.js +10 -0
  116. package/dist/core/transformations-DxfQXZWi.js +4715 -0
  117. package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
  118. package/dist/react/index.js +7645 -104827
  119. package/dist/react/utils/generatePresetCode.js +2 -5
  120. package/dist/solid/index.js +6670 -102727
  121. package/dist/solid/utils/generatePresetCode.js +583 -554
  122. package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
  123. package/dist/svelte/index.js +6175 -102645
  124. package/dist/svelte/utils/generatePresetCode.js +2 -5
  125. package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
  126. package/dist/vue/index.js +6929 -103706
  127. package/dist/vue/utils/generatePresetCode.js +2 -5
  128. package/package.json +4 -1
  129. package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
  130. package/dist/core/Ascii-BT0-K_vw.js +0 -196
  131. package/dist/core/Beam-BAKql1AP.js +0 -116
  132. package/dist/core/Blob-CVSxhHJG.js +0 -169
  133. package/dist/core/Blur-C1TTBHCX.js +0 -64
  134. package/dist/core/Bulge-DV8tX-cw.js +0 -103
  135. package/dist/core/CRTScreen-VTJQoOeq.js +0 -91
  136. package/dist/core/ChannelBlur-BLZ9kBNA.js +0 -89
  137. package/dist/core/Checkerboard-DQ4Df3vm.js +0 -75
  138. package/dist/core/ChromaFlow-BggN1_Av.js +0 -134
  139. package/dist/core/ChromaticAberration-DlTaHNcp.js +0 -82
  140. package/dist/core/Circle-B9ObWlq5.js +0 -62
  141. package/dist/core/ColorAdjustment-FeXXpypd.js +0 -14
  142. package/dist/core/CursorTrail-C7QdUj8O.js +0 -105
  143. package/dist/core/DiffuseBlur-Mx6LBsqz.js +0 -69
  144. package/dist/core/Dither-CeIdV_9C.js +0 -61
  145. package/dist/core/DotGrid-D6xUvYrt.js +0 -61
  146. package/dist/core/Duotone-C2Pqt2gR.js +0 -66
  147. package/dist/core/FilmGrain-CJ9n_fgk.js +0 -28
  148. package/dist/core/FloatingParticles-iGtMs44K.js +0 -160
  149. package/dist/core/GlassTiles-D_lVyag2.js +0 -52
  150. package/dist/core/Glow-B0jj-6OC.js +0 -66
  151. package/dist/core/Godrays-DjLVuZa4.js +0 -105
  152. package/dist/core/Grayscale-BbsdDa_X.js +0 -21
  153. package/dist/core/Grid-ByjU-_ua.js +0 -50
  154. package/dist/core/GridDistortion-C_eIlhkW.js +0 -147
  155. package/dist/core/Group-CyaDLGpI.js +0 -17
  156. package/dist/core/Halftone-BvuAe_k-.js +0 -55
  157. package/dist/core/HueShift-B_qE9c08.js +0 -32
  158. package/dist/core/ImageTexture-h00TFC1l.js +0 -105
  159. package/dist/core/Invert-BEDDB0sm.js +0 -20
  160. package/dist/core/LinearBlur-CLKxuyeT.js +0 -56
  161. package/dist/core/LinearGradient-BPo8TX_M.js +0 -111
  162. package/dist/core/Liquify-DGkfeixZ.js +0 -139
  163. package/dist/core/Pixelate-Bzy_7LnJ.js +0 -38
  164. package/dist/core/PolarCoordinates-BUumPeTv.js +0 -103
  165. package/dist/core/Posterize-ggKIJlmm.js +0 -46
  166. package/dist/core/ProgressiveBlur-D6_6T7SS.js +0 -102
  167. package/dist/core/RadialGradient-DEY9fRqa.js +0 -71
  168. package/dist/core/RectangularCoordinates-CZ-cFrCh.js +0 -92
  169. package/dist/core/Ripples-BwNlcsnV.js +0 -106
  170. package/dist/core/Saturation-Dl3gCWuZ.js +0 -31
  171. package/dist/core/SimplexNoise-BhE_WyGt.js +0 -94
  172. package/dist/core/SineWave-Db_Y0Mcv.js +0 -107
  173. package/dist/core/SolidColor-CerOp4EQ.js +0 -22
  174. package/dist/core/Spherize-Dh8E5XwG.js +0 -103
  175. package/dist/core/Spiral-BvygQEfP.js +0 -115
  176. package/dist/core/Strands-maaPn4On.js +0 -125
  177. package/dist/core/Stretch-CnA0-nSz.js +0 -103
  178. package/dist/core/Swirl-CQBUahTB.js +0 -148
  179. package/dist/core/TSLBase-Bt7Z4hv_.js +0 -8053
  180. package/dist/core/TiltShift-qFj0oFzN.js +0 -114
  181. package/dist/core/Tritone-AiixmTg8.js +0 -75
  182. package/dist/core/Twirl-ooHQcV89.js +0 -82
  183. package/dist/core/Vibrance-C2FRlLkK.js +0 -31
  184. package/dist/core/WaveDistortion-CN8MjKlm.js +0 -132
  185. package/dist/core/ZoomBlur-CxWGx8PH.js +0 -56
  186. package/dist/core/colorMixing--dhzx0ch.js +0 -21
  187. package/dist/core/edges-CDzKsauJ.js +0 -15
  188. package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
  189. package/dist/core/time-DbRMw6Jm.js +0 -10
  190. package/dist/core/transformations-CsrIJXh-.js +0 -3992
  191. package/dist/react/generatePresetCode-CVj6IV8Y.js +0 -646
  192. package/dist/svelte/generatePresetCode-CVj6IV8Y.js +0 -646
  193. package/dist/vue/generatePresetCode-DCaIsDhE.js +0 -652
@@ -1,105 +0,0 @@
1
- import { O as J, t as K } from "./three.tsl-Btj1hLsf.js";
2
- import { o as Q, r as v } from "./transformations-CsrIJXh-.js";
3
- const W = {
4
- name: "Godrays",
5
- category: "Base Layers",
6
- description: "Volumetric light rays emanating from a point",
7
- requiresRTT: !1,
8
- acceptsUVContext: !0,
9
- props: {
10
- center: {
11
- default: {
12
- x: 0,
13
- y: 0
14
- },
15
- transform: Q,
16
- description: "The center point of the god rays",
17
- ui: {
18
- type: "position",
19
- label: "Center"
20
- }
21
- },
22
- density: {
23
- default: 0.3,
24
- description: "Frequency of ray sectors",
25
- ui: {
26
- type: "range",
27
- min: 0,
28
- max: 1,
29
- step: 0.01,
30
- label: "Density"
31
- }
32
- },
33
- intensity: {
34
- default: 0.8,
35
- description: "Ray visibility within sectors",
36
- ui: {
37
- type: "range",
38
- min: 0,
39
- max: 1,
40
- step: 0.01,
41
- label: "Intensity"
42
- }
43
- },
44
- spotty: {
45
- default: 1,
46
- description: "Density of spots on rays (higher = more spots)",
47
- ui: {
48
- type: "range",
49
- min: 0,
50
- max: 1,
51
- step: 0.01,
52
- label: "Spotty"
53
- }
54
- },
55
- speed: {
56
- default: 0.5,
57
- description: "Animation speed of the rays",
58
- ui: {
59
- type: "range",
60
- min: 0,
61
- max: 2,
62
- step: 0.01,
63
- label: "Speed"
64
- }
65
- },
66
- rayColor: {
67
- default: "#4283fb",
68
- transform: v,
69
- description: "Color of the light rays",
70
- ui: {
71
- type: "color",
72
- label: "Ray Color"
73
- }
74
- },
75
- backgroundColor: {
76
- default: "transparent",
77
- transform: v,
78
- description: "Background color",
79
- ui: {
80
- type: "color",
81
- label: "Background Color"
82
- }
83
- }
84
- },
85
- fragmentNode: ({ uniforms: s, uvContext: B }) => {
86
- const { vec2: c, vec4: G, float: r, sin: T, atan: D, length: P, pow: x, smoothstep: S, mix: p, clamp: g, screenUV: U, time: _, PI: w, Fn: h } = J, F = B ?? U, I = c(s.center.uniform.x, s.center.uniform.y.oneMinus()), m = F.sub(I), V = h(([n]) => {
87
- const t = n.floor(), e = n.fract(), o = (u) => T(u.x.mul(127.1).add(u.y.mul(311.7))).mul(43758.5453).fract(), l = o(t), a = o(t.add(c(1, 0))), d = o(t.add(c(0, 1))), y = o(t.add(c(1, 1))), i = e.mul(e).mul(e.mul(-2).add(3));
88
- return p(p(l, a, i.x), p(d, y, i.x), i.y);
89
- }), f = h(([n, t, e, o]) => {
90
- const l = D(n.y, n.x), a = c(l.mul(e), t), d = c(l.mod(w.mul(2)).mul(e), t), y = x(V(a), o);
91
- return p(x(V(d), o), y, S(-0.15, 0.15, n.x));
92
- }), L = h(() => {
93
- const n = _.mul(s.speed.uniform).mul(0.2), t = P(m), e = r(6.5).mul(K(s.spotty.uniform)), o = r(4).sub(r(3).mul(g(s.intensity.uniform, 0, 1))), l = r(6).mul(s.density.uniform), a = r(0).toVar(), d = t.mul(1).sub(n.mul(3)), y = t.mul(0.5).mul(r(1).add(e)).sub(n.mul(2)), i = l.mul(5), u = f(m, d, i, o).toVar();
94
- u.assign(u.mul(f(m, y, i.mul(4), o))), a.assign(a.add(u));
95
- const z = t.mul(1.4).sub(n.mul(2.5)), H = t.mul(0.7).mul(r(1).add(e)).sub(n.mul(1.8)), k = l.mul(4.5), C = f(m, z, k, o).toVar();
96
- return C.assign(C.mul(f(m, H, k.mul(3.5), o))), a.assign(a.add(C.mul(0.7))), g(a, 0, 1);
97
- })(), N = s.rayColor.uniform.rgb, q = s.rayColor.uniform.a, E = s.backgroundColor.uniform.rgb, A = s.backgroundColor.uniform.a, b = L.mul(q), R = b.add(A.mul(r(1).sub(b))), M = g(R, 1e-3, 1), O = N.mul(b), j = E.mul(A).mul(r(1).sub(b));
98
- return G(O.add(j).div(M), R);
99
- }
100
- };
101
- var Z = W;
102
- export {
103
- W as n,
104
- Z as t
105
- };
@@ -1,21 +0,0 @@
1
- import { O as t } from "./three.tsl-Btj1hLsf.js";
2
- import { t as s } from "./ColorAdjustment-FeXXpypd.js";
3
- const a = {
4
- name: "Grayscale",
5
- category: "Adjustments",
6
- description: "Convert colors to black and white",
7
- requiresChild: !0,
8
- props: {},
9
- fragmentNode: ({ childNode: e }) => {
10
- const { vec4: r } = t;
11
- if (!e)
12
- return console.error("You must pass a child component into the Grayscale shader."), r(0);
13
- const o = e || r(0, 0, 0, 0);
14
- return r(s(o.rgb).rgb, o.a);
15
- }
16
- };
17
- var i = a;
18
- export {
19
- a as n,
20
- i as t
21
- };
@@ -1,50 +0,0 @@
1
- import { O as k } from "./three.tsl-Btj1hLsf.js";
2
- import { r as T } from "./transformations-CsrIJXh-.js";
3
- const C = {
4
- name: "Grid",
5
- category: "Base Layers",
6
- description: "Simple grid lines pattern with adjustable thickness",
7
- acceptsUVContext: !0,
8
- props: {
9
- color: {
10
- default: "#ffffff",
11
- transform: T,
12
- description: "The color of the grid lines",
13
- ui: {
14
- type: "color",
15
- label: "Color"
16
- }
17
- },
18
- cells: {
19
- default: 10,
20
- description: "Number of cells along the shortest canvas edge (creates square cells)",
21
- ui: {
22
- type: "range",
23
- min: 1,
24
- max: 50,
25
- step: 1,
26
- label: "Cells"
27
- }
28
- },
29
- thickness: {
30
- default: 1,
31
- description: "Thickness of grid lines (normalized, 0.0-1.0)",
32
- ui: {
33
- type: "range",
34
- min: 0,
35
- max: 5,
36
- step: 0.1,
37
- label: "Thickness"
38
- }
39
- }
40
- },
41
- fragmentNode: ({ uniforms: e, uvContext: l }) => {
42
- const { vec2: a, vec4: d, fract: m, max: p, screenUV: f, viewportSize: o, fwidth: u, smoothstep: n } = k, i = l ?? f, h = o.x.div(o.y), g = a(i.x.mul(h), i.y.oneMinus()), x = e.cells.uniform, r = g.mul(x), t = m(r), s = e.thickness.uniform.mul(0.01), y = t.x.min(t.x.oneMinus()), v = t.y.min(t.y.oneMinus()), c = u(r), b = p(n(s.add(c.x), s, y), n(s.add(c.y), s, v));
43
- return d(e.color.uniform.rgb, e.color.uniform.a.mul(b));
44
- }
45
- };
46
- var V = C;
47
- export {
48
- C as n,
49
- V as t
50
- };
@@ -1,147 +0,0 @@
1
- import { D as $, O as B } from "./three.tsl-Btj1hLsf.js";
2
- import { t as J } from "./edges-CDzKsauJ.js";
3
- import { a as K } from "./transformations-CsrIJXh-.js";
4
- import { DataTexture as Q, FloatType as ee, LinearFilter as C, RGFormat as te } from "three";
5
- var ae = 20, f = /* @__PURE__ */ new WeakMap(), ie = (e) => {
6
- let t = f.get(e);
7
- const n = e?.gridSize?.uniform?.value ? Math.max(8, Math.min(128, Math.floor(e.gridSize.uniform.value))) : ae;
8
- if (t && t.gridSize !== n && (t.texture.dispose(), t = void 0, f.delete(e)), !t) {
9
- const l = new Float32Array(n * n * 2), s = new Q(l, n, n, te, ee);
10
- s.magFilter = C, s.minFilter = C, s.needsUpdate = !0, t = {
11
- texture: s,
12
- data: l,
13
- tslNode: $(s),
14
- gridSize: n
15
- }, f.set(e, t);
16
- }
17
- return t;
18
- };
19
- const re = {
20
- name: "GridDistortion",
21
- category: "Interactive",
22
- description: "Interactive grid distortion controlled by mouse position",
23
- requiresRTT: !0,
24
- requiresChild: !0,
25
- props: {
26
- intensity: {
27
- default: 1,
28
- description: "Strength of the distortion effect",
29
- ui: {
30
- type: "range",
31
- min: 0,
32
- max: 5,
33
- step: 0.1,
34
- label: "Intensity"
35
- }
36
- },
37
- swirl: {
38
- default: 0,
39
- description: "Amount of swirl motion",
40
- ui: {
41
- type: "range",
42
- min: 0,
43
- max: 2,
44
- step: 0.1,
45
- label: "Swirl"
46
- }
47
- },
48
- decay: {
49
- default: 3,
50
- description: "Rate of distortion decay (higher = faster)",
51
- ui: {
52
- type: "range",
53
- min: 0,
54
- max: 10,
55
- step: 0.1,
56
- label: "Decay"
57
- }
58
- },
59
- radius: {
60
- default: 1,
61
- description: "Radius of the distortion effect",
62
- ui: {
63
- type: "range",
64
- min: 0,
65
- max: 3,
66
- step: 0.01,
67
- label: "Radius"
68
- }
69
- },
70
- gridSize: {
71
- default: 20,
72
- description: "Resolution of the distortion grid (higher = more detailed)",
73
- ui: {
74
- type: "range",
75
- min: 8,
76
- max: 128,
77
- step: 1,
78
- label: "Grid Size"
79
- }
80
- },
81
- edges: {
82
- default: "stretch",
83
- description: "How to handle edges when distortion pushes content out of bounds",
84
- transform: K,
85
- ui: {
86
- type: "select",
87
- options: [
88
- {
89
- label: "Stretch",
90
- value: "stretch"
91
- },
92
- {
93
- label: "Transparent",
94
- value: "transparent"
95
- },
96
- {
97
- label: "Mirror",
98
- value: "mirror"
99
- },
100
- {
101
- label: "Wrap",
102
- value: "wrap"
103
- }
104
- ],
105
- label: "Edges"
106
- }
107
- }
108
- },
109
- fragmentNode: ({ uniforms: e, onBeforeRender: t, childNode: n, onCleanup: l }) => {
110
- const { vec2: s, vec4: H, float: g, uniform: T, screenUV: w, convertToTexture: L } = B, { texture: z, data: a, tslNode: N, gridSize: d } = ie(e), h = T(0), v = T(0);
111
- let F = 0.5, I = 0.5, R = Date.now();
112
- if (t(({ pointer: o }) => {
113
- const _ = Date.now(), i = Math.min((_ - R) / 1e3, 0.016);
114
- R = _;
115
- const V = i > 0 ? (o.x - F) / i : 0, X = i > 0 ? (o.y - I) / i : 0;
116
- h.value = h.value * 0.85 + V * 0.15, v.value = v.value * 0.85 + X * 0.15;
117
- const Y = e.decay.uniform.value, q = e.intensity.uniform.value, y = e.radius.uniform.value * 0.05, M = e.swirl.uniform.value;
118
- for (let u = 0; u < d; u++) for (let m = 0; m < d; m++) {
119
- const r = (u * d + m) * 2;
120
- a[r] *= 1 - Y * i, a[r + 1] *= 1 - Y * i;
121
- const k = (m + 0.5) / d, P = (u + 0.5) / d, S = k - o.x, D = P - o.y, b = Math.sqrt(S * S + D * D);
122
- if (b < y * 2 && Math.abs(V) + Math.abs(X) > 0.01) {
123
- const p = Math.exp(-b * b / (y * y));
124
- if (a[r] += h.value * p * q * i * 0.5, a[r + 1] += v.value * p * q * i * 0.5, M > 0) {
125
- const A = Math.atan2(D, S) + Math.PI * 0.5;
126
- a[r] += Math.cos(A) * M * p * i * 2, a[r + 1] += Math.sin(A) * M * p * i * 2;
127
- }
128
- }
129
- a[r] = Math.max(-1, Math.min(1, a[r])), a[r + 1] = Math.max(-1, Math.min(1, a[r + 1]));
130
- }
131
- z.needsUpdate = !0, F = o.x, I = o.y;
132
- }), l(() => {
133
- z.dispose(), f.delete(e);
134
- }), !n) return H(0, 0, 0, 0);
135
- const c = L(n);
136
- l(() => {
137
- c?.renderTarget?.dispose && c.renderTarget.dispose();
138
- });
139
- const O = e.gridSize.uniform, x = g(1).div(O), W = w.div(x).floor().mul(x).add(x.mul(0.5)), Z = N.sample(W).xy, U = g(0.1), E = g(-0.1), j = Z.clamp(s(E, E), s(U, U)), G = w.sub(j);
140
- return J(G, c.sample(G), c, e.edges.uniform);
141
- }
142
- };
143
- var de = re;
144
- export {
145
- re as n,
146
- de as t
147
- };
@@ -1,17 +0,0 @@
1
- import { O as r } from "./three.tsl-Btj1hLsf.js";
2
- const t = {
3
- name: "Group",
4
- category: "Utilities",
5
- description: "Container for organizing and composing child effects",
6
- requiresChild: !0,
7
- props: {},
8
- fragmentNode: ({ childNode: e }) => {
9
- const { vec4: o } = r;
10
- return e || o(0);
11
- }
12
- };
13
- var i = t;
14
- export {
15
- t as n,
16
- i as t
17
- };
@@ -1,55 +0,0 @@
1
- import { O as V } from "./three.tsl-Btj1hLsf.js";
2
- import { n as A } from "./transformations-CsrIJXh-.js";
3
- const D = {
4
- name: "Halftone",
5
- category: "Stylize",
6
- description: "Halftone dot pattern effect for printing aesthetics",
7
- requiresChild: !0,
8
- props: {
9
- frequency: {
10
- default: 100,
11
- description: "Frequency of the halftone dots",
12
- ui: {
13
- type: "range",
14
- min: 10,
15
- max: 300,
16
- step: 1,
17
- label: "Frequency"
18
- }
19
- },
20
- angle: {
21
- default: 45,
22
- transform: A,
23
- description: "Rotation angle of the pattern (in degrees)",
24
- ui: {
25
- type: "range",
26
- min: 0,
27
- max: 360,
28
- step: 1,
29
- label: "Angle"
30
- }
31
- },
32
- smoothness: {
33
- default: 0.1,
34
- description: "Edge smoothness of the dots",
35
- ui: {
36
- type: "range",
37
- min: 0,
38
- max: 0.3,
39
- step: 0.01,
40
- label: "Smoothness"
41
- }
42
- }
43
- },
44
- fragmentNode: ({ uniforms: t, childNode: s }) => {
45
- const { vec2: e, vec3: g, vec4: r, sin: h, cos: y, fract: b, length: v, smoothstep: x, dot: n, screenUV: q, viewportSize: a, radians: S } = V;
46
- if (!s) return r(0);
47
- const c = q, _ = t.frequency.uniform, z = t.angle.uniform, i = t.smoothness.uniform, l = S(z), C = a.x.div(a.y), m = e(c.x.mul(C), c.y), f = y(l), d = h(l), H = b(e(n(m, e(f, d.negate())), n(m, e(d, f))).mul(_)).sub(0.5), o = s, u = n(o.rgb, g(0.299, 0.587, 0.114)).mul(0.7).add(0.15), U = v(H), p = x(u.add(i), u.sub(i), U);
48
- return r(o.rgb.mul(p), o.a.mul(p));
49
- }
50
- };
51
- var E = D;
52
- export {
53
- D as n,
54
- E as t
55
- };
@@ -1,32 +0,0 @@
1
- import { O as n } from "./three.tsl-Btj1hLsf.js";
2
- import { n as s } from "./ColorAdjustment-FeXXpypd.js";
3
- const i = {
4
- name: "HueShift",
5
- category: "Adjustments",
6
- description: "Rotate hue around the color wheel",
7
- requiresChild: !0,
8
- props: { shift: {
9
- default: 0,
10
- description: "The amount to shift the hue by",
11
- ui: {
12
- type: "range",
13
- min: -180,
14
- max: 180,
15
- step: 1,
16
- label: "Shift"
17
- },
18
- transform: (t) => t * Math.PI / 180
19
- } },
20
- fragmentNode: ({ uniforms: t, childNode: o }) => {
21
- const { vec4: e } = n;
22
- if (!o)
23
- return console.error("You must pass a child component into the Hue Shift shader."), e(0);
24
- const r = o || e(0, 0, 0, 0);
25
- return e(s(r.rgb, t.shift.uniform).rgb, r.a);
26
- }
27
- };
28
- var h = i;
29
- export {
30
- i as n,
31
- h as t
32
- };
@@ -1,105 +0,0 @@
1
- import { B as S, H as oe, O as ae, S as ne, U as se, k as x, y } from "./three.tsl-Btj1hLsf.js";
2
- const ie = {
3
- name: "ImageTexture",
4
- category: "Base Layers",
5
- description: "Display an image with customizable object-fit modes",
6
- acceptsUVContext: !0,
7
- props: {
8
- url: {
9
- default: "https://shaders.com/sample.jpg",
10
- description: "Upload an image or provide a URL",
11
- ui: {
12
- type: "image-upload",
13
- label: "Image"
14
- }
15
- },
16
- objectFit: {
17
- default: "cover",
18
- description: "How the image should be sized within the viewport",
19
- transform: (m) => ({
20
- cover: 0,
21
- contain: 1,
22
- fill: 2,
23
- "scale-down": 3,
24
- none: 4
25
- })[m] ?? 0,
26
- ui: {
27
- type: "select",
28
- options: [
29
- {
30
- label: "Cover",
31
- value: "cover"
32
- },
33
- {
34
- label: "Contain",
35
- value: "contain"
36
- },
37
- {
38
- label: "Fill",
39
- value: "fill"
40
- },
41
- {
42
- label: "Scale Down",
43
- value: "scale-down"
44
- },
45
- {
46
- label: "None",
47
- value: "none"
48
- }
49
- ],
50
- label: "Object Fit"
51
- }
52
- }
53
- },
54
- fragmentNode: ({ uniforms: m, onCleanup: D, onBeforeRender: W, uvContext: A }) => {
55
- const { vec2: o, vec4: B, float: t, texture: H, screenUV: N, viewportSize: l, step: a, min: u, max: O } = ae, z = A ?? N, _ = new se();
56
- let T = "", r = !1;
57
- const n = new oe();
58
- n.colorSpace = S;
59
- const $ = H(n), s = x(1), f = x(0), U = x(0), V = (e) => {
60
- if (!(!e || e.trim() === "" || r)) {
61
- r = !0;
62
- try {
63
- let h = e;
64
- try {
65
- h = new URL(e, window.location.href).href;
66
- } catch {
67
- }
68
- _.load(e, (d) => {
69
- d.colorSpace = S;
70
- const p = d.image, w = p.width || 1, b = p.height || 1, te = w / b;
71
- d.dispose(), T = e, requestAnimationFrame(() => {
72
- const g = n.image;
73
- g && typeof g == "object" && (g.width !== w || g.height !== b) && n.dispose(), s.value = te, f.value = w, U.value = b, n.image = p, n.colorSpace = S, n.needsUpdate = !0;
74
- }), r = !1;
75
- }, void 0, (d) => {
76
- const p = !e.startsWith("http://") && !e.startsWith("https://") && !e.startsWith("data:");
77
- console.error(`[ImageTexture] Failed to load image
78
- Requested URL: ${e}
79
- Resolved URL: ${h}
80
- Path type: ${p ? "relative" : "absolute"}
81
- Error:`, d), r = !1;
82
- });
83
- } catch (h) {
84
- console.error("[ImageTexture] Error initiating image load:", h), r = !1;
85
- }
86
- }
87
- };
88
- setTimeout(() => {
89
- const e = m?.url?.uniform?.value ?? "";
90
- e && e.trim() !== "" && V(e);
91
- }, 0), W(() => {
92
- const e = m?.url?.uniform?.value ?? "";
93
- e !== T && !r && V(e);
94
- }), D(() => {
95
- n.dispose();
96
- });
97
- const q = z, c = l.x.div(l.y), i = m.objectFit.uniform, j = O(c.div(s), t(1)), E = o(s.div(c).mul(j), j), F = u(c.div(s), t(1)), k = o(s.div(c).mul(F), F), G = o(1, 1), R = u(u(c.div(s), t(1)), u(l.x.div(f), l.y.div(U))), M = o(s.div(c).mul(R), R), C = u(l.x.div(f), l.y.div(U)), P = o(s.div(c).mul(C), C), J = a(i, t(0.5)), K = a(t(0.5), i).mul(a(i, t(1.5))), Q = a(t(1.5), i).mul(a(i, t(2.5))), X = a(t(2.5), i).mul(a(i, t(3.5))), Y = a(t(3.5), i), Z = o(0).add(E.mul(J)).add(k.mul(K)).add(G.mul(Q)).add(M.mul(X)).add(P.mul(Y)), I = q.sub(o(0.5)).div(Z).add(o(0.5)), v = o(I.x, t(1).sub(I.y)), L = $.sample(v), ee = y(y(v.x.lessThan(0), v.x.greaterThan(1)), y(v.y.lessThan(0), v.y.greaterThan(1)));
98
- return B(L.rgb, ne(ee, t(0), L.a));
99
- }
100
- };
101
- var le = ie;
102
- export {
103
- ie as n,
104
- le as t
105
- };
@@ -1,20 +0,0 @@
1
- import { O as a } from "./three.tsl-Btj1hLsf.js";
2
- const c = {
3
- name: "Invert",
4
- category: "Adjustments",
5
- description: "Invert RGB colors while preserving alpha",
6
- requiresChild: !0,
7
- props: {},
8
- fragmentNode: ({ childNode: t }) => {
9
- const { vec4: r, vec3: n } = a;
10
- if (!t)
11
- return console.error("You must pass a child component into the Invert shader."), r(0);
12
- const o = t || r(0, 0, 0, 0), e = o.a, s = e.greaterThan(0).select(o.rgb.div(e), n(0, 0, 0));
13
- return r(n(1, 1, 1).sub(s).mul(e), e);
14
- }
15
- };
16
- var p = c;
17
- export {
18
- c as n,
19
- p as t
20
- };
@@ -1,56 +0,0 @@
1
- import { O as q } from "./three.tsl-Btj1hLsf.js";
2
- import { n as w } from "./transformations-CsrIJXh-.js";
3
- const A = {
4
- name: "LinearBlur",
5
- category: "Blurs",
6
- description: "Directional motion blur in a specific angle",
7
- requiresRTT: !0,
8
- requiresChild: !0,
9
- props: {
10
- intensity: {
11
- default: 30,
12
- description: "Intensity of the linear blur effect",
13
- ui: {
14
- type: "range",
15
- min: 0,
16
- max: 100,
17
- step: 1,
18
- label: "Intensity"
19
- }
20
- },
21
- angle: {
22
- default: 0,
23
- transform: w,
24
- description: "Direction of the linear blur (in degrees)",
25
- ui: {
26
- type: "range",
27
- min: 0,
28
- max: 360,
29
- step: 1,
30
- label: "Angle"
31
- }
32
- }
33
- },
34
- fragmentNode: ({ uniforms: s, childNode: a, onCleanup: d }) => {
35
- const { vec2: l, vec4: u, float: e, screenUV: p, viewportSize: f, sin: g, cos: v, radians: b, Fn: x, convertToTexture: y } = q;
36
- if (!a) return u(0, 0, 0, 0);
37
- const t = y(a);
38
- d(() => {
39
- t?.renderTarget?.dispose && t.renderTarget.dispose();
40
- });
41
- const c = b(s.angle.uniform), T = l(v(c), g(c));
42
- return x(() => {
43
- const h = p, D = l(1).div(f), V = T.mul(s.intensity.uniform).mul(D).mul(2), n = u(0).toVar(), r = e(0).toVar();
44
- for (let i = 0; i < 32; i++) {
45
- const o = e(i).div(e(31)).sub(0.5).mul(2), m = e(1).div(e(2.506628)).mul(e(-0.5).mul(o).mul(o).div(e(0.64)).exp()), B = h.add(V.mul(o.mul(0.5))), _ = t.sample(B).mul(m);
46
- n.assign(n.add(_)), r.assign(r.add(m));
47
- }
48
- return n.div(r);
49
- })();
50
- }
51
- };
52
- var R = A;
53
- export {
54
- A as n,
55
- R as t
56
- };