shaders 2.5.94 → 2.5.96

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 (237) hide show
  1. package/dist/core/Blur-CXXttTb1.js +138 -0
  2. package/dist/core/{ChannelBlur-CCaPXjka.js → ChannelBlur-gzP71FWd.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-DDBKYclp.js} +46 -8
  12. package/dist/core/Glow-BwaPYDRZ.js +174 -0
  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-B8xwWyTM.js +236 -0
  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-CI3FlfYk.js +252 -0
  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-C3oX720H.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 +213 -128
  31. package/dist/core/registry.js +102 -101
  32. package/dist/core/renderer.d.ts +19 -1
  33. package/dist/core/renderer.d.ts.map +1 -1
  34. package/dist/core/shaderRegistry-B_84rvO8.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 +49 -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/Blur-DTyNQt1R.js +0 -78
  156. package/dist/core/CursorRipples-Bo-3LZoC.js +0 -186
  157. package/dist/core/CursorTrail-C-0lpOV1.js +0 -160
  158. package/dist/core/Glow-CKWIRcBt.js +0 -108
  159. package/dist/core/GridDistortion-DXM5MgSc.js +0 -183
  160. package/dist/core/Liquify-CqcAWBwZ.js +0 -228
  161. package/dist/core/ProgressiveBlur-BcHBSVDo.js +0 -128
  162. package/dist/core/TiltShift-BysRsV8v.js +0 -141
  163. package/dist/core/shaderRegistry-BzOzMO4V.js +0 -244
  164. /package/dist/core/{BrightnessContrast-BoR9bi58.js → BrightnessContrast-CJTOpQCn.js} +0 -0
  165. /package/dist/core/{Bulge-DN2R75Hp.js → Bulge-Chpbxxzj.js} +0 -0
  166. /package/dist/core/{CRTScreen-DolQEkb1.js → CRTScreen-CTwXU-NX.js} +0 -0
  167. /package/dist/core/{Checkerboard-_IUtUrDv.js → Checkerboard-ucave4-a.js} +0 -0
  168. /package/dist/core/{ChromaFlow-Cq6hDVjX.js → ChromaFlow-BZXyVHtK.js} +0 -0
  169. /package/dist/core/{ChromaticAberration-G8_bwQtD.js → ChromaticAberration-DsMj-vBw.js} +0 -0
  170. /package/dist/core/{Circle--0oHzoCi.js → Circle-QgCuVo44.js} +0 -0
  171. /package/dist/core/{ConcentricSpin-BzxzMieZ.js → ConcentricSpin-Crfxti93.js} +0 -0
  172. /package/dist/core/{ConicGradient-BXXizzIs.js → ConicGradient-CQAPYlQg.js} +0 -0
  173. /package/dist/core/{ContourLines-C0XSJEkE.js → ContourLines-KTHC32hd.js} +0 -0
  174. /package/dist/core/{DOMTexture-Dw3Qakny.js → DOMTexture-D-RkeyMs.js} +0 -0
  175. /package/dist/core/{DiamondGradient-TsOxHjg_.js → DiamondGradient-BC3ugP8a.js} +0 -0
  176. /package/dist/core/{DiffuseBlur-BqIV4JLM.js → DiffuseBlur-eyM1v3ad.js} +0 -0
  177. /package/dist/core/{Dither-D_YF6z03.js → Dither-CDfDotR6.js} +0 -0
  178. /package/dist/core/{DotGrid-CiDt4NmI.js → DotGrid-T9YbgC3V.js} +0 -0
  179. /package/dist/core/{DropShadow-BRoXryDA.js → DropShadow-jMhnYPXZ.js} +0 -0
  180. /package/dist/core/{Duotone-CGHcHB9f.js → Duotone-Bl02WcA2.js} +0 -0
  181. /package/dist/core/{FallingLines-vdw8KxhV.js → FallingLines-CArEXajJ.js} +0 -0
  182. /package/dist/core/{FilmGrain-BqQeKO6Z.js → FilmGrain-Ph73aoC_.js} +0 -0
  183. /package/dist/core/{FloatingParticles-DR5cv6Eh.js → FloatingParticles-BtwGRl_d.js} +0 -0
  184. /package/dist/core/{FlowField-DpP32B1X.js → FlowField-RyqiRxyI.js} +0 -0
  185. /package/dist/core/{FlowingGradient-lSouJxmq.js → FlowingGradient-C0Zoyfd6.js} +0 -0
  186. /package/dist/core/{Form3D-DQD-0zrd.js → Form3D-rKpxb9t3.js} +0 -0
  187. /package/dist/core/{GlassTiles-B7aAvcTQ.js → GlassTiles-k1C4a4u8.js} +0 -0
  188. /package/dist/core/{Glitch-CgmgjLea.js → Glitch-DzPMkBu4.js} +0 -0
  189. /package/dist/core/{Godrays-o-3Im6H1.js → Godrays-DAYmq-BP.js} +0 -0
  190. /package/dist/core/{Grayscale-Bip62olI.js → Grayscale-lYKBBkGY.js} +0 -0
  191. /package/dist/core/{Grid-hwQnF_hs.js → Grid-BJ-nxN3i.js} +0 -0
  192. /package/dist/core/{Group-BexPm4Fb.js → Group-DpozigtX.js} +0 -0
  193. /package/dist/core/{Halftone-onLYU4dF.js → Halftone-BVL2oy37.js} +0 -0
  194. /package/dist/core/{HexGrid-BkqEEgfh.js → HexGrid-D-EmQ4kI.js} +0 -0
  195. /package/dist/core/{HueShift-BldS-av9.js → HueShift-D9K0ynaS.js} +0 -0
  196. /package/dist/core/{ImageTexture-DLCjc5cM.js → ImageTexture-CArkZMfh.js} +0 -0
  197. /package/dist/core/{Invert-C2LI5GXr.js → Invert-DCnwo_Xq.js} +0 -0
  198. /package/dist/core/{Kaleidoscope-CxWjs5jx.js → Kaleidoscope-BytHro3k.js} +0 -0
  199. /package/dist/core/{LensFlare-BNO7tCXH.js → LensFlare-B0vv4x97.js} +0 -0
  200. /package/dist/core/{LinearBlur-Ds6rm8u-.js → LinearBlur-BFewxPjV.js} +0 -0
  201. /package/dist/core/{LinearGradient-BZjDhnZp.js → LinearGradient-BKUf_u7r.js} +0 -0
  202. /package/dist/core/{Mirror-5W3sul9v.js → Mirror-DIle92J8.js} +0 -0
  203. /package/dist/core/{MultiPointGradient-lpUGnrLq.js → MultiPointGradient-DDwac_mm.js} +0 -0
  204. /package/dist/core/{Paper-14yYPnWW.js → Paper-bMSMCeYK.js} +0 -0
  205. /package/dist/core/{Perspective-POVbIGPc.js → Perspective-BmfvQV6W.js} +0 -0
  206. /package/dist/core/{Pixelate-CxUxBDeN.js → Pixelate-Dl26r6IT.js} +0 -0
  207. /package/dist/core/{Plasma-DM9TU0VN.js → Plasma-CJWS1TvX.js} +0 -0
  208. /package/dist/core/{PolarCoordinates-t4Wa00gQ.js → PolarCoordinates-lq6K4WBm.js} +0 -0
  209. /package/dist/core/{Posterize-Dk4DE8Ee.js → Posterize-BjH7Zscm.js} +0 -0
  210. /package/dist/core/{RadialGradient-CSXQIa5L.js → RadialGradient-DiGFPgrn.js} +0 -0
  211. /package/dist/core/{RectangularCoordinates-YaZ_uRXb.js → RectangularCoordinates-COkNDxi0.js} +0 -0
  212. /package/dist/core/{Ripples-wJx2FwJY.js → Ripples-C8Q17Hvz.js} +0 -0
  213. /package/dist/core/{Saturation-B500nPZH.js → Saturation-CgDaiq6n.js} +0 -0
  214. /package/dist/core/{Sharpness-NqY4_gKZ.js → Sharpness-CRXT0D30.js} +0 -0
  215. /package/dist/core/{SimplexNoise-2-J7EbY9.js → SimplexNoise-KfTCAfpL.js} +0 -0
  216. /package/dist/core/{SineWave-OWJVWsI1.js → SineWave-Ckeap_YM.js} +0 -0
  217. /package/dist/core/{Solarize-CEhQxL9Z.js → Solarize-DhtQYYpW.js} +0 -0
  218. /package/dist/core/{SolidColor-Dlzm61ZG.js → SolidColor-6yUkGybH.js} +0 -0
  219. /package/dist/core/{Spherize-CXf4_Mkm.js → Spherize-8LXrGGG_.js} +0 -0
  220. /package/dist/core/{Spiral-CSXNX92f.js → Spiral-Bs7uZrBr.js} +0 -0
  221. /package/dist/core/{Strands-BPVy1zbt.js → Strands-DsAAVemq.js} +0 -0
  222. /package/dist/core/{Stretch-CFAjfvny.js → Stretch-D7P2R5lV.js} +0 -0
  223. /package/dist/core/{Stripes-BSGzno-I.js → Stripes-DF8agIiJ.js} +0 -0
  224. /package/dist/core/{StudioBackground-81AihXcZ.js → StudioBackground-BFeNfwEu.js} +0 -0
  225. /package/dist/core/{Swirl-D_ZvZtDS.js → Swirl-BwezrSAA.js} +0 -0
  226. /package/dist/core/{Tint-C6xN-Qot.js → Tint-BdXlqlzz.js} +0 -0
  227. /package/dist/core/{Tritone-Dk8GcpYo.js → Tritone-BlJ7cchN.js} +0 -0
  228. /package/dist/core/{Truchet-BFd2XYD3.js → Truchet-Bnn0fwbF.js} +0 -0
  229. /package/dist/core/{Twirl-CA0r8U7e.js → Twirl-C5ijhqz1.js} +0 -0
  230. /package/dist/core/{Vibrance-Dq1jBFJb.js → Vibrance-dqIV6GBe.js} +0 -0
  231. /package/dist/core/{Vignette-DB8x78Up.js → Vignette-DB1wO1dm.js} +0 -0
  232. /package/dist/core/{Voronoi-ALXxxHBo.js → Voronoi-C3WIJFWc.js} +0 -0
  233. /package/dist/core/{WaveDistortion-CHb75HO3.js → WaveDistortion-BKma8-Ju.js} +0 -0
  234. /package/dist/core/{Weave-j4CrCig4.js → Weave-xuu_vQ5e.js} +0 -0
  235. /package/dist/core/{ZoomBlur-Cl75kL8E.js → ZoomBlur-UcS2iFT2.js} +0 -0
  236. /package/dist/core/{browser-DIoaEnIX.js → browser-ClWxLlIB.js} +0 -0
  237. /package/dist/core/{sdf-Bux00UoZ.js → sdf-DyC2H_qS.js} +0 -0
