shaders 2.5.94 → 2.5.95

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 (233) hide show
  1. package/dist/core/{Blur-DTyNQt1R.js → Blur-CC8fo0C5.js} +28 -3
  2. package/dist/core/{ChannelBlur-CCaPXjka.js → ChannelBlur-CN_Zyiur.js} +37 -2
  3. package/dist/core/{Crescent-DPxGWdPH.js → Crescent-BkRt-XWy.js} +1 -1
  4. package/dist/core/{Cross-CDyzf8TT.js → Cross-kkY7feuC.js} +1 -1
  5. package/dist/core/{Crystal-DSuN8TNY.js → Crystal-xVyUhVD-.js} +1 -1
  6. package/dist/core/CursorRipples-Cgm7N0Bp.js +289 -0
  7. package/dist/core/CursorTrail-CCRbdwHJ.js +263 -0
  8. package/dist/core/{Ellipse-BNmzdnpK.js → Ellipse-CXxGqTYI.js} +1 -1
  9. package/dist/core/{Emboss-nrduRrVs.js → Emboss-ClQV27Mt.js} +1 -1
  10. package/dist/core/{Flower-B4xPp0Qa.js → Flower-MAwlZEv8.js} +1 -1
  11. package/dist/core/{Glass-CRfTkmRy.js → Glass-gQCmJlsQ.js} +46 -8
  12. package/dist/core/{Glow-CKWIRcBt.js → Glow-DvN-WnB4.js} +32 -2
  13. package/dist/core/GridDistortion-DtaRNrTZ.js +278 -0
  14. package/dist/core/Liquify-cE5dxrfh.js +351 -0
  15. package/dist/core/{Neon-CUKnkAK8.js → Neon-Dg8UfC7P.js} +1 -1
  16. package/dist/core/{Polygon-C1y6Nyh4.js → Polygon-DRCs3CYs.js} +1 -1
  17. package/dist/core/{ProgressiveBlur-BcHBSVDo.js → ProgressiveBlur-Dm530r0z.js} +59 -2
  18. package/dist/core/{Ring-Chj1tp_P.js → Ring-QApyKPzE.js} +1 -1
  19. package/dist/core/{RoundedRect-BEj6tE1e.js → RoundedRect-Ca9af9xe.js} +1 -1
  20. package/dist/core/{Shatter-CZMOHj60.js → Shatter-BssZTRYJ.js} +154 -66
  21. package/dist/core/{Star-fPw1j10r.js → Star-DiXwnPGP.js} +1 -1
  22. package/dist/core/{TiltShift-BysRsV8v.js → TiltShift-BqKaU3TM.js} +60 -2
  23. package/dist/core/{Trapezoid-Cr61vRvN.js → Trapezoid-BX_hmeZJ.js} +1 -1
  24. package/dist/core/{Vesica-AXTA8DJU.js → Vesica-DU0f85NG.js} +1 -1
  25. package/dist/core/{VideoTexture-BobyGZGr.js → VideoTexture-DJrkry82.js} +1 -1
  26. package/dist/core/{WebcamTexture-BXj7sqND.js → WebcamTexture-Cf8J7JB1.js} +1 -1
  27. package/dist/core/computeBlur-B0KA4n89.js +141 -0
  28. package/dist/core/effects/glass.d.ts +1 -1
  29. package/dist/core/effects/glass.d.ts.map +1 -1
  30. package/dist/core/index.js +172 -121
  31. package/dist/core/registry.js +102 -101
  32. package/dist/core/renderer.d.ts +14 -0
  33. package/dist/core/renderer.d.ts.map +1 -1
  34. package/dist/core/shaderRegistry-DriE1ikS.js +244 -0
  35. package/dist/core/shaders/Blur/index.d.ts.map +1 -1
  36. package/dist/core/shaders/Blur/index.js +2 -1
  37. package/dist/core/shaders/BrightnessContrast/index.js +1 -1
  38. package/dist/core/shaders/Bulge/index.js +1 -1
  39. package/dist/core/shaders/CRTScreen/index.js +1 -1
  40. package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
  41. package/dist/core/shaders/ChannelBlur/index.js +2 -1
  42. package/dist/core/shaders/Checkerboard/index.js +1 -1
  43. package/dist/core/shaders/ChromaFlow/index.js +1 -1
  44. package/dist/core/shaders/ChromaticAberration/index.js +1 -1
  45. package/dist/core/shaders/Circle/index.js +1 -1
  46. package/dist/core/shaders/ConcentricSpin/index.js +1 -1
  47. package/dist/core/shaders/ConicGradient/index.js +1 -1
  48. package/dist/core/shaders/ContourLines/index.js +1 -1
  49. package/dist/core/shaders/Crescent/index.js +2 -2
  50. package/dist/core/shaders/Cross/index.js +2 -2
  51. package/dist/core/shaders/Crystal/index.js +2 -2
  52. package/dist/core/shaders/CursorRipples/index.d.ts.map +1 -1
  53. package/dist/core/shaders/CursorRipples/index.js +1 -1
  54. package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
  55. package/dist/core/shaders/CursorTrail/index.js +1 -1
  56. package/dist/core/shaders/DOMTexture/index.js +1 -1
  57. package/dist/core/shaders/DiamondGradient/index.js +1 -1
  58. package/dist/core/shaders/DiffuseBlur/index.js +1 -1
  59. package/dist/core/shaders/Dither/index.js +1 -1
  60. package/dist/core/shaders/DotGrid/index.js +1 -1
  61. package/dist/core/shaders/DropShadow/index.js +1 -1
  62. package/dist/core/shaders/Duotone/index.js +1 -1
  63. package/dist/core/shaders/Ellipse/index.js +2 -2
  64. package/dist/core/shaders/Emboss/index.js +2 -2
  65. package/dist/core/shaders/FallingLines/index.js +1 -1
  66. package/dist/core/shaders/FilmGrain/index.js +1 -1
  67. package/dist/core/shaders/FloatingParticles/index.js +1 -1
  68. package/dist/core/shaders/FlowField/index.js +1 -1
  69. package/dist/core/shaders/Flower/index.js +2 -2
  70. package/dist/core/shaders/FlowingGradient/index.js +1 -1
  71. package/dist/core/shaders/Form3D/index.js +1 -1
  72. package/dist/core/shaders/Glass/index.d.ts.map +1 -1
  73. package/dist/core/shaders/Glass/index.js +3 -2
  74. package/dist/core/shaders/GlassTiles/index.js +1 -1
  75. package/dist/core/shaders/Glitch/index.js +1 -1
  76. package/dist/core/shaders/Glow/index.d.ts.map +1 -1
  77. package/dist/core/shaders/Glow/index.js +2 -1
  78. package/dist/core/shaders/Godrays/index.js +1 -1
  79. package/dist/core/shaders/Grayscale/index.js +1 -1
  80. package/dist/core/shaders/Grid/index.js +1 -1
  81. package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
  82. package/dist/core/shaders/GridDistortion/index.js +1 -1
  83. package/dist/core/shaders/Group/index.js +1 -1
  84. package/dist/core/shaders/Halftone/index.js +1 -1
  85. package/dist/core/shaders/HexGrid/index.js +1 -1
  86. package/dist/core/shaders/HueShift/index.js +1 -1
  87. package/dist/core/shaders/ImageTexture/index.js +1 -1
  88. package/dist/core/shaders/Invert/index.js +1 -1
  89. package/dist/core/shaders/Kaleidoscope/index.js +1 -1
  90. package/dist/core/shaders/LensFlare/index.js +1 -1
  91. package/dist/core/shaders/LinearBlur/index.js +1 -1
  92. package/dist/core/shaders/LinearGradient/index.js +1 -1
  93. package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
  94. package/dist/core/shaders/Liquify/index.js +1 -1
  95. package/dist/core/shaders/Mirror/index.js +1 -1
  96. package/dist/core/shaders/MultiPointGradient/index.js +1 -1
  97. package/dist/core/shaders/Neon/index.js +2 -2
  98. package/dist/core/shaders/Paper/index.js +1 -1
  99. package/dist/core/shaders/Perspective/index.js +1 -1
  100. package/dist/core/shaders/Pixelate/index.js +1 -1
  101. package/dist/core/shaders/Plasma/index.js +1 -1
  102. package/dist/core/shaders/PolarCoordinates/index.js +1 -1
  103. package/dist/core/shaders/Polygon/index.js +2 -2
  104. package/dist/core/shaders/Posterize/index.js +1 -1
  105. package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
  106. package/dist/core/shaders/ProgressiveBlur/index.js +2 -1
  107. package/dist/core/shaders/RadialGradient/index.js +1 -1
  108. package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
  109. package/dist/core/shaders/Ring/index.js +2 -2
  110. package/dist/core/shaders/Ripples/index.js +1 -1
  111. package/dist/core/shaders/RoundedRect/index.js +2 -2
  112. package/dist/core/shaders/Saturation/index.js +1 -1
  113. package/dist/core/shaders/Sharpness/index.js +1 -1
  114. package/dist/core/shaders/Shatter/index.d.ts.map +1 -1
  115. package/dist/core/shaders/Shatter/index.js +1 -1
  116. package/dist/core/shaders/SimplexNoise/index.js +1 -1
  117. package/dist/core/shaders/SineWave/index.js +1 -1
  118. package/dist/core/shaders/Solarize/index.js +1 -1
  119. package/dist/core/shaders/SolidColor/index.js +1 -1
  120. package/dist/core/shaders/Spherize/index.js +1 -1
  121. package/dist/core/shaders/Spiral/index.js +1 -1
  122. package/dist/core/shaders/Star/index.js +2 -2
  123. package/dist/core/shaders/Strands/index.js +1 -1
  124. package/dist/core/shaders/Stretch/index.js +1 -1
  125. package/dist/core/shaders/Stripes/index.js +1 -1
  126. package/dist/core/shaders/StudioBackground/index.js +1 -1
  127. package/dist/core/shaders/Swirl/index.js +1 -1
  128. package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
  129. package/dist/core/shaders/TiltShift/index.js +2 -1
  130. package/dist/core/shaders/Tint/index.js +1 -1
  131. package/dist/core/shaders/Trapezoid/index.js +2 -2
  132. package/dist/core/shaders/Tritone/index.js +1 -1
  133. package/dist/core/shaders/Truchet/index.js +1 -1
  134. package/dist/core/shaders/Twirl/index.js +1 -1
  135. package/dist/core/shaders/Vesica/index.js +2 -2
  136. package/dist/core/shaders/Vibrance/index.js +1 -1
  137. package/dist/core/shaders/VideoTexture/index.js +2 -2
  138. package/dist/core/shaders/Vignette/index.js +1 -1
  139. package/dist/core/shaders/Voronoi/index.js +1 -1
  140. package/dist/core/shaders/WaveDistortion/index.js +1 -1
  141. package/dist/core/shaders/Weave/index.js +1 -1
  142. package/dist/core/shaders/WebcamTexture/index.js +2 -2
  143. package/dist/core/shaders/ZoomBlur/index.js +1 -1
  144. package/dist/core/types.d.ts +29 -0
  145. package/dist/core/types.d.ts.map +1 -1
  146. package/dist/core/utilities/computeBlur.d.ts +50 -0
  147. package/dist/core/utilities/computeBlur.d.ts.map +1 -0
  148. package/dist/js/createShader.js +1 -1
  149. package/dist/react/Shader.js +1 -1
  150. package/dist/registry.js +2 -2
  151. package/dist/solid/engine/Shader.js +1 -1
  152. package/dist/svelte/index.js +1 -1
  153. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  154. package/package.json +1 -1
  155. package/dist/core/CursorRipples-Bo-3LZoC.js +0 -186
  156. package/dist/core/CursorTrail-C-0lpOV1.js +0 -160
  157. package/dist/core/GridDistortion-DXM5MgSc.js +0 -183
  158. package/dist/core/Liquify-CqcAWBwZ.js +0 -228
  159. package/dist/core/shaderRegistry-BzOzMO4V.js +0 -244
  160. /package/dist/core/{BrightnessContrast-BoR9bi58.js → BrightnessContrast-CJTOpQCn.js} +0 -0
  161. /package/dist/core/{Bulge-DN2R75Hp.js → Bulge-Chpbxxzj.js} +0 -0
  162. /package/dist/core/{CRTScreen-DolQEkb1.js → CRTScreen-CTwXU-NX.js} +0 -0
  163. /package/dist/core/{Checkerboard-_IUtUrDv.js → Checkerboard-ucave4-a.js} +0 -0
  164. /package/dist/core/{ChromaFlow-Cq6hDVjX.js → ChromaFlow-BZXyVHtK.js} +0 -0
  165. /package/dist/core/{ChromaticAberration-G8_bwQtD.js → ChromaticAberration-DsMj-vBw.js} +0 -0
  166. /package/dist/core/{Circle--0oHzoCi.js → Circle-QgCuVo44.js} +0 -0
  167. /package/dist/core/{ConcentricSpin-BzxzMieZ.js → ConcentricSpin-Crfxti93.js} +0 -0
  168. /package/dist/core/{ConicGradient-BXXizzIs.js → ConicGradient-CQAPYlQg.js} +0 -0
  169. /package/dist/core/{ContourLines-C0XSJEkE.js → ContourLines-KTHC32hd.js} +0 -0
  170. /package/dist/core/{DOMTexture-Dw3Qakny.js → DOMTexture-D-RkeyMs.js} +0 -0
  171. /package/dist/core/{DiamondGradient-TsOxHjg_.js → DiamondGradient-BC3ugP8a.js} +0 -0
  172. /package/dist/core/{DiffuseBlur-BqIV4JLM.js → DiffuseBlur-eyM1v3ad.js} +0 -0
  173. /package/dist/core/{Dither-D_YF6z03.js → Dither-CDfDotR6.js} +0 -0
  174. /package/dist/core/{DotGrid-CiDt4NmI.js → DotGrid-T9YbgC3V.js} +0 -0
  175. /package/dist/core/{DropShadow-BRoXryDA.js → DropShadow-jMhnYPXZ.js} +0 -0
  176. /package/dist/core/{Duotone-CGHcHB9f.js → Duotone-Bl02WcA2.js} +0 -0
  177. /package/dist/core/{FallingLines-vdw8KxhV.js → FallingLines-CArEXajJ.js} +0 -0
  178. /package/dist/core/{FilmGrain-BqQeKO6Z.js → FilmGrain-Ph73aoC_.js} +0 -0
  179. /package/dist/core/{FloatingParticles-DR5cv6Eh.js → FloatingParticles-BtwGRl_d.js} +0 -0
  180. /package/dist/core/{FlowField-DpP32B1X.js → FlowField-RyqiRxyI.js} +0 -0
  181. /package/dist/core/{FlowingGradient-lSouJxmq.js → FlowingGradient-C0Zoyfd6.js} +0 -0
  182. /package/dist/core/{Form3D-DQD-0zrd.js → Form3D-rKpxb9t3.js} +0 -0
  183. /package/dist/core/{GlassTiles-B7aAvcTQ.js → GlassTiles-k1C4a4u8.js} +0 -0
  184. /package/dist/core/{Glitch-CgmgjLea.js → Glitch-DzPMkBu4.js} +0 -0
  185. /package/dist/core/{Godrays-o-3Im6H1.js → Godrays-DAYmq-BP.js} +0 -0
  186. /package/dist/core/{Grayscale-Bip62olI.js → Grayscale-lYKBBkGY.js} +0 -0
  187. /package/dist/core/{Grid-hwQnF_hs.js → Grid-BJ-nxN3i.js} +0 -0
  188. /package/dist/core/{Group-BexPm4Fb.js → Group-DpozigtX.js} +0 -0
  189. /package/dist/core/{Halftone-onLYU4dF.js → Halftone-BVL2oy37.js} +0 -0
  190. /package/dist/core/{HexGrid-BkqEEgfh.js → HexGrid-D-EmQ4kI.js} +0 -0
  191. /package/dist/core/{HueShift-BldS-av9.js → HueShift-D9K0ynaS.js} +0 -0
  192. /package/dist/core/{ImageTexture-DLCjc5cM.js → ImageTexture-CArkZMfh.js} +0 -0
  193. /package/dist/core/{Invert-C2LI5GXr.js → Invert-DCnwo_Xq.js} +0 -0
  194. /package/dist/core/{Kaleidoscope-CxWjs5jx.js → Kaleidoscope-BytHro3k.js} +0 -0
  195. /package/dist/core/{LensFlare-BNO7tCXH.js → LensFlare-B0vv4x97.js} +0 -0
  196. /package/dist/core/{LinearBlur-Ds6rm8u-.js → LinearBlur-BFewxPjV.js} +0 -0
  197. /package/dist/core/{LinearGradient-BZjDhnZp.js → LinearGradient-BKUf_u7r.js} +0 -0
  198. /package/dist/core/{Mirror-5W3sul9v.js → Mirror-DIle92J8.js} +0 -0
  199. /package/dist/core/{MultiPointGradient-lpUGnrLq.js → MultiPointGradient-DDwac_mm.js} +0 -0
  200. /package/dist/core/{Paper-14yYPnWW.js → Paper-bMSMCeYK.js} +0 -0
  201. /package/dist/core/{Perspective-POVbIGPc.js → Perspective-BmfvQV6W.js} +0 -0
  202. /package/dist/core/{Pixelate-CxUxBDeN.js → Pixelate-Dl26r6IT.js} +0 -0
  203. /package/dist/core/{Plasma-DM9TU0VN.js → Plasma-CJWS1TvX.js} +0 -0
  204. /package/dist/core/{PolarCoordinates-t4Wa00gQ.js → PolarCoordinates-lq6K4WBm.js} +0 -0
  205. /package/dist/core/{Posterize-Dk4DE8Ee.js → Posterize-BjH7Zscm.js} +0 -0
  206. /package/dist/core/{RadialGradient-CSXQIa5L.js → RadialGradient-DiGFPgrn.js} +0 -0
  207. /package/dist/core/{RectangularCoordinates-YaZ_uRXb.js → RectangularCoordinates-COkNDxi0.js} +0 -0
  208. /package/dist/core/{Ripples-wJx2FwJY.js → Ripples-C8Q17Hvz.js} +0 -0
  209. /package/dist/core/{Saturation-B500nPZH.js → Saturation-CgDaiq6n.js} +0 -0
  210. /package/dist/core/{Sharpness-NqY4_gKZ.js → Sharpness-CRXT0D30.js} +0 -0
  211. /package/dist/core/{SimplexNoise-2-J7EbY9.js → SimplexNoise-KfTCAfpL.js} +0 -0
  212. /package/dist/core/{SineWave-OWJVWsI1.js → SineWave-Ckeap_YM.js} +0 -0
  213. /package/dist/core/{Solarize-CEhQxL9Z.js → Solarize-DhtQYYpW.js} +0 -0
  214. /package/dist/core/{SolidColor-Dlzm61ZG.js → SolidColor-6yUkGybH.js} +0 -0
  215. /package/dist/core/{Spherize-CXf4_Mkm.js → Spherize-8LXrGGG_.js} +0 -0
  216. /package/dist/core/{Spiral-CSXNX92f.js → Spiral-Bs7uZrBr.js} +0 -0
  217. /package/dist/core/{Strands-BPVy1zbt.js → Strands-DsAAVemq.js} +0 -0
  218. /package/dist/core/{Stretch-CFAjfvny.js → Stretch-D7P2R5lV.js} +0 -0
  219. /package/dist/core/{Stripes-BSGzno-I.js → Stripes-DF8agIiJ.js} +0 -0
  220. /package/dist/core/{StudioBackground-81AihXcZ.js → StudioBackground-BFeNfwEu.js} +0 -0
  221. /package/dist/core/{Swirl-D_ZvZtDS.js → Swirl-BwezrSAA.js} +0 -0
  222. /package/dist/core/{Tint-C6xN-Qot.js → Tint-BdXlqlzz.js} +0 -0
  223. /package/dist/core/{Tritone-Dk8GcpYo.js → Tritone-BlJ7cchN.js} +0 -0
  224. /package/dist/core/{Truchet-BFd2XYD3.js → Truchet-Bnn0fwbF.js} +0 -0
  225. /package/dist/core/{Twirl-CA0r8U7e.js → Twirl-C5ijhqz1.js} +0 -0
  226. /package/dist/core/{Vibrance-Dq1jBFJb.js → Vibrance-dqIV6GBe.js} +0 -0
  227. /package/dist/core/{Vignette-DB8x78Up.js → Vignette-DB1wO1dm.js} +0 -0
  228. /package/dist/core/{Voronoi-ALXxxHBo.js → Voronoi-C3WIJFWc.js} +0 -0
  229. /package/dist/core/{WaveDistortion-CHb75HO3.js → WaveDistortion-BKma8-Ju.js} +0 -0
  230. /package/dist/core/{Weave-j4CrCig4.js → Weave-xuu_vQ5e.js} +0 -0
  231. /package/dist/core/{ZoomBlur-Cl75kL8E.js → ZoomBlur-UcS2iFT2.js} +0 -0
  232. /package/dist/core/{browser-DIoaEnIX.js → browser-ClWxLlIB.js} +0 -0
  233. /package/dist/core/{sdf-Bux00UoZ.js → sdf-DyC2H_qS.js} +0 -0
