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
@@ -1 +1 @@
1
- {"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AA6kBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,UAwD/B,CAAA"}
1
+ {"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAgmBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,UAyD/B,CAAA"}
@@ -1,5 +1,2 @@
1
- import { n as a, t as o } from "../generatePresetCode-Cd1B-Y9j.js";
2
- export {
3
- o as availableComponents,
4
- a as generatePresetCode
5
- };
1
+ import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-CRJmU8iF.js";
2
+ export { availableComponents, generatePresetCode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shaders",
3
- "version": "2.2.23",
3
+ "version": "2.2.25",
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/",
@@ -329,6 +329,11 @@
329
329
  "types": "./dist/core/shaders/Spherize/index.d.ts",
330
330
  "import": "./dist/core/shaders/Spherize/index.js",
331
331
  "require": "./dist/core/shaders/Spherize/index.js"
332
+ },
333
+ "./core/Beam": {
334
+ "types": "./dist/core/shaders/Beam/index.d.ts",
335
+ "import": "./dist/core/shaders/Beam/index.js",
336
+ "require": "./dist/core/shaders/Beam/index.js"
332
337
  }
333
338
  },
334
339
  "typesVersions": {
@@ -372,6 +377,9 @@
372
377
  "core/Ascii": [
373
378
  "./dist/core/shaders/Ascii/index.d.ts"
374
379
  ],
380
+ "core/Beam": [
381
+ "./dist/core/shaders/Beam/index.d.ts"
382
+ ],
375
383
  "core/Blob": [
376
384
  "./dist/core/shaders/Blob/index.d.ts"
377
385
  ],
@@ -544,6 +552,9 @@
544
552
  "dev": "tsx scripts/build.ts --watch",
545
553
  "typecheck": "tsc --noEmit"
546
554
  },