@@ -1,128 +0,0 @@
1
- import { l as transformPosition, r as transformAngle } from "./transformations-B5lM6fYX.js";
2
- import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
3
- import { Fn, convertToTexture, cos, float, max, radians, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
4
- const componentDefinition = {
5
- name: "ProgressiveBlur",
6
- category: "Blurs",
7
- description: "Blur that increases progressively in one direction",
8
- requiresRTT: true,
9
- requiresChild: true,
10
- props: {
11
- intensity: {
12
- default: 50,
13
- description: "Maximum intensity of the blur effect",
14
- ui: {
15
- type: ["range", "map"],
16
- min: 0,
17
- max: 100,
18
- step: 1,
19
- label: "Intensity",
20
- group: "Effect"
21
- }
22
- },
23
- angle: {
24
- default: 0,
25
- transform: transformAngle,
26
- description: "Direction of the blur gradient (in degrees)",
27
- ui: {
28
- type: ["range", "map"],
29
- min: 0,
30
- max: 360,
31
- step: 1,
32
- label: "Angle",
33
- group: "Effect"
34
- }
35
- },
36
- center: {
37
- default: {
38
- x: 0,
39
- y: .5
40
- },
41
- transform: transformPosition,
42
- description: "Center point where blur begins",
43
- ui: {
44
- type: "position",
45
- label: "Center",
46
- group: "Position"
47
- }
48
- },
49
- falloff: {
50
- default: 1,
51
- description: "Distance over which blur transitions to full strength",
52
- ui: {
53
- type: ["range", "map"],
54
- min: 0,
55
- max: 1,
56
- step: .1,
57
- label: "Falloff",
58
- group: "Effect"
59
- }
60
- }
61
- },
62
- fragmentNode: ({ uniforms, childNode, onCleanup }) => {
63
- if (!childNode) return vec4(0, 0, 0, 0);
64
- const childTexture = convertToTexture(childNode);
65
- onCleanup(() => {
66
- if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
67
- });
68
- const aspect = viewportSize.x.div(viewportSize.y);
69
- const angleRad = radians(uniforms.angle.uniform);
70
- const cosAngle = cos(angleRad);
71
- const sinAngle = sin(angleRad);
72
- const direction = vec2(cosAngle.div(aspect), sinAngle);
73
- const centerPosition = vec2(uniforms.center.uniform[0], uniforms.center.uniform[1].oneMinus());
74
- const centeredUV = screenUV.sub(centerPosition);
75
- const directionalDist = max(float(0), centeredUV.dot(direction));
76
- const falloff = max(float(.001), uniforms.falloff.uniform);
77
- const blurAmount = smoothstep(float(0), falloff, directionalDist);
78
- const scaledIntensity = uniforms.intensity.uniform.mul(.06);
79
- const blurRadius = blurAmount.mul(scaledIntensity);
80
- const weights = [
81
- .056,
82
- .135,
83
- .278,
84
- .487,
85
- .726,
86
- .923,
87
- 1,
88
- .923,
89
- .726,
90
- .487,
91
- .278,
92
- .135,
93
- .056
94
- ];
95
- const weightSum = 6.214;
96
- const horizontalTexture = convertToTexture(Fn(() => {
97
- const uv$1 = screenUV;
98
- const pixelSize = vec2(1).div(viewportSize);
99
- const total = vec4(0).toVar();
100
- for (let x = -6; x <= 6; x++) {
101
- const weight = float(weights[x + 6] / weightSum);
102
- const offset = vec2(float(x), float(0)).mul(blurRadius).mul(pixelSize);
103
- const sampleCoord = uv$1.add(offset);
104
- const sample = childTexture.sample(sampleCoord).mul(weight);
105
- total.assign(total.add(sample));
106
- }
107
- return total;
108
- })());
109
- onCleanup(() => {
110
- if (horizontalTexture?.renderTarget?.dispose) horizontalTexture.renderTarget.dispose();
111
- });
112
- return Fn(() => {
113
- const uv$1 = screenUV;
114
- const pixelSize = vec2(1).div(viewportSize);
115
- const total = vec4(0).toVar();
116
- for (let y = -6; y <= 6; y++) {
117
- const weight = float(weights[y + 6] / weightSum);
118
- const offset = vec2(float(0), float(y)).mul(blurRadius).mul(pixelSize);
119
- const sampleCoord = uv$1.add(offset);
120
- const sample = horizontalTexture.sample(sampleCoord).mul(weight);
121
- total.assign(total.add(sample));
122
- }
123
- return unpremultiplyAlpha(total);
124
- })();
125
- }
126
- };
127
- var ProgressiveBlur_default = componentDefinition;
128
- export { componentDefinition as n, ProgressiveBlur_default as t };
@@ -1,141 +0,0 @@
1
- import { l as transformPosition, r as transformAngle } from "./transformations-B5lM6fYX.js";
2
- import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
3
- import { Fn, abs, convertToTexture, cos, dot, float, mix, radians, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
4
- const componentDefinition = {
5
- name: "TiltShift",
6
- category: "Blurs",
7
- description: "Selective focus blur mimicking tilt-shift photography",
8
- requiresRTT: true,
9
- requiresChild: true,
10
- props: {
11
- intensity: {
12
- default: 50,
13
- description: "Maximum blur intensity at edges",
14
- ui: {
15
- type: ["range", "map"],
16
- min: 0,
17
- max: 100,
18
- step: 1,
19
- label: "Intensity",
20
- group: "Effect"
21
- }
22
- },
23
- width: {
24
- default: .3,
25
- description: "Width of the sharp focus area",
26
- ui: {
27
- type: ["range", "map"],
28
- min: 0,
29
- max: 1,
30
- step: .1,
31
- label: "Width",
32
- group: "Effect"
33
- }
34
- },
35
- falloff: {
36
- default: .3,
37
- description: "Distance over which blur transitions to full strength",
38
- ui: {
39
- type: ["range", "map"],
40
- min: 0,
41
- max: 1,
42
- step: .1,
43
- label: "Falloff",
44
- group: "Effect"
45
- }
46
- },
47
- angle: {
48
- default: 0,
49
- transform: transformAngle,
50
- description: "Rotation angle of the focus line (in degrees)",
51
- ui: {
52
- type: ["range", "map"],
53
- min: 0,
54
- max: 360,
55
- step: 1,
56
- label: "Angle",
57
- group: "Effect"
58
- }
59
- },
60
- center: {
61
- default: {
62
- x: .5,
63
- y: .5
64
- },
65
- transform: transformPosition,
66
- description: "Center point of the focus line",
67
- ui: {
68
- type: "position",
69
- label: "Center",
70
- group: "Position"
71
- }
72
- }
73
- },
74
- fragmentNode: ({ uniforms, childNode, onCleanup }) => {
75
- if (!childNode) return vec4(0, 0, 0, 0);
76
- const childTexture = convertToTexture(childNode);
77
- onCleanup(() => {
78
- if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
79
- });
80
- const aspect = viewportSize.x.div(viewportSize.y);
81
- const angleRad = radians(uniforms.angle.uniform);
82
- const cosAngle = cos(angleRad);
83
- const perpVector = vec2(sin(angleRad).negate(), cosAngle);
84
- const centerPosition = vec2(uniforms.center.uniform[0], uniforms.center.uniform[1].oneMinus());
85
- const centeredUV = screenUV.sub(centerPosition);
86
- const distFromLine = abs(dot(vec2(centeredUV.x.mul(aspect), centeredUV.y), perpVector));
87
- const focusWidth = uniforms.width.uniform.mul(.5);
88
- const falloff = uniforms.falloff.uniform;
89
- const blurAmount = smoothstep(focusWidth, focusWidth.add(falloff), distFromLine);
90
- const scaledIntensity = uniforms.intensity.uniform.mul(.06);
91
- const blurRadius = blurAmount.mul(scaledIntensity);
92
- const weights = [
93
- .056,
94
- .135,
95
- .278,
96
- .487,
97
- .726,
98
- .923,
99
- 1,
100
- .923,
101
- .726,
102
- .487,
103
- .278,
104
- .135,
105
- .056
106
- ];
107
- const weightSum = 6.21;
108
- const horizontalTexture = convertToTexture(Fn(() => {
109
- const uv$1 = screenUV;
110
- const pixelSize = vec2(1).div(viewportSize);
111
- const total = vec4(0).toVar();
112
- for (let x = -6; x <= 6; x++) {
113
- const weight = float(weights[x + 6] / weightSum);
114
- const offset = vec2(float(x), float(0)).mul(blurRadius).mul(pixelSize);
115
- const sampleCoord = uv$1.add(offset);
116
- const sample = childTexture.sample(sampleCoord).mul(weight);
117
- total.assign(total.add(sample));
118
- }
119
- return total;
120
- })());
121
- onCleanup(() => {
122
- if (horizontalTexture?.renderTarget?.dispose) horizontalTexture.renderTarget.dispose();
123
- });
124
- return Fn(() => {
125
- const uv$1 = screenUV;
126
- const pixelSize = vec2(1).div(viewportSize);
127
- const total = vec4(0).toVar();
128
- for (let y = -6; y <= 6; y++) {
129
- const weight = float(weights[y + 6] / weightSum);
130
- const offset = vec2(float(0), float(y)).mul(blurRadius).mul(pixelSize);
131
- const sampleCoord = uv$1.add(offset);
132
- const sample = horizontalTexture.sample(sampleCoord).mul(weight);
133
- total.assign(total.add(sample));
134
- }
135
- const blurred = total;
136
- return unpremultiplyAlpha(mix(childTexture.sample(uv$1), blurred, blurAmount));
137
- })();
138
- }
139
- };
140
- var TiltShift_default = componentDefinition;
141
- export { componentDefinition as n, TiltShift_default as t };
@@ -1,244 +0,0 @@
1
- import { n as componentDefinition } from "./AngularBlur-BgZWbEjj.js";
2
- import { n as componentDefinition$1 } from "./Ascii-BwSMmD6Z.js";
3
- import { n as componentDefinition$2 } from "./Aurora-BPHeGEZ_.js";
4
- import { n as componentDefinition$3 } from "./Beam-CAnoOWgt.js";
5
- import { n as componentDefinition$4 } from "./Blob-CuRSRXmA.js";
6
- import { n as componentDefinition$5 } from "./Blur-DTyNQt1R.js";
7
- import { n as componentDefinition$6 } from "./BrightnessContrast-BoR9bi58.js";
8
- import { n as componentDefinition$7 } from "./Bulge-DN2R75Hp.js";
9
- import { n as componentDefinition$8 } from "./ChannelBlur-CCaPXjka.js";
10
- import { n as componentDefinition$9 } from "./Checkerboard-_IUtUrDv.js";
11
- import { n as componentDefinition$10 } from "./ChromaFlow-Cq6hDVjX.js";
12
- import { n as componentDefinition$11 } from "./ChromaticAberration-G8_bwQtD.js";
13
- import { n as componentDefinition$12 } from "./Circle--0oHzoCi.js";
14
- import { n as componentDefinition$13 } from "./ConcentricSpin-BzxzMieZ.js";
15
- import { n as componentDefinition$14 } from "./ConicGradient-BXXizzIs.js";
16
- import { n as componentDefinition$15 } from "./ContourLines-C0XSJEkE.js";
17
- import { n as componentDefinition$16 } from "./Crescent-DPxGWdPH.js";
18
- import { n as componentDefinition$17 } from "./Cross-CDyzf8TT.js";
19
- import { n as componentDefinition$18 } from "./CRTScreen-DolQEkb1.js";
20
- import { n as componentDefinition$19 } from "./Crystal-DSuN8TNY.js";
21
- import { n as componentDefinition$20 } from "./CursorRipples-Bo-3LZoC.js";
22
- import { n as componentDefinition$21 } from "./CursorTrail-C-0lpOV1.js";
23
- import { n as componentDefinition$22 } from "./DiamondGradient-TsOxHjg_.js";
24
- import { n as componentDefinition$23 } from "./DiffuseBlur-BqIV4JLM.js";
25
- import { n as componentDefinition$24 } from "./Dither-D_YF6z03.js";
26
- import { n as componentDefinition$25 } from "./DOMTexture-Dw3Qakny.js";
27
- import { n as componentDefinition$26 } from "./DotGrid-CiDt4NmI.js";
28
- import { n as componentDefinition$27 } from "./DropShadow-BRoXryDA.js";
29
- import { n as componentDefinition$28 } from "./Duotone-CGHcHB9f.js";
30
- import { n as componentDefinition$29 } from "./Ellipse-BNmzdnpK.js";
31
- import { n as componentDefinition$30 } from "./Emboss-nrduRrVs.js";
32
- import { n as componentDefinition$31 } from "./FallingLines-vdw8KxhV.js";
33
- import { n as componentDefinition$32 } from "./FilmGrain-BqQeKO6Z.js";
34
- import { n as componentDefinition$33 } from "./FloatingParticles-DR5cv6Eh.js";
35
- import { n as componentDefinition$34 } from "./Flower-B4xPp0Qa.js";
36
- import { n as componentDefinition$35 } from "./FlowField-DpP32B1X.js";
37
- import { n as componentDefinition$36 } from "./FlowingGradient-lSouJxmq.js";
38
- import { n as componentDefinition$37 } from "./Form3D-DQD-0zrd.js";
39
- import { n as componentDefinition$38 } from "./Glass-CRfTkmRy.js";
40
- import { n as componentDefinition$39 } from "./GlassTiles-B7aAvcTQ.js";
41
- import { n as componentDefinition$40 } from "./Glitch-CgmgjLea.js";
42
- import { n as componentDefinition$41 } from "./Glow-CKWIRcBt.js";
43
- import { n as componentDefinition$42 } from "./Godrays-o-3Im6H1.js";
44
- import { n as componentDefinition$43 } from "./Grayscale-Bip62olI.js";
45
- import { n as componentDefinition$44 } from "./Grid-hwQnF_hs.js";
46
- import { n as componentDefinition$45 } from "./GridDistortion-DXM5MgSc.js";
47
- import { n as componentDefinition$46 } from "./Group-BexPm4Fb.js";
48
- import { n as componentDefinition$47 } from "./Halftone-onLYU4dF.js";
49
- import { n as componentDefinition$48 } from "./HexGrid-BkqEEgfh.js";
50
- import { n as componentDefinition$49 } from "./HueShift-BldS-av9.js";
51
- import { n as componentDefinition$50 } from "./ImageTexture-DLCjc5cM.js";
52
- import { n as componentDefinition$51 } from "./Invert-C2LI5GXr.js";
53
- import { n as componentDefinition$52 } from "./Kaleidoscope-CxWjs5jx.js";
54
- import { n as componentDefinition$53 } from "./LensFlare-BNO7tCXH.js";
55
- import { n as componentDefinition$54 } from "./LinearBlur-Ds6rm8u-.js";
56
- import { n as componentDefinition$55 } from "./LinearGradient-BZjDhnZp.js";
57
- import { n as componentDefinition$56 } from "./Liquify-CqcAWBwZ.js";
58
- import { n as componentDefinition$57 } from "./Mirror-5W3sul9v.js";
59
- import { n as componentDefinition$58 } from "./MultiPointGradient-lpUGnrLq.js";
60
- import { n as componentDefinition$59 } from "./Neon-CUKnkAK8.js";
61
- import { n as componentDefinition$60 } from "./Paper-14yYPnWW.js";
62
- import { n as componentDefinition$61 } from "./Perspective-POVbIGPc.js";
63
- import { n as componentDefinition$62 } from "./Pixelate-CxUxBDeN.js";
64
- import { n as componentDefinition$63 } from "./Plasma-DM9TU0VN.js";
65
- import { n as componentDefinition$64 } from "./PolarCoordinates-t4Wa00gQ.js";
66
- import { n as componentDefinition$65 } from "./Polygon-C1y6Nyh4.js";
67
- import { n as componentDefinition$66 } from "./Posterize-Dk4DE8Ee.js";
68
- import { n as componentDefinition$67 } from "./ProgressiveBlur-BcHBSVDo.js";
69
- import { n as componentDefinition$68 } from "./RadialGradient-CSXQIa5L.js";
70
- import { n as componentDefinition$69 } from "./RectangularCoordinates-YaZ_uRXb.js";
71
- import { n as componentDefinition$70 } from "./Ring-Chj1tp_P.js";
72
- import { n as componentDefinition$71 } from "./Ripples-wJx2FwJY.js";
73
- import { n as componentDefinition$72 } from "./RoundedRect-BEj6tE1e.js";
74
- import { n as componentDefinition$73 } from "./Saturation-B500nPZH.js";
75
- import { n as componentDefinition$74 } from "./Sharpness-NqY4_gKZ.js";
76
- import { n as componentDefinition$75 } from "./Shatter-CZMOHj60.js";
77
- import { n as componentDefinition$76 } from "./SimplexNoise-2-J7EbY9.js";
78
- import { n as componentDefinition$77 } from "./SineWave-OWJVWsI1.js";
79
- import { n as componentDefinition$78 } from "./Solarize-CEhQxL9Z.js";
80
- import { n as componentDefinition$79 } from "./SolidColor-Dlzm61ZG.js";
81
- import { n as componentDefinition$80 } from "./Spherize-CXf4_Mkm.js";
82
- import { n as componentDefinition$81 } from "./Spiral-CSXNX92f.js";
83
- import { n as componentDefinition$82 } from "./Star-fPw1j10r.js";
84
- import { n as componentDefinition$83 } from "./Strands-BPVy1zbt.js";
85
- import { n as componentDefinition$84 } from "./Stretch-CFAjfvny.js";
86
- import { n as componentDefinition$85 } from "./Stripes-BSGzno-I.js";
87
- import { n as componentDefinition$86 } from "./StudioBackground-81AihXcZ.js";
88
- import { n as componentDefinition$87 } from "./Swirl-D_ZvZtDS.js";
89
- import { n as componentDefinition$88 } from "./TiltShift-BysRsV8v.js";
90
- import { n as componentDefinition$89 } from "./Tint-C6xN-Qot.js";
91
- import { n as componentDefinition$90 } from "./Trapezoid-Cr61vRvN.js";
92
- import { n as componentDefinition$91 } from "./Tritone-Dk8GcpYo.js";
93
- import { n as componentDefinition$92 } from "./Truchet-BFd2XYD3.js";
94
- import { n as componentDefinition$93 } from "./Twirl-CA0r8U7e.js";
95
- import { n as componentDefinition$94 } from "./Vesica-AXTA8DJU.js";
96
- import { n as componentDefinition$95 } from "./Vibrance-Dq1jBFJb.js";
97
- import { n as componentDefinition$96 } from "./VideoTexture-BobyGZGr.js";
98
- import { n as componentDefinition$97 } from "./Vignette-DB8x78Up.js";
99
- import { n as componentDefinition$98 } from "./Voronoi-ALXxxHBo.js";
100
- import { n as componentDefinition$99 } from "./WaveDistortion-CHb75HO3.js";
101
- import { n as componentDefinition$100 } from "./Weave-j4CrCig4.js";
102
- import { n as componentDefinition$101 } from "./WebcamTexture-BXj7sqND.js";
103
- import { n as componentDefinition$102 } from "./ZoomBlur-Cl75kL8E.js";
104
- var createShaderRegistry = () => {
105
- const registry = {};
106
- const shaderDefinitions = {
107
- AngularBlur: componentDefinition,
108
- Ascii: componentDefinition$1,
109
- Aurora: componentDefinition$2,
110
- Beam: componentDefinition$3,
111
- Blob: componentDefinition$4,
112
- Blur: componentDefinition$5,
113
- BrightnessContrast: componentDefinition$6,
114
- Bulge: componentDefinition$7,
115
- ChannelBlur: componentDefinition$8,
116
- Checkerboard: componentDefinition$9,
117
- ChromaFlow: componentDefinition$10,
118
- ChromaticAberration: componentDefinition$11,
119
- Circle: componentDefinition$12,
120
- ConcentricSpin: componentDefinition$13,
121
- ConicGradient: componentDefinition$14,
122
- ContourLines: componentDefinition$15,
123
- Crescent: componentDefinition$16,
124
- Cross: componentDefinition$17,
125
- CRTScreen: componentDefinition$18,
126
- Crystal: componentDefinition$19,
127
- CursorRipples: componentDefinition$20,
128
- CursorTrail: componentDefinition$21,
129
- DiamondGradient: componentDefinition$22,
130
- DiffuseBlur: componentDefinition$23,
131
- Dither: componentDefinition$24,
132
- DOMTexture: componentDefinition$25,
133
- DotGrid: componentDefinition$26,
134
- DropShadow: componentDefinition$27,
135
- Duotone: componentDefinition$28,
136
- Ellipse: componentDefinition$29,
137
- Emboss: componentDefinition$30,
138
- FallingLines: componentDefinition$31,
139
- FilmGrain: componentDefinition$32,
140
- FloatingParticles: componentDefinition$33,
141
- Flower: componentDefinition$34,
142
- FlowField: componentDefinition$35,
143
- FlowingGradient: componentDefinition$36,
144
- Form3D: componentDefinition$37,
145
- Glass: componentDefinition$38,
146
- GlassTiles: componentDefinition$39,
147
- Glitch: componentDefinition$40,
148
- Glow: componentDefinition$41,
149
- Godrays: componentDefinition$42,
150
- Grayscale: componentDefinition$43,
151
- Grid: componentDefinition$44,
152
- GridDistortion: componentDefinition$45,
153
- Group: componentDefinition$46,
154
- Halftone: componentDefinition$47,
155
- HexGrid: componentDefinition$48,
156
- HueShift: componentDefinition$49,
157
- ImageTexture: componentDefinition$50,
158
- Invert: componentDefinition$51,
159
- Kaleidoscope: componentDefinition$52,
160
- LensFlare: componentDefinition$53,
161
- LinearBlur: componentDefinition$54,
162
- LinearGradient: componentDefinition$55,
163
- Liquify: componentDefinition$56,
164
- Mirror: componentDefinition$57,
165
- MultiPointGradient: componentDefinition$58,
166
- Neon: componentDefinition$59,
167
- Paper: componentDefinition$60,
168
- Perspective: componentDefinition$61,
169
- Pixelate: componentDefinition$62,
170
- Plasma: componentDefinition$63,
171
- PolarCoordinates: componentDefinition$64,
172
- Polygon: componentDefinition$65,
173
- Posterize: componentDefinition$66,
174
- ProgressiveBlur: componentDefinition$67,
175
- RadialGradient: componentDefinition$68,
176
- RectangularCoordinates: componentDefinition$69,
177
- Ring: componentDefinition$70,
178
- Ripples: componentDefinition$71,
179
- RoundedRect: componentDefinition$72,
180
- Saturation: componentDefinition$73,
181
- Sharpness: componentDefinition$74,
182
- Shatter: componentDefinition$75,
183
- SimplexNoise: componentDefinition$76,
184
- SineWave: componentDefinition$77,
185
- Solarize: componentDefinition$78,
186
- SolidColor: componentDefinition$79,
187
- Spherize: componentDefinition$80,
188
- Spiral: componentDefinition$81,
189
- Star: componentDefinition$82,
190
- Strands: componentDefinition$83,
191
- Stretch: componentDefinition$84,
192
- Stripes: componentDefinition$85,
193
- StudioBackground: componentDefinition$86,
194
- Swirl: componentDefinition$87,
195
- TiltShift: componentDefinition$88,
196
- Tint: componentDefinition$89,
197
- Trapezoid: componentDefinition$90,
198
- Tritone: componentDefinition$91,
199
- Truchet: componentDefinition$92,
200
- Twirl: componentDefinition$93,
201
- Vesica: componentDefinition$94,
202
- Vibrance: componentDefinition$95,
203
- VideoTexture: componentDefinition$96,
204
- Vignette: componentDefinition$97,
205
- Voronoi: componentDefinition$98,
206
- WaveDistortion: componentDefinition$99,
207
- Weave: componentDefinition$100,
208
- WebcamTexture: componentDefinition$101,
209
- ZoomBlur: componentDefinition$102
210
- };
211
- Object.entries(shaderDefinitions).forEach(([fileName, def]) => {
212
- const propsMetadata = {};
213
- if (def.props) Object.entries(def.props).forEach(([propName, propConfig]) => {
214
- if (propConfig.ui) propsMetadata[propName] = {
215
- ui: propConfig.ui,
216
- default: propConfig.default,
217
- description: propConfig.description
218
- };
219
- });
220
- registry[def.name] = {
221
- name: def.name,
222
- fileName,
223
- category: def.category || "Uncategorized",
224
- definition: def,
225
- propsMetadata
226
- };
227
- });
228
- return registry;
229
- };
230
- const shaderRegistry = createShaderRegistry();
231
- function getAllShaders() {
232
- return Object.values(shaderRegistry);
233
- }
234
- function getShaderByName(name) {
235
- return shaderRegistry[name];
236
- }
237
- function getShadersByCategory(category) {
238
- return Object.values(shaderRegistry).filter((shader) => shader.category === category);
239
- }
240
- function getShaderCategories() {
241
- const categories = new Set(Object.values(shaderRegistry).map((shader) => shader.category));
242
- return Array.from(categories).sort();
243
- }
244
- export { shaderRegistry as a, getShadersByCategory as i, getShaderByName as n, getShaderCategories as r, getAllShaders as t };