@@ -41,7 +41,7 @@ async function createShader(canvas, preset, options) {
41
41
  if (isExternalUser()) {
42
42
  const checkRendering = () => {
43
43
  if (renderer.getPerformanceStats().fps > 0) {
44
- telemetryCollector = startTelemetry(renderer, "2.5.94", options?.disableTelemetry || false, false);
44
+ telemetryCollector = startTelemetry(renderer, "2.5.95", options?.disableTelemetry || false, false);
45
45
  if (telemetryCollector) telemetryCollector.start();
46
46
  telemetryStartTimeout = null;
47
47
  } else telemetryStartTimeout = setTimeout(checkRendering, 500);
@@ -89,7 +89,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
89
89
  return;
90
90
  }
91
91
  if (rendererRef.current.getPerformanceStats().fps > 0) {
92
- telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.94", disableTelemetry, isPreview);
92
+ telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.95", disableTelemetry, isPreview);
93
93
  if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
94
94
  telemetryStartTimeoutRef.current = null;
95
95
  } else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
package/dist/registry.js CHANGED
@@ -1512,7 +1512,7 @@ export const shaderRegistry = [
1512
1512
  "map"
1513
1513
  ],
1514
1514
  "min": 0,
1515
- "max": 100,
1515
+ "max": 200,
1516
1516
  "step": 1,
1517
1517
  "label": "Intensity",
1518
1518
  "group": "Effect"
@@ -1528,7 +1528,7 @@ export const shaderRegistry = [
1528
1528
  "map"
1529
1529
  ],
1530
1530
  "min": 0,
1531
- "max": 100,
1531
+ "max": 200,
1532
1532
  "step": 1,
1533
1533
  "label": "Intensity",
1534
1534
  "group": "Effect"
@@ -67,7 +67,7 @@ function Shader(allProps) {
67
67
  const checkRendering = () => {
68
68
  const stats = rendererInstance.getPerformanceStats();
69
69
  if (stats.fps > 0) {
70
- const version = "2.5.94";
70
+ const version = "2.5.95";
71
71
  telemetryCollector = startTelemetry(rendererInstance, version, props.disableTelemetry, props.isPreview);
72
72
  if (telemetryCollector) {
73
73
  telemetryCollector.start();
@@ -20546,7 +20546,7 @@ function Shader($$anchor, $$props) {
20546
20546
  const checkRendering = () => {
20547
20547
  if (!rendererInstance) return;
20548
20548
  if (rendererInstance.getPerformanceStats().fps > 0) {
20549
- telemetryCollector = startTelemetry(rendererInstance, "2.5.94", disableTelemetry(), isPreview());
20549
+ telemetryCollector = startTelemetry(rendererInstance, "2.5.95", disableTelemetry(), isPreview());
20550
20550
  if (telemetryCollector) telemetryCollector.start();
20551
20551
  telemetryStartTimeout = null;
20552
20552
  } else telemetryStartTimeout = window.setTimeout(checkRendering, 500);
@@ -60,7 +60,7 @@ var Shader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
60
60
  const startTelemetryWhenReady = () => {
61
61
  const checkRendering = () => {
62
62
  if (rendererInstance.value.getPerformanceStats().fps > 0) {
63
- telemetryCollector = startTelemetry(rendererInstance.value, "2.5.94", props.disableTelemetry, props.isPreview);
63
+ telemetryCollector = startTelemetry(rendererInstance.value, "2.5.95", props.disableTelemetry, props.isPreview);
64
64
  if (telemetryCollector) telemetryCollector.start();
65
65
  telemetryStartTimeout = null;
66
66
  } else telemetryStartTimeout = setTimeout(checkRendering, 500);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shaders",
3
- "version": "2.5.94",
3
+ "version": "2.5.95",
4
4
  "description": "Shader magic for modern frontends",
5
5
  "author": "Shader Effects Inc.",
6
6
  "homepage": "https://shaders.com/",
@@ -1,186 +0,0 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
2
- import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
- import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
- import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
5
- import { convertToTexture, float, screenUV, texture, vec2, vec4 } from "three/tsl";
6
- var GRID_SIZE = 128;
7
- const componentDefinition = {
8
- name: "CursorRipples",
9
- category: "Interactive",
10
- description: "Fluid-like ripple distortion",
11
- requiresRTT: true,
12
- requiresChild: true,
13
- props: {
14
- intensity: {
15
- default: 10,
16
- description: "Strength of the ripple distortion",
17
- ui: {
18
- type: ["range", "map"],
19
- min: 0,
20
- max: 20,
21
- step: .1,
22
- label: "Intensity",
23
- group: "Effect"
24
- }
25
- },
26
- decay: {
27
- default: 10,
28
- description: "How quickly ripples fade (higher = faster)",
29
- ui: {
30
- type: "range",
31
- min: 0,
32
- max: 20,
33
- step: .1,
34
- label: "Decay",
35
- group: "Effect"
36
- }
37
- },
38
- radius: {
39
- default: .5,
40
- description: "Radius of cursor influence",
41
- ui: {
42
- type: "range",
43
- min: .1,
44
- max: 1,
45
- step: .1,
46
- label: "Radius",
47
- group: "Effect"
48
- }
49
- },
50
- chromaticSplit: {
51
- default: 1,
52
- description: "RGB channel separation along ripple edges",
53
- ui: {
54
- type: ["range", "map"],
55
- min: 0,
56
- max: 3,
57
- step: .1,
58
- label: "Chromatic Split",
59
- group: "Effect"
60
- }
61
- },
62
- edges: {
63
- default: "stretch",
64
- description: "How to handle edges when distortion pushes content out of bounds",
65
- transform: transformEdges,
66
- compileTime: true,
67
- ui: {
68
- type: "select",
69
- options: [
70
- {
71
- label: "Stretch",
72
- value: "stretch"
73
- },
74
- {
75
- label: "Transparent",
76
- value: "transparent"
77
- },
78
- {
79
- label: "Mirror",
80
- value: "mirror"
81
- },
82
- {
83
- label: "Wrap",
84
- value: "wrap"
85
- }
86
- ],
87
- label: "Edges",
88
- group: "Effect"
89
- }
90
- }
91
- },
92
- fragmentNode: ({ uniforms, onBeforeRender, childNode, onCleanup, dimensions }) => {
93
- const buffers = [new Float32Array(GRID_SIZE * GRID_SIZE), new Float32Array(GRID_SIZE * GRID_SIZE)];
94
- let currentBuffer = 0;
95
- const displacementData = new Float32Array(GRID_SIZE * GRID_SIZE * 2);
96
- const displacementTexture = new DataTexture(displacementData, GRID_SIZE, GRID_SIZE, RGFormat, FloatType);
97
- displacementTexture.magFilter = LinearFilter;
98
- displacementTexture.minFilter = LinearFilter;
99
- displacementTexture.needsUpdate = true;
100
- const displacementField = texture(displacementTexture);
101
- let prevX = .5;
102
- let prevY = .5;
103
- let lastTime = Date.now();
104
- let prevMaxAbsVal = 1;
105
- onBeforeRender(({ pointer }) => {
106
- const currentTime = Date.now();
107
- const dt = Math.min((currentTime - lastTime) / 1e3, .016);
108
- lastTime = currentTime;
109
- const aspect = dimensions.width / dimensions.height;
110
- const substeps = 1;
111
- const decay = uniforms.decay.uniform.value;
112
- const radius = uniforms.radius.uniform.value * .05;
113
- const rawVelX = dt > 0 ? (pointer.x - prevX) / dt : 0;
114
- const rawVelY = dt > 0 ? (pointer.y - prevY) / dt : 0;
115
- const mouseSpeed = Math.min(Math.sqrt(rawVelX * rawVelX + rawVelY * rawVelY), 2);
116
- prevX = pointer.x;
117
- prevY = pointer.y;
118
- if (mouseSpeed <= .01 && prevMaxAbsVal < 1e-6) return;
119
- const dampFactor = 1 - decay * .004;
120
- let maxAbsVal = 0;
121
- for (let s = 0; s < substeps; s++) {
122
- const curr$1 = buffers[currentBuffer];
123
- const prev = buffers[1 - currentBuffer];
124
- if (s === 0 && mouseSpeed > .01) {
125
- const influenceRadius = radius * 3;
126
- const minJ = Math.max(1, Math.floor((pointer.x - influenceRadius) * GRID_SIZE));
127
- const maxJ = Math.min(GRID_SIZE - 2, Math.ceil((pointer.x + influenceRadius) * GRID_SIZE));
128
- const minI = Math.max(1, Math.floor((pointer.y - influenceRadius) * GRID_SIZE));
129
- const maxI = Math.min(GRID_SIZE - 2, Math.ceil((pointer.y + influenceRadius) * GRID_SIZE));
130
- for (let i = minI; i <= maxI; i++) for (let j = minJ; j <= maxJ; j++) {
131
- const idx = i * GRID_SIZE + j;
132
- const cellX = (j + .5) / GRID_SIZE;
133
- const cellY = (i + .5) / GRID_SIZE;
134
- const ddx = aspect >= 1 ? (cellX - pointer.x) * aspect : cellX - pointer.x;
135
- const ddy = aspect >= 1 ? cellY - pointer.y : (cellY - pointer.y) / aspect;
136
- const dist = Math.sqrt(ddx * ddx + ddy * ddy);
137
- if (dist < influenceRadius) {
138
- const influence = Math.exp(-dist * dist / (radius * radius));
139
- curr$1[idx] -= influence * mouseSpeed * dt * 3;
140
- }
141
- }
142
- }
143
- for (let i = 1; i < GRID_SIZE - 1; i++) for (let j = 1; j < GRID_SIZE - 1; j++) {
144
- const idx = i * GRID_SIZE + j;
145
- const next = ((curr$1[idx - 1] + curr$1[idx + 1] + curr$1[idx - GRID_SIZE] + curr$1[idx + GRID_SIZE]) * .5 - prev[idx]) * dampFactor;
146
- prev[idx] = next;
147
- const absNext = next < 0 ? -next : next;
148
- if (absNext > maxAbsVal) maxAbsVal = absNext;
149
- }
150
- currentBuffer = 1 - currentBuffer;
151
- }
152
- prevMaxAbsVal = maxAbsVal;
153
- const curr = buffers[currentBuffer];
154
- for (let i = 1; i < GRID_SIZE - 1; i++) for (let j = 1; j < GRID_SIZE - 1; j++) {
155
- const idx = i * GRID_SIZE + j;
156
- const dIdx = idx * 2;
157
- displacementData[dIdx] = (curr[idx + 1] - curr[idx - 1]) * .5;
158
- displacementData[dIdx + 1] = (curr[idx + GRID_SIZE] - curr[idx - GRID_SIZE]) * .5;
159
- }
160
- displacementTexture.needsUpdate = true;
161
- });
162
- onCleanup(() => {
163
- displacementTexture.dispose();
164
- });
165
- if (!childNode) return vec4(0, 0, 0, 0);
166
- const childTexture = convertToTexture(childNode);
167
- onCleanup(() => {
168
- if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
169
- });
170
- const displacement = displacementField.sample(screenUV).xy;
171
- const intensityScale = uniforms.intensity.uniform.mul(.1);
172
- const scaledDisplacement = displacement.mul(intensityScale);
173
- const maxDisp = float(.15);
174
- const clampedDisplacement = scaledDisplacement.clamp(vec2(maxDisp.negate(), maxDisp.negate()), vec2(maxDisp, maxDisp));
175
- const chromaticScale = uniforms.chromaticSplit.uniform.mul(.1);
176
- const rUV = screenUV.sub(clampedDisplacement.mul(float(1).add(chromaticScale)));
177
- const gUV = screenUV.sub(clampedDisplacement);
178
- const bUV = screenUV.sub(clampedDisplacement.mul(float(1).sub(chromaticScale)));
179
- const rSample = applyEdgeHandling(rUV, childTexture.sample(rUV), childTexture, uniforms.edges.uniform.value);
180
- const gSample = applyEdgeHandling(gUV, childTexture.sample(gUV), childTexture, uniforms.edges.uniform.value);
181
- const bSample = applyEdgeHandling(bUV, childTexture.sample(bUV), childTexture, uniforms.edges.uniform.value);
182
- return unpremultiplyAlpha(vec4(rSample.r, gSample.g, bSample.b, gSample.a));
183
- }
184
- };
185
- var CursorRipples_default = componentDefinition;
186
- export { componentDefinition as n, CursorRipples_default as t };
@@ -1,160 +0,0 @@
1
- import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-B5lM6fYX.js";
2
- import { t as mixColors } from "./colorMixing-BPpDnR5I.js";
3
- import { DataTexture, FloatType, LinearFilter, RGBAFormat } from "three";
4
- import { float, screenUV, step, texture, vec2, vec4 } from "three/tsl";
5
- const componentDefinition = {
6
- name: "CursorTrail",
7
- category: "Interactive",
8
- description: "Animated trail effect that tracks cursor movement",
9
- props: {
10
- colorA: {
11
- default: "#00aaff",
12
- transform: transformColor,
13
- description: "Color of fresh trails",
14
- ui: {
15
- type: "color",
16
- label: "Start Color",
17
- group: "Colors"
18
- }
19
- },
20
- colorB: {
21
- default: "#ff00aa",
22
- transform: transformColor,
23
- description: "Color trails transition to as they fade",
24
- ui: {
25
- type: "color",
26
- label: "End Color",
27
- group: "Colors"
28
- }
29
- },
30
- radius: {
31
- default: .5,
32
- description: "Base radius of trail circles",
33
- ui: {
34
- type: "range",
35
- min: .5,
36
- max: 2,
37
- step: .1,
38
- label: "Radius",
39
- group: "Effect"
40
- }
41
- },
42
- length: {
43
- default: .5,
44
- description: "How long trail circles persist (in seconds)",
45
- ui: {
46
- type: "range",
47
- min: .1,
48
- max: 2,
49
- step: .1,
50
- label: "Trail Length",
51
- group: "Animation"
52
- }
53
- },
54
- shrink: {
55
- default: 1,
56
- description: "How much circles shrink as they fade out (0 = no shrink, 1 = full shrink)",
57
- ui: {
58
- type: "range",
59
- min: 0,
60
- max: 1,
61
- step: .1,
62
- label: "Shrink Amount",
63
- group: "Effect"
64
- }
65
- },
66
- colorSpace: {
67
- default: "linear",
68
- transform: transformColorSpace,
69
- compileTime: true,
70
- description: "Color space for color interpolation",
71
- ui: {
72
- type: "select",
73
- options: colorSpaceOptions,
74
- label: "Color Space",
75
- group: "Colors"
76
- }
77
- }
78
- },
79
- fragmentNode: ({ uniforms, onBeforeRender, onCleanup, dimensions }) => {
80
- const GRID_SIZE = 128;
81
- const trailData = new Float32Array(GRID_SIZE * GRID_SIZE * 4);
82
- const trailTexture = new DataTexture(trailData, GRID_SIZE, GRID_SIZE, RGBAFormat, FloatType);
83
- trailTexture.magFilter = LinearFilter;
84
- trailTexture.minFilter = LinearFilter;
85
- trailTexture.needsUpdate = true;
86
- const trailField = texture(trailTexture);
87
- let prevX = .5;
88
- let prevY = .5;
89
- let lastTime = Date.now();
90
- onBeforeRender(({ pointer }) => {
91
- const currentTime = Date.now();
92
- const dt = Math.min((currentTime - lastTime) / 1e3, .016);
93
- lastTime = currentTime;
94
- const aspect = dimensions.width / dimensions.height;
95
- const radius = uniforms.radius.uniform.value * .1;
96
- const length$1 = uniforms.length.uniform.value;
97
- const shrink = uniforms.shrink.uniform.value;
98
- const dx = pointer.x - prevX;
99
- const dy = pointer.y - prevY;
100
- const speed = Math.sqrt(dx * dx + dy * dy);
101
- const fadeRate = 1 - dt / Math.max(.1, length$1);
102
- const ageRate = dt / Math.max(.1, length$1);
103
- for (let i = 0; i < GRID_SIZE * GRID_SIZE * 4; i += 4) {
104
- trailData[i] *= fadeRate;
105
- trailData[i + 1] = 1 - (1 - trailData[i]) * shrink;
106
- trailData[i + 2] = Math.min(1, trailData[i + 2] + ageRate);
107
- }
108
- if (speed > .001) {
109
- const influenceRadius = radius * 3;
110
- const stepSize = Math.max(.005, radius * .5);
111
- const numSteps = Math.min(20, Math.max(1, Math.ceil(speed / stepSize)));
112
- const amountPerStep = speed / numSteps * 50 * dt;
113
- for (let s = 0; s < numSteps; s++) {
114
- const t = (s + .5) / numSteps;
115
- const px = prevX + dx * t;
116
- const py = prevY + dy * t;
117
- const minJ = Math.max(0, Math.floor((px - influenceRadius) * GRID_SIZE));
118
- const maxJ = Math.min(GRID_SIZE - 1, Math.ceil((px + influenceRadius) * GRID_SIZE));
119
- const minI = Math.max(0, Math.floor((py - influenceRadius) * GRID_SIZE));
120
- const maxI = Math.min(GRID_SIZE - 1, Math.ceil((py + influenceRadius) * GRID_SIZE));
121
- for (let i = minI; i <= maxI; i++) for (let j = minJ; j <= maxJ; j++) {
122
- const idx = (i * GRID_SIZE + j) * 4;
123
- const cellX = (j + .5) / GRID_SIZE;
124
- const cellY = (i + .5) / GRID_SIZE;
125
- const cellDx = aspect >= 1 ? (cellX - px) * aspect : cellX - px;
126
- const cellDy = aspect >= 1 ? cellY - py : (cellY - py) / aspect;
127
- const dist = Math.sqrt(cellDx * cellDx + cellDy * cellDy);
128
- if (dist < influenceRadius) {
129
- const influence = Math.exp(-dist * dist / (radius * radius));
130
- trailData[idx] = Math.min(1, trailData[idx] + influence * amountPerStep);
131
- trailData[idx + 1] = 1;
132
- trailData[idx + 2] = 0;
133
- }
134
- }
135
- }
136
- }
137
- trailTexture.needsUpdate = true;
138
- prevX = pointer.x;
139
- prevY = pointer.y;
140
- });
141
- onCleanup(() => {
142
- trailTexture.dispose();
143
- });
144
- const pixelSize = float(1 / GRID_SIZE);
145
- const centerSample = trailField.sample(screenUV);
146
- const sample1 = trailField.sample(screenUV.add(vec2(pixelSize, float(0))));
147
- const sample2 = trailField.sample(screenUV.add(vec2(float(0), pixelSize)));
148
- const sample3 = trailField.sample(screenUV.add(vec2(pixelSize.negate(), float(0))));
149
- const sample4 = trailField.sample(screenUV.add(vec2(float(0), pixelSize.negate())));
150
- const trailIntensity = centerSample.x.mul(float(.5)).add(sample1.x.mul(float(.125))).add(sample2.x.mul(float(.125))).add(sample3.x.mul(float(.125))).add(sample4.x.mul(float(.125)));
151
- const trailAge = centerSample.z.mul(float(.5)).add(sample1.z.mul(float(.125))).add(sample2.z.mul(float(.125))).add(sample3.z.mul(float(.125))).add(sample4.z.mul(float(.125)));
152
- const circleMask = step(float(.01), trailIntensity);
153
- const colorA = uniforms.colorA.uniform;
154
- const colorB = uniforms.colorB.uniform;
155
- const trailColor = mixColors(colorA, colorB, trailAge, uniforms.colorSpace.uniform.value);
156
- return vec4(trailColor.rgb, trailColor.a.mul(circleMask));
157
- }
158
- };
159
- var CursorTrail_default = componentDefinition;
160
- export { componentDefinition as n, CursorTrail_default as t };
@@ -1,183 +0,0 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
2
- import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
- import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
- import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
5
- import { convertToTexture, float, screenUV, texture, uniform, vec2, vec4, viewportSize } from "three/tsl";
6
- var DEFAULT_GRID_SIZE = 20;
7
- var displacementStateCache = /* @__PURE__ */ new WeakMap();
8
- var getOrCreateDisplacementState = (uniforms) => {
9
- let state = displacementStateCache.get(uniforms);
10
- const gridSize = uniforms?.gridSize?.uniform?.value ? Math.max(8, Math.min(128, Math.floor(uniforms.gridSize.uniform.value))) : DEFAULT_GRID_SIZE;
11
- if (state && state.gridSize !== gridSize) {
12
- state.dataTexture.dispose();
13
- state = void 0;
14
- displacementStateCache.delete(uniforms);
15
- }
16
- if (!state) {
17
- const data = new Float32Array(gridSize * gridSize * 2);
18
- const dataTexture = new DataTexture(data, gridSize, gridSize, RGFormat, FloatType);
19
- dataTexture.magFilter = LinearFilter;
20
- dataTexture.minFilter = LinearFilter;
21
- dataTexture.needsUpdate = true;
22
- state = {
23
- dataTexture,
24
- data,
25
- tslNode: texture(dataTexture),
26
- gridSize
27
- };
28
- displacementStateCache.set(uniforms, state);
29
- }
30
- return state;
31
- };
32
- const componentDefinition = {
33
- name: "GridDistortion",
34
- category: "Interactive",
35
- description: "Interactive grid distortion controlled by mouse position",
36
- requiresRTT: true,
37
- requiresChild: true,
38
- props: {
39
- intensity: {
40
- default: 1,
41
- description: "Strength of the distortion effect",
42
- ui: {
43
- type: "range",
44
- min: 0,
45
- max: 5,
46
- step: .1,
47
- label: "Intensity",
48
- group: "Effect"
49
- }
50
- },
51
- decay: {
52
- default: 3,
53
- description: "Rate of distortion decay (higher = faster)",
54
- ui: {
55
- type: "range",
56
- min: 0,
57
- max: 10,
58
- step: .1,
59
- label: "Decay",
60
- group: "Effect"
61
- }
62
- },
63
- radius: {
64
- default: 1,
65
- description: "Radius of the distortion effect",
66
- ui: {
67
- type: "range",
68
- min: 0,
69
- max: 3,
70
- step: .1,
71
- label: "Radius",
72
- group: "Effect"
73
- }
74
- },
75
- gridSize: {
76
- default: 20,
77
- description: "Resolution of the distortion grid (higher = more detailed)",
78
- ui: {
79
- type: ["range", "map"],
80
- min: 8,
81
- max: 128,
82
- step: 1,
83
- label: "Grid Size",
84
- group: "Effect"
85
- }
86
- },
87
- edges: {
88
- default: "stretch",
89
- description: "How to handle edges when distortion pushes content out of bounds",
90
- transform: transformEdges,
91
- compileTime: true,
92
- ui: {
93
- type: "select",
94
- options: [
95
- {
96
- label: "Stretch",
97
- value: "stretch"
98
- },
99
- {
100
- label: "Transparent",
101
- value: "transparent"
102
- },
103
- {
104
- label: "Mirror",
105
- value: "mirror"
106
- },
107
- {
108
- label: "Wrap",
109
- value: "wrap"
110
- }
111
- ],
112
- label: "Edges",
113
- group: "Effect"
114
- }
115
- }
116
- },
117
- fragmentNode: ({ uniforms, onBeforeRender, childNode, onCleanup, dimensions }) => {
118
- const { dataTexture: displacementTexture, data: displacementData, tslNode: displacementField, gridSize: GRID_SIZE } = getOrCreateDisplacementState(uniforms);
119
- const mouseVelX = uniform(0);
120
- const mouseVelY = uniform(0);
121
- let prevX = .5;
122
- let prevY = .5;
123
- let lastTime = Date.now();
124
- onBeforeRender(({ pointer }) => {
125
- const currentTime = Date.now();
126
- const dt = Math.min((currentTime - lastTime) / 1e3, .016);
127
- lastTime = currentTime;
128
- const aspect$1 = Math.max(1, dimensions.width) / Math.max(1, dimensions.height);
129
- const velX = dt > 0 ? (pointer.x - prevX) / dt : 0;
130
- const velY = dt > 0 ? (pointer.y - prevY) / dt : 0;
131
- mouseVelX.value = mouseVelX.value * .85 + velX * .15;
132
- mouseVelY.value = mouseVelY.value * .85 + velY * .15;
133
- const decay = uniforms.decay.uniform.value;
134
- const intensity = uniforms.intensity.uniform.value;
135
- const radius = uniforms.radius.uniform.value * .05;
136
- for (let i = 0; i < GRID_SIZE; i++) for (let j = 0; j < GRID_SIZE; j++) {
137
- const idx = (i * GRID_SIZE + j) * 2;
138
- displacementData[idx] *= 1 - decay * dt;
139
- displacementData[idx + 1] *= 1 - decay * dt;
140
- const cellX = (j + .5) / GRID_SIZE;
141
- const cellY = (i + .5) / GRID_SIZE;
142
- const dx = aspect$1 >= 1 ? (cellX - pointer.x) * aspect$1 : cellX - pointer.x;
143
- const dy = aspect$1 >= 1 ? cellY - pointer.y : (cellY - pointer.y) / aspect$1;
144
- const dist = Math.sqrt(dx * dx + dy * dy);
145
- if (dist < radius * 2 && Math.abs(velX) + Math.abs(velY) > .01) {
146
- const influence = Math.exp(-dist * dist / (radius * radius));
147
- displacementData[idx] += mouseVelX.value * influence * intensity * dt * .5;
148
- displacementData[idx + 1] += mouseVelY.value * influence * intensity * dt * .5;
149
- }
150
- displacementData[idx] = Math.max(-1, Math.min(1, displacementData[idx]));
151
- displacementData[idx + 1] = Math.max(-1, Math.min(1, displacementData[idx + 1]));
152
- }
153
- displacementTexture.needsUpdate = true;
154
- prevX = pointer.x;
155
- prevY = pointer.y;
156
- });
157
- onCleanup(() => {
158
- displacementTexture.dispose();
159
- displacementStateCache.delete(uniforms);
160
- });
161
- if (!childNode) return vec4(0, 0, 0, 0);
162
- const childTexture = convertToTexture(childNode);
163
- onCleanup(() => {
164
- if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
165
- });
166
- const aspect = viewportSize.x.div(viewportSize.y);
167
- const gridSizeUniform = uniforms.gridSize.uniform;
168
- const isWide = aspect.greaterThan(float(1));
169
- const cellsX = isWide.select(gridSizeUniform, gridSizeUniform.mul(aspect)).max(float(1));
170
- const cellsY = isWide.select(gridSizeUniform.div(aspect), gridSizeUniform).max(float(1));
171
- const cellIndexX = screenUV.x.mul(cellsX).floor();
172
- const cellIndexY = screenUV.y.mul(cellsY).floor();
173
- const gridCellUV = vec2(cellIndexX.add(.5).div(cellsX), cellIndexY.add(.5).div(cellsY));
174
- const displacement = displacementField.sample(gridCellUV).xy;
175
- const maxDisplacement = float(.1);
176
- const negMaxDisplacement = float(-.1);
177
- const clampedDisplacement = displacement.clamp(vec2(negMaxDisplacement, negMaxDisplacement), vec2(maxDisplacement, maxDisplacement));
178
- const distortedUV = screenUV.sub(clampedDisplacement);
179
- return unpremultiplyAlpha(applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform.value));
180
- }
181
- };
182
- var GridDistortion_default = componentDefinition;
183
- export { componentDefinition as n, GridDistortion_default as t };