555
+ "dependencies": {
556
+ "three": "^0.181.0"
557
+ },
547
558
  "devDependencies": {
548
559
  "@types/fs-extra": "^11.0.4",
549
560
  "@types/node": "^20.17.11",
@@ -1,56 +0,0 @@
1
- import { O as _ } from "./three.tsl-Btj1hLsf.js";
2
- import { o as q } from "./transformations-CsrIJXh-.js";
3
- const I = {
4
- name: "AngularBlur",
5
- category: "Blurs",
6
- description: "Radial motion blur rotating around a center point",
7
- requiresRTT: !0,
8
- requiresChild: !0,
9
- props: {
10
- intensity: {
11
- default: 20,
12
- description: "Intensity of the angular blur effect",
13
- ui: {
14
- type: "range",
15
- min: 0,
16
- max: 100,
17
- step: 1,
18
- label: "Blur Intensity"
19
- }
20
- },
21
- center: {
22
- default: {
23
- x: 0.5,
24
- y: 0.5
25
- },
26
- transform: q,
27
- description: "The center point of the rotation",
28
- ui: {
29
- type: "position",
30
- label: "Center Position"
31
- }
32
- }
33
- },
34
- fragmentNode: ({ uniforms: r, childNode: a, onCleanup: y }) => {
35
- const { vec2: l, vec4: u, float: t, screenUV: x, sin: v, cos: T, Fn: b, convertToTexture: h } = _;
36
- if (!a) return u(0, 0, 0, 0);
37
- const o = h(a);
38
- y(() => {
39
- o?.renderTarget?.dispose && o.renderTarget.dispose();
40
- });
41
- const c = l(r.center.uniform.x, r.center.uniform.y.oneMinus()), A = r.intensity.uniform.mul(5e-3);
42
- return b(() => {
43
- const e = x.sub(c), s = u(0).toVar(), i = t(0).toVar(), B = A.div(t(31));
44
- for (let n = 0; n < 32; n++) {
45
- const d = t(n).div(t(31)).sub(0.5).mul(2), m = t(1).div(t(2.506628)).mul(t(-0.5).mul(d).mul(d).div(t(0.64)).exp()), p = B.mul(t(n)), f = T(p), g = v(p), C = l(e.x.mul(f).sub(e.y.mul(g)), e.x.mul(g).add(e.y.mul(f))).add(c), V = o.sample(C).mul(m);
46
- s.assign(s.add(V)), i.assign(i.add(m));
47
- }
48
- return s.div(i);
49
- })();
50
- }
51
- };
52
- var w = I;
53
- export {
54
- I as n,
55
- w as t
56
- };
@@ -1,196 +0,0 @@
1
- import { O as $e, S as Re, d as Y, k as x, p as ke, r as Ee, t as _e, y as De } from "./three.tsl-Btj1hLsf.js";
2
- import { DataTexture as qe, NearestFilter as ee, RGBAFormat as Ge, UnsignedByteType as Je } from "three";
3
- const d = {
4
- name: "Ascii",
5
- category: "Stylize",
6
- description: "Convert imagery to ASCII character art",
7
- requiresRTT: !0,
8
- requiresChild: !0,
9
- props: {
10
- characters: {
11
- default: "@%#*+=-:.",
12
- description: "Characters to use for ASCII effect (light to dark)",
13
- ui: {
14
- type: "text",
15
- label: "Characters"
16
- }
17
- },
18
- cellSize: {
19
- default: 30,
20
- description: "Size of each ASCII character cell in pixels",
21
- ui: {
22
- type: "range",
23
- min: 8,
24
- max: 100,
25
- step: 1,
26
- label: "Cell Size"
27
- }
28
- },
29
- fontFamily: {
30
- default: "JetBrains Mono",
31
- description: "Font family for characters",
32
- ui: {
33
- type: "select",
34
- options: [
35
- {
36
- label: "JetBrains Mono",
37
- value: "JetBrains Mono"
38
- },
39
- {
40
- label: "Fira Code",
41
- value: "Fira Code"
42
- },
43
- {
44
- label: "Source Code Pro",
45
- value: "Source Code Pro"
46
- },
47
- {
48
- label: "IBM Plex Mono",
49
- value: "IBM Plex Mono"
50
- },
51
- {
52
- label: "Space Mono",
53
- value: "Space Mono"
54
- },
55
- {
56
- label: "Roboto Mono",
57
- value: "Roboto Mono"
58
- },
59
- {
60
- label: "Courier Prime",
61
- value: "Courier Prime"
62
- }
63
- ],
64
- label: "Font Family"
65
- }
66
- },
67
- spacing: {
68
- default: 1,
69
- description: "Character size within each cell (1.0 = optimal size, 0.0 = smallest)",
70
- ui: {
71
- type: "range",
72
- min: 0,
73
- max: 1,
74
- step: 0.05,
75
- label: "Character Size"
76
- },
77
- transform: (a) => 0.1 + a * 1.4
78
- }
79
- },
80
- fragmentNode: ({ uniforms: a, childNode: $, onCleanup: R, onBeforeRender: te }) => {
81
- const { vec2: v, vec3: k, vec4: E, floor: M, fract: ae, dot: _, ceil: oe, sqrt: ne, screenUV: le, texture: re, viewportSize: ce, convertToTexture: se } = $e;
82
- if (!$) return E(0, 0, 0, 0);
83
- const w = se($);
84
- R(() => {
85
- w?.renderTarget?.dispose && w.renderTarget.dispose();
86
- });
87
- const l = 2048, D = {
88
- "JetBrains Mono": "JetBrains+Mono",
89
- "Fira Code": "Fira+Code",
90
- "Source Code Pro": "Source+Code+Pro",
91
- "IBM Plex Mono": "IBM+Plex+Mono",
92
- "Space Mono": "Space+Mono",
93
- "Roboto Mono": "Roboto+Mono",
94
- "Courier Prime": "Courier+Prime"
95
- }, y = /* @__PURE__ */ new Set();
96
- async function ie(e) {
97
- if (y.has(e) || !D[e]) return;
98
- const n = D[e];
99
- if (!document.querySelector(`link[href*="${n}"]`)) {
100
- const t = document.createElement("link");
101
- t.rel = "stylesheet", t.href = `https://fonts.googleapis.com/css2?family=${n}:wght@400&display=swap`, document.head.appendChild(t);
102
- }
103
- try {
104
- if (document.fonts && document.fonts.load) {
105
- const t = [
106
- `400 12px "${e}"`,
107
- `12px "${e}"`,
108
- `400 12px ${e}`,
109
- `12px ${e}`
110
- ];
111
- for (const r of t) try {
112
- await document.fonts.load(r);
113
- break;
114
- } catch {
115
- }
116
- await new Promise((r) => setTimeout(r, 500)), y.add(e);
117
- } else
118
- await new Promise((t) => setTimeout(t, 1e3)), y.add(e);
119
- } catch {
120
- }
121
- }
122
- const q = async (e, n, t, r) => {
123
- if (!e || e.length === 0) throw new Error("Characters string cannot be empty");
124
- const u = e.length, i = Math.max(2, Math.ceil(Math.sqrt(u))), Fe = 128, Te = Math.max(1, 2 / r), h = Math.min(Fe * Te, l / i), W = h * 0.75, p = document.createElement("canvas");
125
- p.width = l, p.height = l;
126
- const c = p.getContext("2d");
127
- c.clearRect(0, 0, p.width, p.height), c.fillStyle = "#ffffff", c.font = `${W}px "${t}", ${t}, monospace`, !c.font.includes(t) && !c.font.includes("IBM") && !c.font.includes("Plex") && (c.font = `${W}px ${t}, monospace`), c.textAlign = "center", c.textBaseline = "middle";
128
- for (let C = 0; C < u; C++) {
129
- const Be = e[C], Pe = Math.floor(C / i), Ae = C % i * h + h / 2, Ie = Pe * h + h / 2;
130
- c.fillText(Be, Ae, Ie);
131
- }
132
- const Ue = c.getImageData(0, 0, p.width, p.height);
133
- return {
134
- data: new Uint8Array(Ue.data),
135
- width: l,
136
- height: l,
137
- atlasSize: i,
138
- cellSize: n,
139
- charCount: u,
140
- characters: e,
141
- fontFamily: t,
142
- uvScale: i * h / l
143
- };
144
- }, ue = d.props.characters.default, de = d.props.cellSize.default, pe = d.props.fontFamily.default, he = d.props.spacing.transform ? d.props.spacing.transform(d.props.spacing.default) : d.props.spacing.default, b = a?.characters?.uniform?.value ?? ue, G = a?.cellSize?.uniform?.value ?? de, F = a?.fontFamily?.uniform?.value ?? pe, J = a?.spacing?.uniform?.value ?? he;
145
- let o = {
146
- data: new Uint8Array(l * l * 4),
147
- width: l,
148
- height: l,
149
- atlasSize: 3,
150
- cellSize: G,
151
- charCount: b.length,
152
- characters: b,
153
- fontFamily: F,
154
- uvScale: 1
155
- };
156
- const s = new qe(o.data, l, l, Ge, Je);
157
- s.minFilter = ee, s.magFilter = ee, s.generateMipmaps = !1, s.needsUpdate = !0;
158
- const me = re(s), T = x(o.charCount), U = x(o.cellSize), B = x(o.uvScale);
159
- let m = b, f = G, S = F, g = J;
160
- const O = async () => {
161
- const e = a?.characters?.uniform?.value ?? m, n = a?.cellSize?.uniform?.value ?? f, t = a?.fontFamily?.uniform?.value ?? S, r = a?.spacing?.uniform?.value ?? g;
162
- o = await q(e, n, t, r), s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, B.value = o.uvScale, m = e, f = n, S = t, g = r;
163
- };
164
- setTimeout(() => {
165
- O().catch((e) => {
166
- console.error("Failed to initialize atlas:", e);
167
- }), ie(a?.fontFamily?.uniform?.value ?? F).then(() => {
168
- O().catch((e) => {
169
- console.error("Failed to update atlas with custom font:", e);
170
- });
171
- }).catch((e) => {
172
- console.error("Failed to load font:", e);
173
- });
174
- }, 0);
175
- let V = 0, z = !1;
176
- te(() => {
177
- const e = Date.now();
178
- if (e - V < 16 || z) return;
179
- const n = a.characters?.uniform?.value ?? m, t = a.cellSize?.uniform?.value ?? f, r = a.fontFamily?.uniform?.value ?? S, u = a.spacing?.uniform?.value ?? g;
180
- !n || n.length === 0 || (n !== m || t !== f || r !== S || u !== g) && (V = e, z = !0, q(n, t, r, u).then((i) => {
181
- o = i, s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, B.value = o.uvScale, m = n, f = t, S = r, g = u, z = !1;
182
- }).catch((i) => {
183
- console.error("Failed to update atlas:", i), z = !1;
184
- }));
185
- }), R(() => {
186
- s.dispose();
187
- });
188
- const fe = U.mul(1.5), N = ce.div(fe), L = le.mul(N), Se = M(L), ge = ae(L), X = a.spacing?.uniform ?? x(J), Z = v(0.5), j = ge.sub(Z), Ce = j.div(X).add(Z), ve = Ee(ke(_e(j), v(X.mul(0.5)))), ze = Se.add(v(0.5)).div(N), P = w.sample(ze), xe = _(P.rgb, k(0.299, 0.587, 0.114)), A = T, H = M(xe.mul(0.8).add(0.1).mul(A).min(A.sub(1e-4))), I = oe(ne(A)), Me = H.mod(I), we = M(H.div(I)), K = Y(1).div(I).mul(B), ye = v(Me, we).mul(K).add(Ce.mul(K)), Q = me.sample(ye), be = _(Q.rgb, k(0.299, 0.587, 0.114)).lessThan(0.1);
189
- return E(Q.rgb.mul(P.rgb), Re(De(be, ve), Y(0), P.a));
190
- }
191
- };
192
- var Ne = d;
193
- export {
194
- d as n,
195
- Ne as t
196
- };
@@ -1,169 +0,0 @@
1
- import { O as fo } from "./three.tsl-Btj1hLsf.js";
2
- import { t as bo } from "./time-DbRMw6Jm.js";
3
- import { i as yo, o as xo, r as g, t as Co } from "./transformations-CsrIJXh-.js";
4
- import { t as vo } from "./colorMixing--dhzx0ch.js";
5
- const So = {
6
- name: "Blob",
7
- category: "Base Layers",
8
- description: "Organic animated blob with 3D lighting and gradients",
9
- acceptsUVContext: !0,
10
- props: {
11
- colorA: {
12
- default: "#ff6b35",
13
- transform: g,
14
- description: "Primary color of the blob",
15
- ui: {
16
- type: "color",
17
- label: "Color A"
18
- }
19
- },
20
- colorB: {
21
- default: "#e91e63",
22
- transform: g,
23
- description: "Secondary color of the blob",
24
- ui: {
25
- type: "color",
26
- label: "Color B"
27
- }
28
- },
29
- size: {
30
- default: 0.5,
31
- description: "Size of the blob",
32
- ui: {
33
- type: "range",
34
- min: 0,
35
- max: 1,
36
- step: 0.01,
37
- label: "Size"
38
- }
39
- },
40
- deformation: {
41
- default: 0.5,
42
- description: "How organic and blobby the shape is (0 = circle, 1 = very blobby)",
43
- ui: {
44
- type: "range",
45
- min: 0,
46
- max: 1,
47
- step: 0.01,
48
- label: "Deformation"
49
- }
50
- },
51
- softness: {
52
- default: 0.5,
53
- description: "Softness of the blob edges (combines edge width and transition curve)",
54
- ui: {
55
- type: "range",
56
- min: 0,
57
- max: 1,
58
- step: 0.01,
59
- label: "Softness"
60
- }
61
- },
62
- highlightIntensity: {
63
- default: 0.5,
64
- description: "Intensity of specular highlight effect",
65
- ui: {
66
- type: "range",
67
- min: 0,
68
- max: 1,
69
- step: 0.01,
70
- label: "Highlight Intensity"
71
- }
72
- },
73
- highlightX: {
74
- default: 0.3,
75
- description: "Light direction X component",
76
- ui: {
77
- type: "range",
78
- min: -1,
79
- max: 1,
80
- step: 0.01,
81
- label: "Highlight X"
82
- }
83
- },
84
- highlightY: {
85
- default: -0.3,
86
- description: "Light direction Y component",
87
- ui: {
88
- type: "range",
89
- min: -1,
90
- max: 1,
91
- step: 0.01,
92
- label: "Highlight Y"
93
- }
94
- },
95
- highlightZ: {
96
- default: 0.4,
97
- description: "Light direction Z component",
98
- ui: {
99
- type: "range",
100
- min: -1,
101
- max: 1,
102
- step: 0.01,
103
- label: "Highlight Z"
104
- }
105
- },
106
- highlightColor: {
107
- default: "#ffe11a",
108
- transform: g,
109
- description: "Color of the specular highlight",
110
- ui: {
111
- type: "color",
112
- label: "Highlight Color"
113
- }
114
- },
115
- speed: {
116
- default: 0.5,
117
- description: "Animation speed",
118
- ui: {
119
- type: "range",
120
- min: 0,
121
- max: 2,
122
- step: 0.1,
123
- label: "Speed"
124
- }
125
- },
126
- seed: {
127
- default: 1,
128
- description: "Adjusts the starting state, useful for variation",
129
- ui: {
130
- type: "range",
131
- min: 0,
132
- max: 100,
133
- step: 1,
134
- label: "Seed"
135
- }
136
- },
137
- center: {
138
- default: {
139
- x: 0.5,
140
- y: 0.5
141
- },
142
- transform: xo,
143
- description: "The center point of the blob",
144
- ui: {
145
- type: "position",
146
- label: "Center Position"
147
- }
148
- },
149
- colorSpace: {
150
- default: "linear",
151
- transform: yo,
152
- description: "Color space for color interpolation",
153
- ui: {
154
- type: "select",
155
- options: Co,
156
- label: "Color Space"
157
- }
158
- }
159
- },
160
- fragmentNode: (p) => {
161
- const { uniforms: i, uvContext: D } = p, { vec2: f, vec3: c, vec4: X, float: o, screenUV: Y, smoothstep: s, sin: e, length: b, viewportSize: y, pow: x, max: Z, normalize: C, dot: I, reflect: N } = fo, v = D ?? Y, l = bo(p, i.speed, i.seed), S = i.colorA.uniform, A = i.colorB.uniform, P = i.size.uniform, u = i.deformation.uniform, B = i.softness.uniform, L = i.highlightIntensity.uniform, R = i.highlightX.uniform, T = i.highlightY.uniform, U = i.highlightZ.uniform, V = i.highlightColor.uniform, w = B.mul(o(0.3)), O = B.mul(o(2)).add(o(0.5)), m = o(0.5), z = y.x.div(y.y), _ = f(v.x.mul(z), v.y), k = f(i.center.uniform.x.mul(z), i.center.uniform.y.oneMinus()), t = _.sub(k), M = b(t), j = P, n = o(4), F = e(t.x.mul(n.mul(o(0.8))).add(l.mul(o(0.8)))).mul(e(t.y.mul(n.mul(o(0.7))).add(l.mul(o(0.6))))).add(e(t.x.mul(n.mul(o(1.2))).sub(t.y.mul(n.mul(o(0.9))).add(l.mul(o(0.4)))))).mul(o(0.15)).mul(u), G = e(t.x.mul(n.mul(o(1.4))).sub(l.mul(o(0.5)))).mul(e(t.y.mul(n.mul(o(1.1))).add(l.mul(o(0.7))))).mul(o(0.12)).mul(u).mul(s(o(0.15), o(0.25), m)), W = e(t.x.mul(n.mul(o(1.8))).add(t.y.mul(n.mul(o(1.6))).add(l.mul(o(0.3))))).add(e(t.x.mul(n.mul(o(0.6))).sub(l.mul(o(0.9))))).mul(o(0.1)).mul(u).mul(s(o(0.3), o(0.4), m)), q = e(t.x.mul(n.mul(o(2.2))).add(l.mul(o(0.2)))).mul(e(t.y.mul(n.mul(o(1.9))).sub(l.mul(o(0.8))))).mul(o(0.08)).mul(u).mul(s(o(0.45), o(0.55), m)), E = e(t.x.mul(n.mul(o(2.8))).sub(t.y.mul(n.mul(o(2.4))).add(l.mul(o(0.6))))).mul(o(0.06)).mul(u).mul(s(o(0.6), o(0.7), m)), J = e(t.x.mul(n.mul(o(3.2))).add(l.mul(o(1.1)))).add(e(t.y.mul(n.mul(o(3.5))).sub(l.mul(o(0.4))))).mul(o(0.04)).mul(u).mul(s(o(0.75), o(0.85), m)), K = F.add(G).add(W).add(q).add(E).add(J), h = j.add(K), H = x(s(h.add(w), h.sub(w), M), O), Q = b(t), $ = h, a = s(o(0), $, Q), oo = o(1).sub(a.mul(o(0.1))), to = C(c(t.x.mul(a.add(o(0.2))), t.y.mul(a.add(o(0.2))), oo)), eo = C(c(R, T, U)), lo = c(o(0), o(0), o(1)), io = N(eo.negate(), to), no = o(32), so = x(Z(o(0), I(io, lo)), no), uo = a.mul(o(0.5)).add(o(0.5)), mo = so.mul(uo).mul(L).mul(H), r = t.x.mul(o(3)), d = t.y.mul(o(3)), ao = e(r.add(l.mul(o(0.4)))).mul(e(d.add(l.mul(o(0.3))))).add(e(r.mul(o(0.7)).add(d.mul(o(0.8))).add(l.mul(o(0.2))))).mul(o(0.5)).add(o(0.5)), ro = e(r.mul(o(1.3)).sub(l.mul(o(0.5)))).mul(e(d.mul(o(1.1)).add(l.mul(o(0.6))))).add(e(r.mul(o(0.5)).sub(d.mul(o(0.6)).sub(l.mul(o(0.3)))))).mul(o(0.5)).add(o(0.5)), co = ao.mul(o(0.6)).add(ro.mul(o(0.4))), ho = vo(S, A, s(o(0.1), o(0.9), co), i.colorSpace.uniform).rgb, go = S.a.add(A.a).div(o(2)), po = V.rgb.mul(mo);
162
- return X(ho.add(po), go.mul(H));
163
- }
164
- };
165
- var Ho = So;
166
- export {
167
- So as n,
168
- Ho as t
169
- };
@@ -1,64 +0,0 @@
1
- import { O as S } from "./three.tsl-Btj1hLsf.js";
2
- const B = {
3
- name: "Blur",
4
- category: "Blurs",
5
- description: "A simple Gaussian blur effect",
6
- requiresRTT: !0,
7
- requiresChild: !0,
8
- props: { intensity: {
9
- default: 50,
10
- description: "Intensity of the blur effect",
11
- ui: {
12
- type: "range",
13
- min: 0,
14
- max: 100,
15
- step: 1,
16
- label: "Intensity"
17
- }
18
- } },
19
- fragmentNode: ({ uniforms: z, childNode: f, onCleanup: g }) => {
20
- const { vec2: r, vec4: n, float: s, screenUV: T, convertToTexture: v, viewportSize: x, Fn: h } = S;
21
- if (!f) return n(0, 0, 0, 0);
22
- const o = v(f);
23
- g(() => {
24
- o?.renderTarget?.dispose && o.renderTarget.dispose();
25
- });
26
- const y = [
27
- 0.056,
28
- 0.135,
29
- 0.278,
30
- 0.487,
31
- 0.726,
32
- 0.923,
33
- 1,
34
- 0.923,
35
- 0.726,
36
- 0.487,
37
- 0.278,
38
- 0.135,
39
- 0.056
40
- ], b = 6.214, w = z.intensity.uniform.mul(0.06), i = v(h(() => {
41
- const a = T, l = w, c = r(1).div(x), t = n(0).toVar();
42
- for (let e = -6; e <= 6; e++) {
43
- const u = s(y[e + 6] / b), d = r(s(e), s(0)).mul(l).mul(c), m = a.add(d), p = o.sample(m).mul(u);
44
- t.assign(t.add(p));
45
- }
46
- return t;
47
- })());
48
- return g(() => {
49
- i?.renderTarget?.dispose && i.renderTarget.dispose();
50
- }), h(() => {
51
- const a = T, l = w, c = r(1).div(x), t = n(0).toVar();
52
- for (let e = -6; e <= 6; e++) {
53
- const u = s(y[e + 6] / b), d = r(s(0), s(e)).mul(l).mul(c), m = a.add(d), p = i.sample(m).mul(u);
54
- t.assign(t.add(p));
55
- }
56
- return t;
57
- })();
58
- }
59
- };
60
- var R = B;
61
- export {
62
- B as n,
63
- R as t
64
- };
@@ -1,103 +0,0 @@
1
- import { O as V, d as i, m as R } from "./three.tsl-Btj1hLsf.js";
2
- import { t as S } from "./edges-CDzKsauJ.js";
3
- import { a as w, o as E } from "./transformations-CsrIJXh-.js";
4
- const P = {
5
- name: "Bulge",
6
- category: "Distortions",
7
- description: "Magnify or pinch content around a center point",
8
- requiresRTT: !0,
9
- requiresChild: !0,
10
- props: {
11
- center: {
12
- default: {
13
- x: 0.5,
14
- y: 0.5
15
- },
16
- transform: E,
17
- description: "The center point of the bulge effect",
18
- ui: {
19
- type: "position",
20
- label: "Center"
21
- }
22
- },
23
- strength: {
24
- default: 1,
25
- description: "The intensity of the bulge effect (positive = bulge out, negative = pinch in)",
26
- ui: {
27
- type: "range",
28
- min: -1,
29
- max: 1,
30
- step: 0.01,
31
- label: "Strength"
32
- }
33
- },
34
- radius: {
35
- default: 1,
36
- description: "The radius of the bulge effect area",
37
- ui: {
38
- type: "range",
39
- min: 0,
40
- max: 5,
41
- step: 0.01,
42
- label: "Radius"
43
- }
44
- },
45
- falloff: {
46
- default: 0.5,
47
- description: "Controls the smoothness of the transition (0 = hard edge, 1 = very smooth)",
48
- ui: {
49
- type: "range",
50
- min: 0,
51
- max: 1,
52
- step: 0.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: w,
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: e, uniforms: o, viewportSize: u }) => {
85
- const { vec2: n, length: b, smoothstep: x, float: t, max: d } = V, c = u.x.div(u.y), y = n(e.x.mul(c), e.y), s = n(o.center.uniform.x.mul(c), o.center.uniform.y.oneMinus()), a = y.sub(s), f = b(a), r = o.radius.uniform.mul(0.5), m = o.falloff.uniform, p = x(r.mul(t(1).sub(m).sub(t(1e-3)).max(t(0))), r, f).oneMinus(), l = f.div(r), v = l.mul(l), T = d(t(0), t(1).sub(v)), g = p.mul(T), F = o.strength.uniform.negate().mul(g), q = t(1).add(F), D = a.mul(q), h = s.add(D);
86
- return n(h.x.div(c), h.y);
87
- },
88
- fragmentNode: ({ uniforms: e, childNode: o, onCleanup: u }) => {
89
- const { vec2: n, vec4: b, length: x, screenUV: t, viewportSize: d, convertToTexture: c, smoothstep: y } = V;
90
- if (!o) return b(0, 0, 0, 0);
91
- const s = c(o);
92
- u(() => {
93
- s?.renderTarget?.dispose && s.renderTarget.dispose();
94
- });
95
- const a = d.x.div(d.y), f = n(t.x.mul(a), t.y), r = n(e.center.uniform.x.mul(a), e.center.uniform.y.oneMinus()), m = f.sub(r), p = x(m), l = e.radius.uniform.mul(0.5), v = e.falloff.uniform, T = y(l.mul(i(1).sub(v).sub(i(1e-3)).max(i(0))), l, p).oneMinus(), g = p.div(l), F = g.mul(g), q = R(i(0), i(1).sub(F)), D = T.mul(q), h = e.strength.uniform.negate().mul(D), C = i(1).add(h), A = m.mul(C), M = r.add(A), U = n(M.x.div(a), M.y);
96
- return S(U, s.sample(U), s, e.edges.uniform);
97
- }
98
- };
99
- var H = P;
100
- export {
101
- P as n,
102
- H as t
103
- };