shaders 2.5.110 → 2.5.111

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 (207) hide show
  1. package/dist/core/{Bulge-Chpbxxzj.js → Bulge-6gRUYqZS.js} +1 -1
  2. package/dist/core/{ConcentricSpin-Crfxti93.js → ConcentricSpin-Fegtvhl6.js} +1 -1
  3. package/dist/core/{CursorRipples-D-cfjHY5.js → CursorRipples-BqtHgpEq.js} +1 -1
  4. package/dist/core/{DiffuseBlur-eyM1v3ad.js → DiffuseBlur-B-Vki4ab.js} +1 -1
  5. package/dist/core/{FlowField-RyqiRxyI.js → FlowField-CTWyjeXm.js} +1 -1
  6. package/dist/core/FlutedGlass-B4FlyBOn.js +320 -0
  7. package/dist/core/{GridDistortion-SRyevgsp.js → GridDistortion-CVpebl48.js} +1 -1
  8. package/dist/core/{Kaleidoscope-CFWtKisp.js → Kaleidoscope-B0_OCrob.js} +1 -1
  9. package/dist/core/{Liquify-p-_qcb1f.js → Liquify-ZMAyGUIb.js} +1 -1
  10. package/dist/core/{Mirror-B7XmfGdw.js → Mirror-Gb0fugtF.js} +1 -1
  11. package/dist/core/{Perspective-BN_OpTZq.js → Perspective-SBZzprC5.js} +1 -1
  12. package/dist/core/{PolarCoordinates-CMYCFT4S.js → PolarCoordinates-Ckvb1eG0.js} +1 -1
  13. package/dist/core/{RectangularCoordinates-8Sa2GaDy.js → RectangularCoordinates-r0fTwVuL.js} +1 -1
  14. package/dist/core/{Shatter-ByKkCYTR.js → Shatter-CC3EFcP9.js} +1 -1
  15. package/dist/core/{Stretch--GV6hbru.js → Stretch-CJUUU-I1.js} +1 -1
  16. package/dist/core/{Twirl-v8pLqUTN.js → Twirl-CgRyZdT1.js} +1 -1
  17. package/dist/core/{VideoTexture-BMSdfLf_.js → VideoTexture-Cr1f0IOE.js} +1 -1
  18. package/dist/core/{WaveDistortion-BGdgj3Iz.js → WaveDistortion-iyTUI1lj.js} +1 -1
  19. package/dist/core/{WebcamTexture-Ds9IrtRn.js → WebcamTexture-BQJpZvC5.js} +1 -1
  20. package/dist/core/{edges-CfGcQniB.js → edges-CX_lJB9R.js} +13 -1
  21. package/dist/core/index.js +79 -78
  22. package/dist/core/registry.js +79 -78
  23. package/dist/core/shaderRegistry-SmtG2mTo.js +254 -0
  24. package/dist/core/shaderRegistry.d.ts.map +1 -1
  25. package/dist/core/shaders/Bulge/index.js +2 -2
  26. package/dist/core/shaders/ConcentricSpin/index.js +2 -2
  27. package/dist/core/shaders/CursorRipples/index.js +2 -2
  28. package/dist/core/shaders/DiffuseBlur/index.js +2 -2
  29. package/dist/core/shaders/FlowField/index.js +2 -2
  30. package/dist/core/shaders/FlutedGlass/index.d.ts +97 -0
  31. package/dist/core/shaders/FlutedGlass/index.d.ts.map +1 -0
  32. package/dist/core/shaders/FlutedGlass/index.js +6 -0
  33. package/dist/core/shaders/Fog/index.js +1 -1
  34. package/dist/core/shaders/Form3D/index.js +1 -1
  35. package/dist/core/shaders/Glass/index.js +1 -1
  36. package/dist/core/shaders/GlassTiles/index.js +1 -1
  37. package/dist/core/shaders/Glitch/index.js +1 -1
  38. package/dist/core/shaders/Glow/index.js +1 -1
  39. package/dist/core/shaders/Godrays/index.js +1 -1
  40. package/dist/core/shaders/Grayscale/index.js +1 -1
  41. package/dist/core/shaders/Grid/index.js +1 -1
  42. package/dist/core/shaders/GridDistortion/index.js +2 -2
  43. package/dist/core/shaders/Group/index.js +1 -1
  44. package/dist/core/shaders/Halftone/index.js +1 -1
  45. package/dist/core/shaders/HexGrid/index.js +1 -1
  46. package/dist/core/shaders/HueShift/index.js +1 -1
  47. package/dist/core/shaders/ImageTexture/index.js +1 -1
  48. package/dist/core/shaders/Invert/index.js +1 -1
  49. package/dist/core/shaders/Kaleidoscope/index.js +2 -2
  50. package/dist/core/shaders/LensFlare/index.js +1 -1
  51. package/dist/core/shaders/LinearBlur/index.js +1 -1
  52. package/dist/core/shaders/LinearGradient/index.js +1 -1
  53. package/dist/core/shaders/Liquify/index.js +2 -2
  54. package/dist/core/shaders/Mirror/index.js +2 -2
  55. package/dist/core/shaders/MultiPointGradient/index.js +1 -1
  56. package/dist/core/shaders/Neon/index.js +1 -1
  57. package/dist/core/shaders/Paper/index.js +1 -1
  58. package/dist/core/shaders/Perspective/index.js +2 -2
  59. package/dist/core/shaders/Pixelate/index.js +1 -1
  60. package/dist/core/shaders/Plasma/index.js +1 -1
  61. package/dist/core/shaders/PolarCoordinates/index.js +2 -2
  62. package/dist/core/shaders/Polygon/index.js +1 -1
  63. package/dist/core/shaders/Posterize/index.js +1 -1
  64. package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
  65. package/dist/core/shaders/RadialGradient/index.js +1 -1
  66. package/dist/core/shaders/RectangularCoordinates/index.js +2 -2
  67. package/dist/core/shaders/Ring/index.js +1 -1
  68. package/dist/core/shaders/Ripples/index.js +1 -1
  69. package/dist/core/shaders/RoundedRect/index.js +1 -1
  70. package/dist/core/shaders/Saturation/index.js +1 -1
  71. package/dist/core/shaders/Sharpness/index.js +1 -1
  72. package/dist/core/shaders/Shatter/index.js +2 -2
  73. package/dist/core/shaders/SimplexNoise/index.js +1 -1
  74. package/dist/core/shaders/SineWave/index.js +1 -1
  75. package/dist/core/shaders/Smoke/index.js +1 -1
  76. package/dist/core/shaders/SmokeFill/index.js +1 -1
  77. package/dist/core/shaders/Solarize/index.js +1 -1
  78. package/dist/core/shaders/SolidColor/index.js +1 -1
  79. package/dist/core/shaders/Spherize/index.js +1 -1
  80. package/dist/core/shaders/Spiral/index.js +1 -1
  81. package/dist/core/shaders/Star/index.js +1 -1
  82. package/dist/core/shaders/Strands/index.js +1 -1
  83. package/dist/core/shaders/Stretch/index.js +2 -2
  84. package/dist/core/shaders/Stripes/index.js +1 -1
  85. package/dist/core/shaders/StudioBackground/index.js +1 -1
  86. package/dist/core/shaders/Swirl/index.js +1 -1
  87. package/dist/core/shaders/TiltShift/index.js +1 -1
  88. package/dist/core/shaders/Tint/index.js +1 -1
  89. package/dist/core/shaders/Trapezoid/index.js +1 -1
  90. package/dist/core/shaders/Tritone/index.js +1 -1
  91. package/dist/core/shaders/Truchet/index.js +1 -1
  92. package/dist/core/shaders/Twirl/index.js +2 -2
  93. package/dist/core/shaders/VHS/index.js +1 -1
  94. package/dist/core/shaders/Vesica/index.js +1 -1
  95. package/dist/core/shaders/Vibrance/index.js +1 -1
  96. package/dist/core/shaders/VideoTexture/index.js +2 -2
  97. package/dist/core/shaders/Vignette/index.js +1 -1
  98. package/dist/core/shaders/Voronoi/index.js +1 -1
  99. package/dist/core/shaders/WaveDistortion/index.js +2 -2
  100. package/dist/core/shaders/Weave/index.js +1 -1
  101. package/dist/core/shaders/WebcamTexture/index.js +2 -2
  102. package/dist/core/shaders/ZoomBlur/index.js +1 -1
  103. package/dist/js/createShader.js +1 -1
  104. package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
  105. package/dist/js/utils/generatePresetCode.js +19 -0
  106. package/dist/react/FlutedGlass.js +223 -0
  107. package/dist/react/Preview.js +1 -0
  108. package/dist/react/Shader.js +1 -1
  109. package/dist/react/components/FlutedGlass.d.ts +41 -0
  110. package/dist/react/components/FlutedGlass.d.ts.map +1 -0
  111. package/dist/react/engine/Preview.d.ts.map +1 -1
  112. package/dist/react/index.d.ts +1 -0
  113. package/dist/react/index.d.ts.map +1 -1
  114. package/dist/react/index.js +2 -1
  115. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  116. package/dist/react/utils/generatePresetCode.js +19 -0
  117. package/dist/registry.js +468 -0
  118. package/dist/solid/components/FlutedGlass.d.ts +38 -0
  119. package/dist/solid/components/FlutedGlass.d.ts.map +1 -0
  120. package/dist/solid/components/FlutedGlass.js +228 -0
  121. package/dist/solid/engine/Preview.d.ts.map +1 -1
  122. package/dist/solid/engine/Preview.js +76 -74
  123. package/dist/solid/engine/Shader.js +1 -1
  124. package/dist/solid/index.d.ts +1 -0
  125. package/dist/solid/index.d.ts.map +1 -1
  126. package/dist/solid/index.js +146 -144
  127. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  128. package/dist/solid/utils/generatePresetCode.js +19 -0
  129. package/dist/svelte/components/FlutedGlass.svelte.d.ts +28 -0
  130. package/dist/svelte/{generatePresetCode-jdOx6mhw.js → generatePresetCode-DAEzZxbM.js} +19 -0
  131. package/dist/svelte/index.d.ts +1 -0
  132. package/dist/svelte/index.js +769 -569
  133. package/dist/svelte/source/components/FlutedGlass.svelte +334 -0
  134. package/dist/svelte/source/engine/Preview.svelte +2 -0
  135. package/dist/svelte/source/index.js +1 -0
  136. package/dist/svelte/utils/generatePresetCode.js +1 -1
  137. package/dist/vue/FlutedGlass.js +3 -0
  138. package/dist/vue/FlutedGlass.vue_vue_type_script_setup_true_lang.js +226 -0
  139. package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
  140. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  141. package/dist/vue/components/FlutedGlass.vue.d.ts +63 -0
  142. package/dist/vue/components/FlutedGlass.vue.d.ts.map +1 -0
  143. package/dist/vue/index.d.ts +1 -0
  144. package/dist/vue/index.d.ts.map +1 -1
  145. package/dist/vue/index.js +2 -1
  146. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  147. package/dist/vue/utils/generatePresetCode.js +19 -0
  148. package/package.json +9 -1
  149. package/dist/core/shaderRegistry-DFzzFEKX.js +0 -252
  150. /package/dist/core/{Fog-BeKcPcTq.js → Fog-CIdU2Wn-.js} +0 -0
  151. /package/dist/core/{Form3D-Bufw6tZb.js → Form3D-CqmOXXGj.js} +0 -0
  152. /package/dist/core/{Glass-Bz9IKI2q.js → Glass-BCOkQbvW.js} +0 -0
  153. /package/dist/core/{GlassTiles-Dgh6nOaE.js → GlassTiles-CMx4NyO-.js} +0 -0
  154. /package/dist/core/{Glitch-BsbzLahF.js → Glitch-BdygvJKe.js} +0 -0
  155. /package/dist/core/{Glow-CUv1yHLZ.js → Glow-CsTZA75y.js} +0 -0
  156. /package/dist/core/{Godrays-D1LINbut.js → Godrays-w3ruw4NO.js} +0 -0
  157. /package/dist/core/{Grayscale-Ri-695Uh.js → Grayscale-ChaVI3AW.js} +0 -0
  158. /package/dist/core/{Grid-BYSsAIEv.js → Grid-CKbLS5tU.js} +0 -0
  159. /package/dist/core/{Group-CkhjTW59.js → Group-BqVJ4S7i.js} +0 -0
  160. /package/dist/core/{Halftone-BUCDTTAU.js → Halftone-BGQeBAgG.js} +0 -0
  161. /package/dist/core/{HexGrid-BUiDrehv.js → HexGrid-BFrnZEZT.js} +0 -0
  162. /package/dist/core/{HueShift-ctEX5vfo.js → HueShift-C1RxETwN.js} +0 -0
  163. /package/dist/core/{ImageTexture-uxj4LpF7.js → ImageTexture-DXhgMEOT.js} +0 -0
  164. /package/dist/core/{Invert-azYrcDMi.js → Invert-D3tc2UGp.js} +0 -0
  165. /package/dist/core/{LensFlare-ttrXgfea.js → LensFlare-B8x1fOKu.js} +0 -0
  166. /package/dist/core/{LinearBlur-By2aD8OO.js → LinearBlur-CshzmjfO.js} +0 -0
  167. /package/dist/core/{LinearGradient-CM02z32l.js → LinearGradient-Bzwquw_Q.js} +0 -0
  168. /package/dist/core/{MultiPointGradient-8zGSIM4U.js → MultiPointGradient-D0QQwizn.js} +0 -0
  169. /package/dist/core/{Neon-CMmGJzPy.js → Neon-eN4HlILk.js} +0 -0
  170. /package/dist/core/{Paper-B08rxNys.js → Paper-BmeUPAFe.js} +0 -0
  171. /package/dist/core/{Pixelate-dxPAFCRu.js → Pixelate-DqZcUKFK.js} +0 -0
  172. /package/dist/core/{Plasma-DGCw0cd7.js → Plasma-COq8mAw2.js} +0 -0
  173. /package/dist/core/{Polygon-CsCOt5YE.js → Polygon-BP5eKEiz.js} +0 -0
  174. /package/dist/core/{Posterize-Blv9pzPT.js → Posterize-CxYemXTn.js} +0 -0
  175. /package/dist/core/{ProgressiveBlur-NbvxFfRa.js → ProgressiveBlur-CNacb2Qx.js} +0 -0
  176. /package/dist/core/{RadialGradient-De0gtdh3.js → RadialGradient-SASVv2vb.js} +0 -0
  177. /package/dist/core/{Ring-kHH-DIDQ.js → Ring-CdJlzjRV.js} +0 -0
  178. /package/dist/core/{Ripples-Bf6Zwg6X.js → Ripples-BRZPZszq.js} +0 -0
  179. /package/dist/core/{RoundedRect-B0sWh2BN.js → RoundedRect-lzzi_1J7.js} +0 -0
  180. /package/dist/core/{Saturation-DCFAIUvZ.js → Saturation-n-aXJS81.js} +0 -0
  181. /package/dist/core/{Sharpness-DSpEoCSL.js → Sharpness-7tm7b-Bu.js} +0 -0
  182. /package/dist/core/{SimplexNoise-CMuU8n27.js → SimplexNoise-0-rfeziU.js} +0 -0
  183. /package/dist/core/{SineWave-VTNDSK_g.js → SineWave--i6bSrad.js} +0 -0
  184. /package/dist/core/{Smoke-9MJIAKq7.js → Smoke-BgPHDWDR.js} +0 -0
  185. /package/dist/core/{SmokeFill-qV2iRIts.js → SmokeFill-Dtctgt2S.js} +0 -0
  186. /package/dist/core/{Solarize-CWDgSBiv.js → Solarize-gNMmd47z.js} +0 -0
  187. /package/dist/core/{SolidColor-DhMdM3bE.js → SolidColor-D9ikFFu3.js} +0 -0
  188. /package/dist/core/{Spherize-BZxwopX8.js → Spherize-ZBorEEOU.js} +0 -0
  189. /package/dist/core/{Spiral-gpkw37l1.js → Spiral-sg-i02xw.js} +0 -0
  190. /package/dist/core/{Star-WJAOZ5P5.js → Star-BcqCHzHG.js} +0 -0
  191. /package/dist/core/{Strands-DOthZNHt.js → Strands-XLpth60o.js} +0 -0
  192. /package/dist/core/{Stripes-CFCXw1_N.js → Stripes-DEOXYnmy.js} +0 -0
  193. /package/dist/core/{StudioBackground-DJr-cxOL.js → StudioBackground-B5dpTR_X.js} +0 -0
  194. /package/dist/core/{Swirl-B_KxdaX2.js → Swirl-WqPvBF7u.js} +0 -0
  195. /package/dist/core/{TiltShift-BSAyR0Me.js → TiltShift-CYb6OQoU.js} +0 -0
  196. /package/dist/core/{Tint-DdvnpzEJ.js → Tint-C-bJpwd0.js} +0 -0
  197. /package/dist/core/{Trapezoid-Co0sIA73.js → Trapezoid-BvTEGdW_.js} +0 -0
  198. /package/dist/core/{Tritone-Ckb6hTkI.js → Tritone-LX-qUAGy.js} +0 -0
  199. /package/dist/core/{Truchet-CkFSkniR.js → Truchet-DE4lgYRb.js} +0 -0
  200. /package/dist/core/{VHS-mKd1QBBj.js → VHS-DbNjgUEX.js} +0 -0
  201. /package/dist/core/{Vesica-CxP7UD0a.js → Vesica-DqJMyqmy.js} +0 -0
  202. /package/dist/core/{Vibrance-WR5yQv_9.js → Vibrance-IDvmP1Xw.js} +0 -0
  203. /package/dist/core/{Vignette-hAIKTi35.js → Vignette-CA12P9VO.js} +0 -0
  204. /package/dist/core/{Voronoi-DOGmwUSK.js → Voronoi-DXeJ3xOf.js} +0 -0
  205. /package/dist/core/{Weave-CIP_EUPa.js → Weave-Bn2CfeE4.js} +0 -0
  206. /package/dist/core/{ZoomBlur-BuIVpHGG.js → ZoomBlur-DOzP_sOK.js} +0 -0
  207. /package/dist/core/{browser-D8zonASQ.js → browser-CsOpQ0L_.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { convertToTexture, float, length, max, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { t as createAnimatedTime } from "./time-DUqSFWvT.js";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { StorageTexture } from "three/webgpu";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { convertToTexture, dot, fract, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { t as createAnimatedTime } from "./time-DUqSFWvT.js";
@@ -0,0 +1,320 @@
1
+ import { n as applyEdgeToUV } from "./edges-CX_lJB9R.js";
2
+ import { a as transformColor, c as transformEdges } from "./transformations-B5lM6fYX.js";
3
+ import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
+ import { t as createAnimatedTime } from "./time-DUqSFWvT.js";
5
+ import { PI, abs, convertToTexture, cos, exp2, float, fract, mix, pow, screenUV, sign, sin, sqrt, step, uniform, vec2, vec3, vec4, viewportSize } from "three/tsl";
6
+ const componentDefinition = {
7
+ name: "FlutedGlass",
8
+ category: "Distortions",
9
+ description: "Full-screen fluted glass effect — refracts content through repeating cylindrical bars",
10
+ requiresRTT: true,
11
+ requiresChild: true,
12
+ props: {
13
+ shape: {
14
+ default: "bars",
15
+ description: "Cross-section shape of each flute",
16
+ compileTime: true,
17
+ transform: (value) => {
18
+ return {
19
+ "bars": 0,
20
+ "rounded": 1,
21
+ "waves": 2
22
+ }[value] ?? 0;
23
+ },
24
+ ui: {
25
+ type: "select",
26
+ options: [
27
+ {
28
+ label: "Bars",
29
+ value: "bars"
30
+ },
31
+ {
32
+ label: "Rounded",
33
+ value: "rounded"
34
+ },
35
+ {
36
+ label: "Waves",
37
+ value: "waves"
38
+ }
39
+ ],
40
+ label: "Shape",
41
+ group: "Effect"
42
+ }
43
+ },
44
+ angle: {
45
+ default: 0,
46
+ description: "Direction of the flutes in degrees (0 = vertical bars)",
47
+ ui: {
48
+ type: ["range", "map"],
49
+ min: 0,
50
+ max: 360,
51
+ step: 1,
52
+ label: "Angle",
53
+ group: "Effect"
54
+ }
55
+ },
56
+ frequency: {
57
+ default: 10,
58
+ description: "Number of flutes across the longest viewport axis",
59
+ ui: {
60
+ type: ["range", "map"],
61
+ min: 1,
62
+ max: 20,
63
+ step: 1,
64
+ label: "Frequency",
65
+ group: "Effect"
66
+ }
67
+ },
68
+ softness: {
69
+ default: .5,
70
+ description: "How smoothly distortion fades from each flute centre to its edge (0 = flat middle / sharp seams, 1 = gentle curve)",
71
+ ui: {
72
+ type: ["range", "map"],
73
+ min: 0,
74
+ max: 1,
75
+ step: .01,
76
+ label: "Softness",
77
+ group: "Effect"
78
+ }
79
+ },
80
+ waveAmplitude: {
81
+ default: .06,
82
+ description: "How far each flute sways horizontally as it travels (Waves shape only)",
83
+ ui: {
84
+ type: ["range", "map"],
85
+ min: 0,
86
+ max: .5,
87
+ step: .01,
88
+ label: "Wave Amplitude",
89
+ group: "Effect",
90
+ condition: { shape: "waves" }
91
+ }
92
+ },
93
+ waveFrequency: {
94
+ default: 1.5,
95
+ description: "How many sways fit along each flute (Waves shape only)",
96
+ ui: {
97
+ type: ["range", "map"],
98
+ min: .1,
99
+ max: 10,
100
+ step: .1,
101
+ label: "Wave Frequency",
102
+ group: "Effect",
103
+ condition: { shape: "waves" }
104
+ }
105
+ },
106
+ speed: {
107
+ default: 0,
108
+ description: "Animation speed — drifts the flute pattern over time and flows wave perturbations",
109
+ ui: {
110
+ type: "range",
111
+ min: -1,
112
+ max: 1,
113
+ step: .05,
114
+ label: "Speed",
115
+ group: "Animation"
116
+ }
117
+ },
118
+ refraction: {
119
+ default: 1.5,
120
+ description: "How aggressively each flute bends content beneath it",
121
+ ui: {
122
+ type: ["range", "map"],
123
+ min: 0,
124
+ max: 4,
125
+ step: .01,
126
+ label: "Refraction",
127
+ group: "Effect"
128
+ }
129
+ },
130
+ aberration: {
131
+ default: .2,
132
+ description: "Chromatic aberration — splits RGB along the refraction direction at flute seams",
133
+ compileTimeWhen: (prev, next) => prev > 0 !== next > 0,
134
+ ui: {
135
+ type: ["range", "map"],
136
+ min: 0,
137
+ max: 1,
138
+ step: .01,
139
+ label: "Aberration",
140
+ group: "Effect"
141
+ }
142
+ },
143
+ lightAngle: {
144
+ default: 30,
145
+ description: "Direction the light source is coming from (0 = head-on, 90 = grazing)",
146
+ ui: {
147
+ type: "range",
148
+ min: -90,
149
+ max: 90,
150
+ step: 1,
151
+ label: "Light Angle",
152
+ group: "Highlight"
153
+ }
154
+ },
155
+ highlight: {
156
+ default: .2,
157
+ description: "Strength of the specular reflection on each flute",
158
+ ui: {
159
+ type: ["range", "map"],
160
+ min: 0,
161
+ max: 2,
162
+ step: .01,
163
+ label: "Highlight",
164
+ group: "Highlight"
165
+ }
166
+ },
167
+ highlightSoftness: {
168
+ default: .3,
169
+ description: "Spread of the specular peak (0 = pin-tight, 1 = broad sheen)",
170
+ ui: {
171
+ type: ["range", "map"],
172
+ min: 0,
173
+ max: 1,
174
+ step: .01,
175
+ label: "Highlight Softness",
176
+ group: "Highlight"
177
+ }
178
+ },
179
+ highlightColor: {
180
+ default: "#ffffff",
181
+ transform: transformColor,
182
+ description: "Color of the specular highlight",
183
+ ui: {
184
+ type: "color",
185
+ label: "Highlight Color",
186
+ group: "Highlight"
187
+ }
188
+ },
189
+ edges: {
190
+ default: "mirror",
191
+ description: "How to handle edges when distortion samples beyond the canvas",
192
+ transform: transformEdges,
193
+ compileTime: true,
194
+ ui: {
195
+ type: "select",
196
+ options: [
197
+ {
198
+ label: "Stretch",
199
+ value: "stretch"
200
+ },
201
+ {
202
+ label: "Transparent",
203
+ value: "transparent"
204
+ },
205
+ {
206
+ label: "Mirror",
207
+ value: "mirror"
208
+ },
209
+ {
210
+ label: "Wrap",
211
+ value: "wrap"
212
+ }
213
+ ],
214
+ label: "Edges",
215
+ group: "Effect"
216
+ }
217
+ }
218
+ },
219
+ fragmentNode: (params) => {
220
+ const { uniforms, childNode, onCleanup, onBeforeRender } = params;
221
+ if (!childNode) return vec4(0);
222
+ const childTexture = convertToTexture(childNode);
223
+ onCleanup(() => {
224
+ if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
225
+ });
226
+ const uvCoord = screenUV;
227
+ const aspect = viewportSize.x.div(viewportSize.y);
228
+ const t = createAnimatedTime(params, uniforms.speed).negate();
229
+ let cosA, sinA;
230
+ if (uniforms.angle.uniform.isUniformNode) {
231
+ const cu = uniform(1);
232
+ const su = uniform(0);
233
+ const updateAngle = () => {
234
+ const r = uniforms.angle.uniform.value * Math.PI / 180;
235
+ cu.value = Math.cos(r);
236
+ su.value = Math.sin(r);
237
+ };
238
+ updateAngle();
239
+ onBeforeRender(updateAngle);
240
+ cosA = cu;
241
+ sinA = su;
242
+ } else {
243
+ const r = uniforms.angle.uniform.mul(PI).div(180);
244
+ cosA = cos(r);
245
+ sinA = sin(r);
246
+ }
247
+ const hx = uniform(0);
248
+ const hy = uniform(1);
249
+ const updateLight = () => {
250
+ const half = uniforms.lightAngle.uniform.value * Math.PI / 360;
251
+ hx.value = Math.sin(half);
252
+ hy.value = Math.cos(half);
253
+ };
254
+ updateLight();
255
+ onBeforeRender(updateLight);
256
+ const centered = uvCoord.sub(vec2(.5, .5));
257
+ const aspCorr = vec2(centered.x.mul(aspect), centered.y);
258
+ const u = aspCorr.x.mul(cosA).add(aspCorr.y.mul(sinA));
259
+ const v = aspCorr.x.mul(sinA).negate().add(aspCorr.y.mul(cosA));
260
+ const shapeId = uniforms.shape.uniform.value;
261
+ const cellPos = fract((shapeId === 2 ? u.add(sin(v.mul(uniforms.waveFrequency.uniform).mul(PI.mul(2)).add(t.mul(2))).mul(uniforms.waveAmplitude.uniform)) : u).mul(uniforms.frequency.uniform).add(t)).sub(.5).mul(2);
262
+ const softness = uniforms.softness.uniform;
263
+ const absCell = abs(cellPos).max(float(1e-4));
264
+ let slope;
265
+ switch (shapeId) {
266
+ case 0: {
267
+ const exp$1 = mix(float(16), float(4), softness);
268
+ slope = sign(cellPos).mul(pow(absCell, exp$1));
269
+ break;
270
+ }
271
+ default: {
272
+ const exp$1 = mix(float(8), float(3), softness);
273
+ slope = sign(cellPos).mul(pow(absCell, exp$1));
274
+ }
275
+ }
276
+ const halfCell = float(.5).div(uniforms.frequency.uniform.max(float(.001)));
277
+ const refrU = slope.mul(uniforms.refraction.uniform).mul(halfCell).negate();
278
+ const refrOffsetX = refrU.mul(cosA).div(aspect);
279
+ const refrOffsetY = refrU.mul(sinA);
280
+ const refractedUV = vec2(uvCoord.x.add(refrOffsetX), uvCoord.y.add(refrOffsetY));
281
+ const aberrationEnabled = typeof uniforms.aberration.uniform.value === "number" ? uniforms.aberration.uniform.value > 0 : true;
282
+ const chrU = refrU.mul(uniforms.aberration.uniform).mul(.5);
283
+ const chrOffX = chrU.mul(cosA).div(aspect);
284
+ const chrOffY = chrU.mul(sinA);
285
+ const edgeMode = uniforms.edges.uniform.value;
286
+ const sampleAt = (uv$1) => {
287
+ if (edgeMode === 1) {
288
+ const inX = step(float(0), uv$1.x).mul(step(uv$1.x, float(1)));
289
+ const inY = step(float(0), uv$1.y).mul(step(uv$1.y, float(1)));
290
+ return childTexture.sample(uv$1).mul(inX.mul(inY));
291
+ }
292
+ return childTexture.sample(applyEdgeToUV(uv$1, edgeMode));
293
+ };
294
+ let sampled;
295
+ if (!aberrationEnabled) sampled = sampleAt(refractedUV);
296
+ else {
297
+ const rUV = vec2(refractedUV.x.add(chrOffX), refractedUV.y.add(chrOffY));
298
+ const bUV = vec2(refractedUV.x.sub(chrOffX), refractedUV.y.sub(chrOffY));
299
+ const rS = sampleAt(rUV);
300
+ const gS = sampleAt(refractedUV);
301
+ const bS = sampleAt(bUV);
302
+ sampled = vec4(rS.r, gS.g, bS.b, gS.a);
303
+ }
304
+ const straight = unpremultiplyAlpha(sampled);
305
+ const baseRgb = vec3(straight.r, straight.g, straight.b);
306
+ const slopeSq = slope.mul(slope).min(float(1));
307
+ const nz = sqrt(float(1).sub(slopeSq));
308
+ const nDotH = slope.mul(hx).add(nz.mul(hy)).max(float(0));
309
+ const shininess = exp2(float(8).sub(uniforms.highlightSoftness.uniform.mul(float(7))));
310
+ const fresnel = pow(float(1).sub(nz), float(5));
311
+ const fresnelMix = float(.04).add(float(.96).mul(fresnel));
312
+ const spec = pow(nDotH, shininess).mul(fresnelMix).mul(uniforms.highlight.uniform);
313
+ const hlCol = uniforms.highlightColor.uniform;
314
+ const specA = spec.mul(straight.a);
315
+ const lit = vec3(baseRgb.x.add(hlCol.x.mul(specA)), baseRgb.y.add(hlCol.y.mul(specA)), baseRgb.z.add(hlCol.z.mul(specA)));
316
+ return vec4(lit.x, lit.y, lit.z, straight.a);
317
+ }
318
+ };
319
+ var FlutedGlass_default = componentDefinition;
320
+ export { componentDefinition as n, FlutedGlass_default as t };
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { StorageTexture } from "three/webgpu";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { atan, convertToTexture, cos, float, length, mod, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { StorageTexture } from "three/webgpu";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { convertToTexture, cos, mix, screenUV, sin, step, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { convertToTexture, cos, float, max, screenUV, sin, tan, vec2, vec4 } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { PI, atan, convertToTexture, length, mix, screenUV, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { PI, convertToTexture, cos, mix, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { StorageTexture } from "three/webgpu";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { clamp, convertToTexture, cos, float, mix, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { convertToTexture, cos, length, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
@@ -1,4 +1,4 @@
1
- import { t as needsVideoCanvasWorkaround } from "./browser-D8zonASQ.js";
1
+ import { t as needsVideoCanvasWorkaround } from "./browser-CsOpQ0L_.js";
2
2
  import { CanvasTexture, SRGBColorSpace, VideoTexture } from "three/webgpu";
3
3
  import { float, max, min, or, screenUV, select, texture, uniform, vec2, vec4, viewportSize } from "three/tsl";
4
4
  const componentDefinition = {
@@ -1,4 +1,4 @@
1
- import { t as applyEdgeHandling } from "./edges-CfGcQniB.js";
1
+ import { t as applyEdgeHandling } from "./edges-CX_lJB9R.js";
2
2
  import { c as transformEdges } from "./transformations-B5lM6fYX.js";
3
3
  import { t as unpremultiplyAlpha } from "./alpha-C4ptedXe.js";
4
4
  import { t as createAnimatedTime } from "./time-DUqSFWvT.js";
@@ -1,4 +1,4 @@
1
- import { t as needsVideoCanvasWorkaround } from "./browser-D8zonASQ.js";
1
+ import { t as needsVideoCanvasWorkaround } from "./browser-CsOpQ0L_.js";
2
2
  import { CanvasTexture, SRGBColorSpace, VideoTexture } from "three/webgpu";
3
3
  import { float, max, min, or, screenUV, select, texture, uniform, vec2, vec4, viewportSize } from "three/tsl";
4
4
  const componentDefinition = {
@@ -1,4 +1,16 @@
1
1
  import { abs, float, fract, mod, select, step, vec2, vec4 } from "three/tsl";
2
+ const applyEdgeToUV = (uv$1, edgeMode) => {
3
+ switch (edgeMode) {
4
+ case 1: return uv$1;
5
+ case 2: {
6
+ const mirrorX = mod(abs(uv$1.x), float(2));
7
+ const mirrorY = mod(abs(uv$1.y), float(2));
8
+ return vec2(select(step(float(1), mirrorX), float(2).sub(mirrorX), mirrorX), select(step(float(1), mirrorY), float(2).sub(mirrorY), mirrorY));
9
+ }
10
+ case 3: return fract(uv$1);
11
+ default: return uv$1.clamp(vec2(0, 0), vec2(1, 1));
12
+ }
13
+ };
2
14
  const applyEdgeHandling = (distortedUV, sampledColor, childTexture, edgeMode) => {
3
15
  switch (edgeMode) {
4
16
  case 1: {
@@ -22,4 +34,4 @@ const applyEdgeHandling = (distortedUV, sampledColor, childTexture, edgeMode) =>
22
34
  default: return sampledColor;
23
35
  }
24
36
  };
25
- export { applyEdgeHandling as t };
37
+ export { applyEdgeToUV as n, applyEdgeHandling as t };