@mkbabb/glass-ui 4.0.1 → 4.2.0

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 (606) hide show
  1. package/dist/{CardAction-CW7a0m8M.js → CardAction-DlVP2evz.js} +72 -53
  2. package/dist/{CommandShortcut-DvZNQ_HF.js → CommandShortcut-By-VQcLO.js} +25 -14
  3. package/dist/{ConfiguratorRow-BR4l-ixA.js → ConfiguratorRow-YMXdINHx.js} +14 -14
  4. package/dist/ContextMenuContent-CMWn6huB.js +90 -0
  5. package/dist/{ContextMenuSubContent-xol4sD2q.js → ContextMenuSubContent-DvwWCUc0.js} +16 -16
  6. package/dist/{DataTable-CuKwF7wr.js → DataTable-C4tG3eIJ.js} +4 -4
  7. package/dist/DialogContent-D8U9ZfWS.js +121 -0
  8. package/dist/DialogFooter-DoLy0ewI.js +80 -0
  9. package/dist/DialogScrollContent-BMekN7gq.js +93 -0
  10. package/dist/{FadingScroll-DI6hQhT9.js → FadingScroll-P8B30rAD.js} +1 -1
  11. package/dist/HoverCardContent-DAmGYglo.js +88 -0
  12. package/dist/{HoverPopover-CbqbNwgU.js → HoverPopover-DYpBOzzF.js} +1 -1
  13. package/dist/{IconChip-BTD-nay5.js → IconChip-CQa7XZYc.js} +7 -5
  14. package/dist/{IconTooltip-Bl8gFZ8d.js → IconTooltip-_df8M3xm.js} +1 -1
  15. package/dist/Input-CyU4_hIC.js +57 -0
  16. package/dist/{MetricBadge-RHdBP72w.js → MetricBadge-DQt_dGah.js} +1 -1
  17. package/dist/{Notification-VUwexFUf.js → Notification-BlSPJhtZ.js} +4 -4
  18. package/dist/NumberFieldContent-Z3VxGu_6.js +140 -0
  19. package/dist/PagerDots-CYlqVFd4.js +196 -0
  20. package/dist/PaperBackdrop-DYWgrnh8.js +42 -0
  21. package/dist/{PopoverContent-DL7E6vJP.js → PopoverContent-BuKyHZSz.js} +2 -2
  22. package/dist/{Progress-DctG61iZ.js → Progress-C9SsdwIZ.js} +1 -1
  23. package/dist/{ScrollingText-yOpBzFYq.js → ScrollingText-DY3W1Jfh.js} +2 -2
  24. package/dist/SelectScrollDownButton-3mFHX_R-.js +260 -0
  25. package/dist/{SelectSeparator-DXswVdRz.js → SelectSeparator-CNRGG7Ew.js} +1 -1
  26. package/dist/Separator-Cf9-JFgi.js +44 -0
  27. package/dist/Switch-uf-UKPA2.js +49 -0
  28. package/dist/{Toaster-Bw4xR8xV.js → Toaster-ozrsR4mP.js} +2 -2
  29. package/dist/{ToggleGroupItem-pEM9vIhs.js → ToggleGroupItem-BpzaVzNm.js} +6 -6
  30. package/dist/TooltipProvider-QQVM_80r.js +109 -0
  31. package/dist/animated-digit.js +2 -2
  32. package/dist/api/index.d.ts +16 -32
  33. package/dist/api/types-extra.d.ts +33 -0
  34. package/dist/api.js +2 -2
  35. package/dist/aurora.js +629 -269
  36. package/dist/badge-Bt14yURi.js +72 -0
  37. package/dist/badge.js +1 -1
  38. package/dist/border-progress.js +49 -57
  39. package/dist/button-D1W9PrzI.js +130 -0
  40. package/dist/button.js +1 -1
  41. package/dist/canvas.js +2 -3
  42. package/dist/card.js +1 -1
  43. package/dist/carousel.js +235 -106
  44. package/dist/chipVariants-BJQ0I2kB.js +18 -0
  45. package/dist/collapsible.js +1 -1
  46. package/dist/color-B9jZdhJX.js +116 -0
  47. package/dist/color.js +2 -2
  48. package/dist/command.js +1 -1
  49. package/dist/completion-seal.d.ts +1 -0
  50. package/dist/completion-seal.js +89 -0
  51. package/dist/components/custom/aurora/Aurora.vue.d.ts +10 -5
  52. package/dist/components/custom/aurora/composables/color.d.ts +13 -0
  53. package/dist/components/custom/aurora/composables/frameLoop.d.ts +9 -0
  54. package/dist/components/custom/aurora/composables/glSetup.d.ts +1 -1
  55. package/dist/components/custom/aurora/composables/runtime.d.ts +12 -0
  56. package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +12 -3
  57. package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +8 -0
  58. package/dist/components/custom/aurora/constants/presets.d.ts +47 -0
  59. package/dist/components/custom/aurora/constants/renderMode.d.ts +16 -8
  60. package/dist/components/custom/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -0
  61. package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
  62. package/dist/components/custom/aurora/index.d.ts +1 -1
  63. package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
  64. package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +14 -18
  65. package/dist/components/custom/border-progress/index.d.ts +1 -1
  66. package/dist/components/custom/completion-seal/CompletionSeal.vue.d.ts +21 -0
  67. package/dist/components/custom/completion-seal/composables/useCompletionSeal.d.ts +37 -0
  68. package/dist/components/custom/completion-seal/constants.d.ts +46 -0
  69. package/dist/components/custom/completion-seal/index.d.ts +4 -0
  70. package/dist/components/custom/concentric/Concentric.vue.d.ts +15 -12
  71. package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +12 -0
  72. package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +13 -0
  73. package/dist/components/custom/concentric/composables/levelField.d.ts +50 -0
  74. package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +7 -3
  75. package/dist/components/custom/concentric/composables/useConcentric.d.ts +3 -3
  76. package/dist/components/custom/concentric/constants.d.ts +69 -24
  77. package/dist/components/custom/concentric/index.d.ts +2 -2
  78. package/dist/components/custom/concentric/shaders/concentric.glsl.d.ts +2 -2
  79. package/dist/components/custom/concentric/shaders/concentric.wgsl.d.ts +1 -1
  80. package/dist/components/custom/configurator/Configurator.vue.d.ts +23 -2
  81. package/dist/components/custom/configurator/index.d.ts +1 -1
  82. package/dist/components/custom/confirm-dialog/ConfirmDialog.vue.d.ts +3 -3
  83. package/dist/components/custom/constellation/Constellation.vue.d.ts +5 -4
  84. package/dist/components/custom/constellation/composables/constellationGLSetup.d.ts +10 -0
  85. package/dist/components/custom/constellation/composables/constellationWGPUSetup.d.ts +19 -0
  86. package/dist/components/custom/constellation/composables/uniformBridgeWGPU.d.ts +66 -0
  87. package/dist/components/custom/constellation/composables/useConstellation.d.ts +3 -10
  88. package/dist/components/custom/constellation/constants.d.ts +33 -0
  89. package/dist/components/custom/constellation/constellationField.d.ts +31 -1
  90. package/dist/components/custom/constellation/constellationInteraction.d.ts +23 -14
  91. package/dist/components/custom/constellation/constellationRender.d.ts +25 -0
  92. package/dist/components/custom/constellation/constellationTypes.d.ts +38 -0
  93. package/dist/components/custom/constellation/constellationWell.d.ts +15 -0
  94. package/dist/components/custom/constellation/index.d.ts +5 -5
  95. package/dist/components/custom/constellation/shaders/constellation-lines.glsl.d.ts +2 -0
  96. package/dist/components/custom/constellation/shaders/constellation-lines.wgsl.d.ts +1 -0
  97. package/dist/components/custom/constellation/shaders/constellation-points.glsl.d.ts +2 -0
  98. package/dist/components/custom/constellation/shaders/constellation-points.wgsl.d.ts +1 -0
  99. package/dist/components/custom/deck/DeckPager.vue.d.ts +29 -0
  100. package/dist/components/custom/deck/composables/useDeck.d.ts +27 -0
  101. package/dist/components/custom/deck/composables/useDeckKeyboard.d.ts +25 -0
  102. package/dist/components/custom/deck/composables/useDeckSpring.d.ts +22 -0
  103. package/dist/components/custom/deck/constants.d.ts +14 -0
  104. package/dist/components/custom/deck/index.d.ts +8 -0
  105. package/dist/components/custom/dock/DockDropdownTrigger.vue.d.ts +4 -3
  106. package/dist/components/custom/dock/DockIconButton.vue.d.ts +22 -0
  107. package/dist/components/custom/dock/DockPopoverTrigger.vue.d.ts +19 -0
  108. package/dist/components/custom/dock/DockStack.vue.d.ts +78 -0
  109. package/dist/components/custom/dock/GlassDock.vue.d.ts +21 -3
  110. package/dist/components/custom/dock/composables/dockMorphContext.d.ts +18 -32
  111. package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +78 -67
  112. package/dist/components/custom/dock/composables/index.d.ts +3 -0
  113. package/dist/components/custom/dock/composables/railProjection.d.ts +45 -0
  114. package/dist/components/custom/dock/composables/useDockContextSilhouette.d.ts +192 -0
  115. package/dist/components/custom/dock/composables/useDockFission.d.ts +158 -0
  116. package/dist/components/custom/dock/composables/useDockItemDrag.d.ts +18 -0
  117. package/dist/components/custom/dock/composables/useDockSearch.d.ts +85 -0
  118. package/dist/components/custom/dock/composables/useDockShellProps.d.ts +49 -0
  119. package/dist/components/custom/dock/constants.d.ts +32 -17
  120. package/dist/components/custom/dock/index.d.ts +8 -2
  121. package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +15 -11
  122. package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +69 -6
  123. package/dist/components/custom/dot-flow-field/composables/flowGLProgram.d.ts +8 -0
  124. package/dist/components/custom/dot-flow-field/composables/flowSetupGL.d.ts +9 -0
  125. package/dist/components/custom/dot-flow-field/composables/flowSetupGLFlow.d.ts +12 -0
  126. package/dist/components/custom/dot-flow-field/composables/flowSetupWGPU.d.ts +7 -0
  127. package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +50 -9
  128. package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +6 -5
  129. package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +23 -9
  130. package/dist/components/custom/dot-flow-field/constants.d.ts +92 -20
  131. package/dist/components/custom/dot-flow-field/index.d.ts +2 -2
  132. package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -1
  133. package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +31 -18
  134. package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +2 -1
  135. package/dist/components/custom/dot-matrix/DotMatrix.vue.d.ts +43 -0
  136. package/dist/components/custom/dot-matrix/composables/dotMatrixField.d.ts +89 -0
  137. package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +61 -0
  138. package/dist/components/custom/dot-matrix/composables/useDotMatrix.d.ts +34 -0
  139. package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +34 -0
  140. package/dist/components/custom/dot-matrix/constants.d.ts +72 -0
  141. package/dist/components/custom/dot-matrix/index.d.ts +5 -0
  142. package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +4 -0
  143. package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -0
  144. package/dist/components/custom/easing/EasingPicker.vue.d.ts +2 -2
  145. package/dist/components/custom/easing/composables/useEasingPicker.d.ts +5 -0
  146. package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
  147. package/dist/components/custom/fourier-field/FourierField.vue.d.ts +44 -47
  148. package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +24 -0
  149. package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +31 -0
  150. package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +56 -0
  151. package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +61 -37
  152. package/dist/components/custom/fourier-field/constants.d.ts +114 -4
  153. package/dist/components/custom/fourier-field/index.d.ts +23 -18
  154. package/dist/components/custom/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +1 -0
  155. package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +4 -0
  156. package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -0
  157. package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +9 -1
  158. package/dist/components/custom/goo-blob/composables/easing.d.ts +1 -0
  159. package/dist/components/custom/goo-blob/composables/useBlobSatellites.d.ts +1 -0
  160. package/dist/components/custom/goo-blob/constants.d.ts +26 -1
  161. package/dist/components/custom/goo-blob/index.d.ts +1 -1
  162. package/dist/components/custom/goo-blob/shaders/metaball-noise.wgsl.d.ts +1 -0
  163. package/dist/components/custom/goo-blob/shaders/metaball-palette.wgsl.d.ts +1 -0
  164. package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
  165. package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -1
  166. package/dist/components/custom/goo-blob/types.d.ts +86 -1
  167. package/dist/components/custom/goo-dot-matrix/GooDotMatrix.vue.d.ts +49 -0
  168. package/dist/components/custom/goo-dot-matrix/composables/gooDotLattice.d.ts +24 -0
  169. package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +79 -0
  170. package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +45 -0
  171. package/dist/components/custom/goo-dot-matrix/composables/useGooDotMatrix.d.ts +31 -0
  172. package/dist/components/custom/goo-dot-matrix/constants.d.ts +115 -0
  173. package/dist/components/custom/goo-dot-matrix/index.d.ts +5 -0
  174. package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +13 -0
  175. package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +4 -0
  176. package/dist/components/custom/goo-filter/GooFilter.vue.d.ts +22 -0
  177. package/dist/components/custom/goo-filter/index.d.ts +1 -0
  178. package/dist/components/custom/handmark/brush.d.ts +17 -17
  179. package/dist/components/custom/handmark/constants.d.ts +28 -8
  180. package/dist/components/custom/handmark/geometry.d.ts +34 -1
  181. package/dist/components/custom/handmark/index.d.ts +1 -1
  182. package/dist/components/custom/icon-chip/types.d.ts +10 -0
  183. package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +21 -2
  184. package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +15 -0
  185. package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +9 -0
  186. package/dist/components/custom/pager-dots/index.d.ts +2 -0
  187. package/dist/components/custom/pager-dots/pagerWindow.d.ts +9 -0
  188. package/dist/components/custom/paper-backdrop/PaperBackdrop.vue.d.ts +18 -0
  189. package/dist/components/custom/paper-grid/PaperGrid.vue.d.ts +42 -0
  190. package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +105 -0
  191. package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +18 -0
  192. package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +21 -0
  193. package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +16 -0
  194. package/dist/components/custom/paper-grid/composables/usePaperGrid.d.ts +31 -0
  195. package/dist/components/custom/paper-grid/constants.d.ts +95 -0
  196. package/dist/components/custom/paper-grid/index.d.ts +5 -0
  197. package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +4 -0
  198. package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -0
  199. package/dist/components/custom/search/FuzzySearch.vue.d.ts +8 -2
  200. package/dist/components/custom/search/SearchBar.vue.d.ts +8 -0
  201. package/dist/components/custom/search/index.d.ts +2 -0
  202. package/dist/components/custom/search/searchVariants.d.ts +19 -0
  203. package/dist/components/custom/selectable-chip/SelectableChip.vue.d.ts +50 -0
  204. package/dist/components/custom/selectable-chip/chipVariants.d.ts +39 -0
  205. package/dist/components/custom/selectable-chip/index.d.ts +2 -0
  206. package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +15 -0
  207. package/dist/components/custom/split-chars/SplitChars.vue.d.ts +39 -0
  208. package/dist/components/custom/split-chars/index.d.ts +1 -0
  209. package/dist/components/custom/tabs/SegmentedTabs.vue.d.ts +8 -6
  210. package/dist/components/custom/tabs/constants.d.ts +28 -2
  211. package/dist/components/custom/timeline/ScrubberTimeline.vue.d.ts +16 -0
  212. package/dist/components/custom/timeline/geometry.d.ts +0 -8
  213. package/dist/components/custom/toggle-chip/index.d.ts +15 -4
  214. package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +32 -17
  215. package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +10 -5
  216. package/dist/components/ui/_shared/index.d.ts +2 -0
  217. package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
  218. package/dist/components/ui/_shared/useSurfaceAxis.d.ts +17 -3
  219. package/dist/components/ui/badge/Badge.vue.d.ts +14 -0
  220. package/dist/components/ui/badge/index.d.ts +1 -0
  221. package/dist/components/ui/button/Button.vue.d.ts +1 -0
  222. package/dist/components/ui/button/index.d.ts +1 -1
  223. package/dist/components/ui/card/Card.vue.d.ts +46 -1
  224. package/dist/components/ui/card/ScrollCard.vue.d.ts +1 -1
  225. package/dist/components/ui/card/index.d.ts +1 -1
  226. package/dist/components/ui/carousel/CarouselContent.vue.d.ts +2 -4
  227. package/dist/components/ui/carousel/CarouselNext.vue.d.ts +1 -1
  228. package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +1 -1
  229. package/dist/components/ui/command/CommandDialog.vue.d.ts +9 -3
  230. package/dist/components/ui/command/CommandList.vue.d.ts +3 -0
  231. package/dist/components/ui/context-menu/ContextMenuContent.vue.d.ts +5 -1
  232. package/dist/components/ui/dialog/DialogContent.vue.d.ts +9 -0
  233. package/dist/components/ui/drawer/Drawer.vue.d.ts +33 -14
  234. package/dist/components/ui/drawer/constants.d.ts +8 -6
  235. package/dist/components/ui/drawer/index.d.ts +12 -2
  236. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
  237. package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
  238. package/dist/components/ui/input/Input.vue.d.ts +3 -0
  239. package/dist/components/ui/number-field/NumberFieldInput.vue.d.ts +6 -1
  240. package/dist/components/ui/select/SelectContent.vue.d.ts +12 -0
  241. package/dist/components/ui/slider/Slider.vue.d.ts +9 -0
  242. package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
  243. package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
  244. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +3 -0
  245. package/dist/composables/color/index.d.ts +2 -0
  246. package/dist/composables/color/useAccentTone.d.ts +34 -0
  247. package/dist/composables/dom/index.d.ts +1 -0
  248. package/dist/composables/dom/useDragVelocity.d.ts +46 -0
  249. package/dist/composables/glass/useVizChoreography.d.ts +123 -0
  250. package/dist/composables/glass/wave/index.d.ts +4 -0
  251. package/dist/composables/glass/wave/waveField.d.ts +115 -0
  252. package/dist/composables/glass/wave/waveField.glsl.d.ts +1 -0
  253. package/dist/composables/glass/wave/waveField.wgsl.d.ts +1 -0
  254. package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +105 -2
  255. package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
  256. package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +40 -2
  257. package/dist/composables/glass/webgpu/index.d.ts +2 -1
  258. package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +65 -7
  259. package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +50 -2
  260. package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
  261. package/dist/composables/motion/core/index.d.ts +7 -0
  262. package/dist/composables/motion/core/useHaptic.d.ts +48 -0
  263. package/dist/composables/motion/core/writeVelocityWeight.d.ts +31 -0
  264. package/dist/composables/motion/index.d.ts +2 -0
  265. package/dist/composables/motion/scrollReader.d.ts +25 -0
  266. package/dist/composables/motion/springPresets.d.ts +19 -1
  267. package/dist/composables/motion/suite.d.ts +2 -2
  268. package/dist/composables/motion/useBloomUp.d.ts +97 -0
  269. package/dist/composables/motion/useCelebrationBurst.d.ts +50 -0
  270. package/dist/composables/motion/useCharStagger.d.ts +44 -0
  271. package/dist/composables/motion/useDockCtaReceive.d.ts +29 -22
  272. package/dist/composables/motion/useGooMorph.d.ts +72 -0
  273. package/dist/composables/motion/useLiquidFlex.d.ts +18 -0
  274. package/dist/composables/motion/useLiquidMorph.d.ts +108 -0
  275. package/dist/composables/motion/useLiquidPress.d.ts +12 -0
  276. package/dist/composables/motion/useLiquidReveal.d.ts +7 -4
  277. package/dist/composables/motion/useMorphField.d.ts +157 -0
  278. package/dist/composables/motion/useScrollChrome.d.ts +58 -0
  279. package/dist/composables/motion/useScrollPin.d.ts +49 -0
  280. package/dist/composables/motion/useScrollScene.d.ts +67 -0
  281. package/dist/composables/motion/useScrollTrigger.d.ts +67 -0
  282. package/dist/composables/motion/useSpringPress.d.ts +5 -5
  283. package/dist/composables/motion/useStaggerReveal.d.ts +24 -0
  284. package/dist/composables/sidebar/index.d.ts +4 -1
  285. package/dist/composables/sidebar/types.d.ts +68 -3
  286. package/dist/composables/sidebar/useClickDelegate.d.ts +4 -0
  287. package/dist/composables/sidebar/useLazyLoader.d.ts +5 -0
  288. package/dist/composables/sidebar/useScrollTo.d.ts +5 -0
  289. package/dist/composables/virtual/index.d.ts +4 -0
  290. package/dist/composables/virtual/useVirtualSectionWindow.d.ts +72 -0
  291. package/dist/composables/virtual/useWindowedStore.d.ts +43 -0
  292. package/dist/composables/virtual/virtualSectionLayout.d.ts +103 -0
  293. package/dist/concentric.js +552 -309
  294. package/dist/configurator.js +2 -2
  295. package/dist/confirm-dialog.js +62 -47
  296. package/dist/constellation.js +635 -235
  297. package/dist/context-menu.js +2 -2
  298. package/dist/controls.js +2 -2
  299. package/dist/createCanvasLifecycle-CuCrGRfq.js +173 -0
  300. package/dist/dark.js +1 -1
  301. package/dist/data-table.js +1 -1
  302. package/dist/deck.d.ts +1 -0
  303. package/dist/deck.js +105 -0
  304. package/dist/dialog.js +4 -3
  305. package/dist/dock.js +1320 -631
  306. package/dist/dockContext-gFVS2gMg.js +18 -0
  307. package/dist/dom.js +7 -6
  308. package/dist/dot-flow-field.js +1268 -387
  309. package/dist/dot-matrix.d.ts +1 -0
  310. package/dist/dot-matrix.js +774 -0
  311. package/dist/dotMatrixField-CRO0ZFk4.js +48 -0
  312. package/dist/drawer.js +106 -96
  313. package/dist/{dropdown-menu-CofSZuk8.js → dropdown-menu-CCfcCQ68.js} +83 -79
  314. package/dist/dropdown-menu.js +1 -1
  315. package/dist/easing.js +188 -176
  316. package/dist/expandable-container.js +43 -21
  317. package/dist/fading-scroll.js +1 -1
  318. package/dist/flow.glsl-DqEGRpl4.js +4 -0
  319. package/dist/forms.js +64 -62
  320. package/dist/fourier-field.js +1069 -178
  321. package/dist/fourier-math.js +1 -1
  322. package/dist/glass-panel.js +2 -2
  323. package/dist/glass-ui.css +1 -1
  324. package/dist/glass-ui.js +164 -119
  325. package/dist/goo-blob.js +175 -1230
  326. package/dist/goo-dot-matrix.d.ts +1 -0
  327. package/dist/goo-dot-matrix.js +811 -0
  328. package/dist/handmark.js +137 -94
  329. package/dist/header-ribbon.js +1 -1
  330. package/dist/hover-card.js +1 -1
  331. package/dist/hover-popover.js +1 -1
  332. package/dist/icon-chip.js +1 -1
  333. package/dist/icon-tooltip.js +1 -1
  334. package/dist/index.d.ts +5 -0
  335. package/dist/instrument-chassis.js +1 -1
  336. package/dist/keyboard.js +1 -1
  337. package/dist/label.js +1 -1
  338. package/dist/labeled-field.js +70 -60
  339. package/dist/metric-badge.js +1 -1
  340. package/dist/metric-cell.js +1 -1
  341. package/dist/metric-stack.js +12 -3
  342. package/dist/motion-core.js +59 -34
  343. package/dist/motion-curves.js +30 -14
  344. package/dist/motion.js +231 -96
  345. package/dist/notification.js +1 -1
  346. package/dist/number-field.js +1 -1
  347. package/dist/pager-dots.js +2 -91
  348. package/dist/paper-backdrop.js +1 -1
  349. package/dist/paper-grid.d.ts +1 -0
  350. package/dist/paper-grid.js +761 -0
  351. package/dist/paperGrid-CXCSMbZ1.js +191 -0
  352. package/dist/popover.js +1 -1
  353. package/dist/{presets-BW2b-fr1.js → presets-QvYgnFIZ.js} +14 -13
  354. package/dist/{procedural-color.glsl-CIFsJhwI.js → procedural-color.wgsl-C1Y5PkM6.js} +2 -2
  355. package/dist/progress.js +1 -1
  356. package/dist/pulse.js +2 -2
  357. package/dist/reactive.js +2 -2
  358. package/dist/{useCanvas2D-B8w_E3Rr.js → resolveCanvasColor-DsSJk06I.js} +16 -6
  359. package/dist/scrollReader-rc3Ns_NM.js +42 -0
  360. package/dist/scrolling-text.js +1 -1
  361. package/dist/search.js +162 -306
  362. package/dist/select.js +3 -3
  363. package/dist/selectable-chip.d.ts +1 -0
  364. package/dist/selectable-chip.js +48 -0
  365. package/dist/separator.js +1 -1
  366. package/dist/{sheet-tZMg0E0w.js → sheet-DUCIoOe0.js} +4 -4
  367. package/dist/sheet.js +1 -1
  368. package/dist/sidebar.js +216 -114
  369. package/dist/slider-CcICPe3u.js +149 -0
  370. package/dist/slider.js +1 -1
  371. package/dist/sortable-list.js +3 -3
  372. package/dist/spectrum-walk-cBNSx_zm.js +33 -0
  373. package/dist/springPresets-DfoQ6XRY.js +64 -0
  374. package/dist/stacked-icons.js +54 -39
  375. package/dist/styles/animations.css +13 -3
  376. package/dist/styles/cards.css +271 -2
  377. package/dist/styles/completion-seal.css +131 -0
  378. package/dist/styles/components.css +1 -4
  379. package/dist/styles/configurator.css +221 -1
  380. package/dist/styles/critical-partition.mjs +66 -11
  381. package/dist/styles/deferred.css +4 -0
  382. package/dist/styles/dock/adaptive-legibility.css +119 -0
  383. package/dist/styles/dock/cta-seat.css +87 -0
  384. package/dist/styles/dock/density.css +167 -6
  385. package/dist/styles/dock/fission-bridge.css +552 -0
  386. package/dist/styles/dock/layers.css +90 -78
  387. package/dist/styles/dock/morph-bridge.css +67 -18
  388. package/dist/styles/dock/morph.css +57 -118
  389. package/dist/styles/dock/overflow.css +12 -0
  390. package/dist/styles/dock/search.css +68 -0
  391. package/dist/styles/dock/shape.css +250 -0
  392. package/dist/styles/dock/shell.css +24 -8
  393. package/dist/styles/dock/stack-rail.css +352 -0
  394. package/dist/styles/dock-controls/dark-mode-toggle.css +17 -4
  395. package/dist/styles/dock-controls/icon-button.css +46 -0
  396. package/dist/styles/dock-controls/triggers.css +23 -1
  397. package/dist/styles/dock-controls.css +18 -0
  398. package/dist/styles/dock.css +27 -2
  399. package/dist/styles/drawer.css +166 -0
  400. package/dist/styles/glass/accent-tone.css +66 -0
  401. package/dist/styles/glass/control-surfaces.css +167 -0
  402. package/dist/styles/glass/glass-atom.css +244 -0
  403. package/dist/styles/glass/glass-capsule.css +143 -0
  404. package/dist/styles/glass/glass-chip.css +215 -0
  405. package/dist/styles/glass/ladder.css +67 -17
  406. package/dist/styles/glass/liquid-enter.css +252 -0
  407. package/dist/styles/glass/liquid-morph.css +850 -0
  408. package/dist/styles/glass/material.css +70 -1
  409. package/dist/styles/glass/reveal.css +22 -2
  410. package/dist/styles/glass/rim.css +31 -9
  411. package/dist/styles/glass/surfaces.css +81 -150
  412. package/dist/styles/glass.css +21 -0
  413. package/dist/styles/icon-chip.css +45 -0
  414. package/dist/styles/index.css +26 -0
  415. package/dist/styles/jubilance.css +65 -0
  416. package/dist/styles/motion/morph-field.css +229 -0
  417. package/dist/styles/paper.css +230 -14
  418. package/dist/styles/scroll-choreography.css +135 -78
  419. package/dist/styles/scroll-chrome.css +123 -0
  420. package/dist/styles/scroll-driven.css +38 -0
  421. package/dist/styles/segmented-tabs.css +110 -40
  422. package/dist/styles/select.css +151 -0
  423. package/dist/styles/theme/bridges.css +22 -0
  424. package/dist/styles/theme/radius.css +18 -1
  425. package/dist/styles/tokens/color-radius.css +14 -4
  426. package/dist/styles/tokens/dark-arm.css +94 -12
  427. package/dist/styles/tokens/glass-deep.css +33 -4
  428. package/dist/styles/tokens/glass-fx.css +122 -1
  429. package/dist/styles/tokens/glass.css +226 -34
  430. package/dist/styles/tokens/light-dark.css +3 -3
  431. package/dist/styles/tokens/offsets.css +27 -0
  432. package/dist/styles/tokens/property-regs.css +277 -0
  433. package/dist/styles/tokens/scale-paper.css +86 -30
  434. package/dist/styles/tokens/scheme-motion.css +106 -133
  435. package/dist/styles/tokens/scheme-spring.css +239 -0
  436. package/dist/styles/tokens/scroll-tokens.css +15 -15
  437. package/dist/styles/tokens/shadow.css +73 -13
  438. package/dist/styles/tokens/sizing-config.css +110 -0
  439. package/dist/styles/tokens/sizing.css +55 -104
  440. package/dist/styles/tokens.css +14 -2
  441. package/dist/styles/typography/semantic.css +18 -5
  442. package/dist/styles/utilities/a11y-overrides.css +20 -5
  443. package/dist/styles/utilities/base-misc.css +52 -0
  444. package/dist/styles/utilities/btn.css +84 -3
  445. package/dist/styles/utilities/components.css +31 -6
  446. package/dist/styles/utilities/metal.css +26 -0
  447. package/dist/switch.js +1 -1
  448. package/dist/tabs.js +199 -182
  449. package/dist/timeline.js +241 -206
  450. package/dist/toast.js +1 -1
  451. package/dist/toggle-chip.js +14 -41
  452. package/dist/toggle-group.js +1 -1
  453. package/dist/tooltip.js +1 -1
  454. package/dist/typewriter.js +2 -2
  455. package/dist/uniformBridgeWGPU-BCse1SHU.js +1268 -0
  456. package/dist/{useAnimatedNumber-BfUq2bUM.js → useAnimatedNumber-BntskVdQ.js} +1 -1
  457. package/dist/{useConfiguratorState-DNlOh6c8.js → useConfiguratorState-22BcULzF.js} +41 -38
  458. package/dist/useControlSize-DAZ062x7.js +9 -0
  459. package/dist/useDockCtaReceive-DX7RDb6_.js +88 -0
  460. package/dist/{useDragMorph-DgxnsVJz.js → useDragMorph-DGLSewwB.js} +4 -4
  461. package/dist/useDragVelocity-CjcfX3dA.js +57 -0
  462. package/dist/useFuzzySearch-0fTYOhS4.js +177 -0
  463. package/dist/useGooMorph-Cs13NgYL.js +104 -0
  464. package/dist/useGpuSubstrate-Ceet70xq.js +347 -0
  465. package/dist/useHaptic-CPz5BT9I.js +134 -0
  466. package/dist/{useLiquidFlex-mZPMiNXh.js → useLiquidFlex-Cc6PjVJD.js} +8 -3
  467. package/dist/useLiquidPress-CtOQ8Z0_.js +43 -0
  468. package/dist/useMorphField-ogBM7ubT.js +141 -0
  469. package/dist/usePointerVelocityField-BrkqZFhj.js +91 -0
  470. package/dist/useScrollChrome-JuImi1DM.js +258 -0
  471. package/dist/{useSpringMount-q1amq1SJ.js → useSpringMount-DFxtzmkR.js} +1 -1
  472. package/dist/useSpringPress-VM9RgVq3.js +36 -0
  473. package/dist/{useSurfaceAxis-g0NloYEF.js → useSurfaceAxis-Ci7Dnaw2.js} +1 -1
  474. package/dist/{useTouchGate-CBZTD4SD.js → useTouchGate-B1Lf9XqN.js} +1 -1
  475. package/dist/{vendor-CKmzio-i.js → vendor-B2qOlYY3.js} +24 -11
  476. package/dist/virtual.d.ts +1 -0
  477. package/dist/virtual.js +225 -0
  478. package/dist/watercolor-dot.js +107 -74
  479. package/dist/writeVelocityWeight-Bh83xZfs.js +19 -0
  480. package/package.json +140 -9
  481. package/src/styles/animations.css +13 -3
  482. package/src/styles/cards.css +271 -2
  483. package/src/styles/completion-seal.css +131 -0
  484. package/src/styles/configurator.css +221 -1
  485. package/src/styles/critical-partition.mjs +66 -11
  486. package/src/styles/dock/adaptive-legibility.css +119 -0
  487. package/src/styles/dock/cta-seat.css +87 -0
  488. package/src/styles/dock/density.css +167 -6
  489. package/src/styles/dock/fission-bridge.css +552 -0
  490. package/src/styles/dock/layers.css +90 -78
  491. package/src/styles/dock/morph-bridge.css +67 -18
  492. package/src/styles/dock/morph.css +57 -118
  493. package/src/styles/dock/overflow.css +12 -0
  494. package/src/styles/dock/search.css +68 -0
  495. package/src/styles/dock/shape.css +250 -0
  496. package/src/styles/dock/shell.css +24 -8
  497. package/src/styles/dock/stack-rail.css +352 -0
  498. package/src/styles/dock-controls/dark-mode-toggle.css +17 -4
  499. package/src/styles/dock-controls/icon-button.css +46 -0
  500. package/src/styles/dock-controls/triggers.css +23 -1
  501. package/src/styles/dock-controls.css +18 -0
  502. package/src/styles/dock.css +27 -2
  503. package/src/styles/drawer.css +164 -0
  504. package/src/styles/glass/accent-tone.css +66 -0
  505. package/src/styles/glass/control-surfaces.css +167 -0
  506. package/src/styles/glass/glass-atom.css +244 -0
  507. package/src/styles/glass/glass-capsule.css +143 -0
  508. package/src/styles/glass/glass-chip.css +215 -0
  509. package/src/styles/glass/ladder.css +67 -17
  510. package/src/styles/glass/liquid-enter.css +252 -0
  511. package/src/styles/glass/liquid-morph.css +850 -0
  512. package/src/styles/glass/material.css +70 -1
  513. package/src/styles/glass/reveal.css +22 -2
  514. package/src/styles/glass/rim.css +31 -9
  515. package/src/styles/glass/surfaces.css +81 -150
  516. package/src/styles/glass.css +21 -0
  517. package/src/styles/icon-chip.css +45 -0
  518. package/src/styles/index.css +26 -0
  519. package/src/styles/jubilance.css +65 -0
  520. package/src/styles/motion/morph-field.css +229 -0
  521. package/src/styles/paper.css +230 -14
  522. package/src/styles/scroll-choreography.css +135 -78
  523. package/src/styles/scroll-chrome.css +123 -0
  524. package/src/styles/scroll-driven.css +38 -0
  525. package/src/styles/segmented-tabs.css +110 -36
  526. package/src/styles/select.css +151 -0
  527. package/src/styles/theme/bridges.css +22 -0
  528. package/src/styles/theme/radius.css +18 -1
  529. package/src/styles/tokens/color-radius.css +14 -4
  530. package/src/styles/tokens/dark-arm.css +94 -12
  531. package/src/styles/tokens/glass-deep.css +33 -4
  532. package/src/styles/tokens/glass-fx.css +122 -1
  533. package/src/styles/tokens/glass.css +226 -34
  534. package/src/styles/tokens/light-dark.css +3 -3
  535. package/src/styles/tokens/offsets.css +27 -0
  536. package/src/styles/tokens/property-regs.css +277 -0
  537. package/src/styles/tokens/scale-paper.css +86 -30
  538. package/src/styles/tokens/scheme-motion.css +106 -133
  539. package/src/styles/tokens/scheme-spring.css +239 -0
  540. package/src/styles/tokens/scroll-tokens.css +15 -15
  541. package/src/styles/tokens/shadow.css +73 -13
  542. package/src/styles/tokens/sizing-config.css +110 -0
  543. package/src/styles/tokens/sizing.css +55 -104
  544. package/src/styles/tokens.css +14 -2
  545. package/src/styles/typography/semantic.css +18 -5
  546. package/src/styles/utilities/a11y-overrides.css +20 -5
  547. package/src/styles/utilities/base-misc.css +52 -0
  548. package/src/styles/utilities/btn.css +84 -3
  549. package/src/styles/utilities/components.css +31 -6
  550. package/src/styles/utilities/metal.css +26 -0
  551. package/dist/ContextMenuContent-uWnVxDab.js +0 -85
  552. package/dist/DialogContent-DcKK8k9i.js +0 -103
  553. package/dist/DialogFooter-BZNX5aVr.js +0 -165
  554. package/dist/HoverCardContent-b2uaAMRR.js +0 -83
  555. package/dist/Input-h9v5LeXf.js +0 -55
  556. package/dist/NumberFieldContent-Cq7EzX-U.js +0 -138
  557. package/dist/PaperBackdrop-Vf3tlpvd.js +0 -31
  558. package/dist/SelectScrollDownButton-CrA8F0iV.js +0 -252
  559. package/dist/Separator-pKF0oA4M.js +0 -37
  560. package/dist/Switch-CwYNf8bo.js +0 -47
  561. package/dist/TooltipProvider-rzvnXz60.js +0 -104
  562. package/dist/badge-D9XWW4GT.js +0 -53
  563. package/dist/button-DYCUa-tH.js +0 -126
  564. package/dist/color-DweYl7pE.js +0 -86
  565. package/dist/components/custom/concentric/composables/ringField.d.ts +0 -44
  566. package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
  567. package/dist/components/custom/constellation/constellationDraw.d.ts +0 -30
  568. package/dist/components/custom/dock/DockRail.vue.d.ts +0 -89
  569. package/dist/createCanvasLifecycle-CHD5XrDW.js +0 -82
  570. package/dist/dockContext-BNfyPLe9.js +0 -17
  571. package/dist/procedural-color.wgsl-CToRHugY.js +0 -224
  572. package/dist/resolveCanvasColor-CUyHr5Uu.js +0 -11
  573. package/dist/slider-DVb4HXU-.js +0 -142
  574. package/dist/springPresets-CFQGQfdl.js +0 -40
  575. package/dist/styles/dock/rail-extend.css +0 -397
  576. package/dist/useLiquidPress-kfb4KX79.js +0 -39
  577. package/dist/usePointerVelocityField-JbRd5CrM.js +0 -137
  578. package/dist/useRAFLoop-UYa4zoiN.js +0 -109
  579. package/dist/useSpringPress-BsqPr7FJ.js +0 -34
  580. package/src/styles/dock/rail-extend.css +0 -397
  581. /package/dist/{CollapsibleContent-68dEXIAl.js → CollapsibleContent-D7UNsXQr.js} +0 -0
  582. /package/dist/{InstrumentChassis-Bx0F_q5g.js → InstrumentChassis-UUJX0-mW.js} +0 -0
  583. /package/dist/{Label-C2ejNWeC.js → Label-B_HPqi_q.js} +0 -0
  584. /package/dist/{ModalOverlay-D1VrWyoi.js → ModalOverlay-DfAf7o15.js} +0 -0
  585. /package/dist/{SelectGroup-DwwjicPY.js → SelectGroup-Dcczq44n.js} +0 -0
  586. /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-gLzyemvl.js} +0 -0
  587. /package/dist/{compile-CQEFRTmx.js → compile-INR_tPk_.js} +0 -0
  588. /package/dist/{constants-BPOqYJAm.js → constants-BWj7DkMn.js} +0 -0
  589. /package/dist/{createContext-CpBNTRMI.js → createContext-Cd23P9j0.js} +0 -0
  590. /package/dist/{math-BINYmg5z.js → math-5RcIgCB4.js} +0 -0
  591. /package/dist/{menuItemVariants-D8VNHq22.js → menuItemVariants-DAXquKja.js} +0 -0
  592. /package/dist/{prng-Za0Rmgag.js → prng-B5tIXTtj.js} +0 -0
  593. /package/dist/{useGlobalDark-C28t0VWJ.js → useGlobalDark-B4HO9LXG.js} +0 -0
  594. /package/dist/{useIntersectionPause-Bj4sPkMh.js → useIntersectionPause-DO8Vl4gs.js} +0 -0
  595. /package/dist/{useInterval-CvK1mL92.js → useInterval-BVUI-sez.js} +0 -0
  596. /package/dist/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BEut54Tk.js} +0 -0
  597. /package/dist/{useResizeObserver-Bpoi7tRE.js → useResizeObserver-DdEn3v2f.js} +0 -0
  598. /package/dist/{useResolveTokenColor-vAylyR0x.js → useResolveTokenColor-ChOnCckA.js} +0 -0
  599. /package/dist/{useScrollProgress-D7bYU2RK.js → useScrollProgress-A0M6qRl7.js} +0 -0
  600. /package/dist/{useSortable-DHjtZSEd.js → useSortable-DQV_UNDw.js} +0 -0
  601. /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-Bma3UlKA.js} +0 -0
  602. /package/dist/{useTimer-BHJOKr35.js → useTimer-BBLGPXR8.js} +0 -0
  603. /package/dist/{useUserInvalidAria-y5namzeE.js → useUserInvalidAria-EmmwWPOl.js} +0 -0
  604. /package/dist/{useViewportReady-anbac3m6.js → useViewportReady-C9pYnn7K.js} +0 -0
  605. /package/dist/{vReveal-Czsb7zQC.js → vReveal-CT1KtwZA.js} +0 -0
  606. /package/dist/{vSpecular-CQFmLNzA.js → vSpecular-EX7loENl.js} +0 -0
@@ -0,0 +1,56 @@
1
+ import type { OklchStop } from "../../../../composables/color";
2
+ import { type BasisComponent } from "../math";
3
+ /** One phasor lane in the storage buffer: (re, im, index, _pad). */
4
+ export declare const FOURIER_PHASOR_BYTES = 16;
5
+ export declare const FOURIER_COMPUTE_UNIFORM_BYTES = 32;
6
+ export interface FourierUniformScratch {
7
+ buffer: ArrayBuffer;
8
+ f32: Float32Array;
9
+ i32: Int32Array;
10
+ }
11
+ export declare function createFourierComputeScratch(): FourierUniformScratch;
12
+ /** Pack the compute uniforms in place. */
13
+ export declare function packFourierComputeUniforms(scratch: FourierUniformScratch, headT: number, trailArc: number, harmonicN: number, epicycleArmN: number, sampleCount: number, phasorCount: number): FourierUniformScratch;
14
+ export declare const FOURIER_RENDER_UNIFORM_BYTES: number;
15
+ export declare function createFourierRenderScratch(): FourierUniformScratch;
16
+ /** The model→clip fit transform (center + uniform scale) — computed once per spectrum. */
17
+ export interface FourierFit {
18
+ centerX: number;
19
+ centerY: number;
20
+ /** The uniform scale s such that (model − center)·s maps the curve into clip [-1,1] with margin. */
21
+ scale: number;
22
+ }
23
+ /**
24
+ * Stable view-fit: sample the FULL reconstruction once over the period, bound its bbox,
25
+ * and derive the center + a margin-padded uniform scale. The render's fullscreen pass
26
+ * inverts this transform per fragment so the curve never clips and the scale is fixed.
27
+ */
28
+ export declare function computeFourierFit(spectrum: readonly BasisComponent[]): FourierFit;
29
+ /**
30
+ * Map a MODEL-space head point to the stage's `[0,1]²` UV via the SAME fit + aspect the
31
+ * render's clip→model inverse uses (BD.W-FOURIER-LOOM §2a — the bloom-desync fence). The
32
+ * render maps clip = (model − center)·scale with the x clip un-aspect-corrected (clip.x is
33
+ * scaled by aspect in the inverse), so the forward is:
34
+ * clipX = (mx − cx)·scale / aspect, clipY = (my − cy)·scale, clip ∈ [-1,1].
35
+ * Then UV = (clipX·0.5 + 0.5, 1 − (clipY·0.5 + 0.5)) (CSS y grows DOWN; the lean is folded
36
+ * into `center` upstream so the bloom tracks the LEANED head). The result is NOT clamped —
37
+ * a head that leaves the stage carries the bloom off-edge honestly; the consumer clamps if
38
+ * it must paint a sprite. Pure arithmetic off the cached `fit` — no second CPU fit to drift.
39
+ */
40
+ export declare function headToUnit(headX: number, headY: number, fit: FourierFit, aspect: number): {
41
+ x: number;
42
+ y: number;
43
+ };
44
+ /**
45
+ * Convert a CSS-px stroke width to MODEL units (the shader's space). The fit `scale` maps
46
+ * model → clip; clip spans [-1,1] over the min CSS dimension → cssPx-per-clip = canvasCssMin/2.
47
+ * model-per-cssPx = (1/scale)·(2/canvasCssMin).
48
+ */
49
+ export declare function trailWidthToModel(trailWidthPx: number, scale: number, canvasCssMin: number): number;
50
+ /** Pack the render uniforms in place. */
51
+ export declare function packFourierRenderUniforms(scratch: FourierUniformScratch, fit: FourierFit, aspect: number, trailWidthModel: number, peakAlpha: number, headGlowAlpha: number, trailFadeExp: number, trailFloor: number, intensity: number, showEpicycles: boolean, rainbowChain: boolean, squashGain: number, celGain: number, sampleCount: number, armCount: number, palette: OklchStop[]): FourierUniformScratch;
52
+ /**
53
+ * Pack the phasor storage table (re, im, index, _pad) from the CPU-minted spectrum. The
54
+ * WGSL SUMS this per frame — it is the ONLY spectrum upload (no WGSL-side mint).
55
+ */
56
+ export declare function packPhasorTable(spectrum: readonly BasisComponent[]): Float32Array;
@@ -1,39 +1,63 @@
1
- import { type ShallowRef } from "vue";
2
- import { type ColorResolver } from "../../../../composables/color";
3
- /**
4
- * The renderer of `<FourierField>` — the Fourier-epicycle field on a Canvas2D
5
- * surface. Lifted out of the SFC into this composable (BB.W-CARVE3) so the
6
- * component file matches the colocation symmetry its GL/canvas siblings already
7
- * carry: Aurora→`useAurora.ts`, GooBlob→`useMetaballRenderer.ts`,
8
- * Constellation→`useConstellation.ts`. The SFC stays thin (props + the two
9
- * template refs + the single `useFourierField(props, …)` call).
10
- *
11
- * It composes the `useCanvas2D` substrate, inheriting the offscreen /
12
- * tab-hidden / reduced-motion freeze for free (no hand-rolled RAF-park). Color
13
- * resolves through the INJECTED `colorResolver` seam (the GooBlob model): a
14
- * `var()`/`light-dark()` token is first resolved to a concrete `rgb()` against
15
- * the host's inherited color-scheme, then re-resolved on a color change AND on a
16
- * dark-mode toggle so the field retints with the theme.
17
- */
18
- export interface FourierFieldRenderProps {
19
- /** Configuration bundle. `hero` = epicycles on, fewer harmonics; `final` = epicycles off, denser. */
20
- variant: "hero" | "final";
21
- /** Base CSS color (any form the resolver understands; a `var()`/`light-dark()` token resolves against the host). */
22
- color: string;
23
- /** REQUIRED color seam — resolves a concrete color to a gamma-sRGB [r,g,b] triple in [0,1]. */
24
- colorResolver: ColorResolver;
25
- /** Extra seed mixed into the spectrum PRNG for a unique-but-reproducible curve. */
26
- seed: string;
27
- /** When true, paint ONE static deterministic best-frame and never animate (the capture/export lever). */
28
- freeze: boolean;
29
- /** Outer loudness envelope (the Aurora `opacityCeiling` shape). Scales the resolved alphas at the PAINT layer; clamped [0, 2]. */
30
- intensity: number;
31
- /** OPTIONAL injected clock — a getter returning the loop parameter `t ∈ [0,1)` (the studio's controllable clock). */
32
- clock?: () => number;
1
+ import { type Ref } from "vue";
2
+ import { type GpuBackend } from "../../../../composables/glass/webgpu/useGpuSubstrate";
3
+ import type { OklchStop } from "../../../../composables/color";
4
+ import type { FourierFieldConfig } from "../constants";
5
+ import { type BasisComponent } from "../math";
6
+ export interface UseFourierFieldOptions {
7
+ config: FourierFieldConfig;
8
+ /** The active phasor spectrum (CPU-minted; re-read each frame so a source-swap reaches the buffer). */
9
+ getSpectrum: () => readonly BasisComponent[];
10
+ /** Resolve the curve-color palette as OKLCh (the demo themes it; default warm-identity). */
11
+ getPalette: () => OklchStop[];
12
+ /** When true, hold the deterministic best-frame and never advance (the capture / freeze lever). */
13
+ freeze?: () => boolean;
14
+ /** The static deterministic best-frame parameter under `freeze`/PRM. Default 0.34. */
15
+ frozenT?: number;
16
+ /** Base forward period for one full traversal at 1× speed, in seconds. Default 16. */
17
+ periodS?: number;
18
+ /** `"capture"` → renderAt-only (the deterministic π capture path). Default `"live"`. */
19
+ mode?: "live" | "capture";
20
+ /**
21
+ * BD.W-FOURIER-LOOM §2a — the lit-field seam hook. Fired ONCE per frame from INSIDE the
22
+ * ONE clock's `onFrame` (NO second rAF), AFTER `headT` advances, with the head's `[0,1]²`
23
+ * UV (or `null` before the canvas is sized). The SFC writes `--ff-head-xy` on its host so
24
+ * the warm field's phosphor bloom tracks the comet. PRM → fired with the STABLE frozen-T
25
+ * UV (the bloom seats, no sweep).
26
+ */
27
+ onHeadFrame?: (unit: {
28
+ x: number;
29
+ y: number;
30
+ } | null) => void;
33
31
  }
34
- /** The template refs the SFC owns; the composable reads them once the host is in the tree. */
35
- export interface FourierFieldRefs {
36
- hostRef: Readonly<ShallowRef<HTMLElement | null>>;
37
- canvasRef: Readonly<ShallowRef<HTMLCanvasElement | null>>;
32
+ /** The uniform handle a consumer wires its lifecycle against (backend-agnostic). */
33
+ export interface FourierFieldHandle {
34
+ /** The resolved backend (`"webgpu"` where supported, else the WebGL2 GLSL fallback). */
35
+ readonly backend: GpuBackend;
36
+ /** Park the loop (the WCAG-2.2.2 pause seam — `DockBackgroundToggle` wires this). */
37
+ pause: () => void;
38
+ /** Re-arm the loop. */
39
+ resume: () => void;
40
+ /** Re-arm a parked loop on demand. */
41
+ wake: () => void;
42
+ /** Draw one frame out-of-loop (capture / thumbnail). */
43
+ renderAt: (timeSec: number) => void;
44
+ /** The live `prefers-reduced-motion: reduce` state. */
45
+ readonly reducedMotion: boolean;
46
+ /** The current loop parameter `head_t ∈ [0,1)` (the scrubber reads/writes it). */
47
+ readonly headT: number;
48
+ /** Scrub the clock directly (the transport scrubber / a pointer drag). */
49
+ setHeadT: (t: number) => void;
50
+ /**
51
+ * BD.W-FOURIER-LOOM §2a — the comet head mapped to the stage's `[0,1]²` UV, off the SAME
52
+ * cached fit the GPU comet paints from. The SFC writes this to `--ff-head-xy` per frame so
53
+ * the warm field's phosphor bloom tracks the head (the lit-field seam). `null` before the
54
+ * canvas is sized. PRM → a STABLE frozen-T value (the bloom seats, no sweep).
55
+ */
56
+ headUnit: () => {
57
+ x: number;
58
+ y: number;
59
+ } | null;
60
+ /** Tear down the renderer + release GPU/GL resources. */
61
+ dispose: () => void;
38
62
  }
39
- export declare function useFourierField(props: FourierFieldRenderProps, { hostRef, canvasRef }: FourierFieldRefs): void;
63
+ export declare function useFourierField(canvasRef: Ref<HTMLCanvasElement | null>, options: UseFourierFieldOptions): FourierFieldHandle;
@@ -1,7 +1,117 @@
1
+ import type { OklchStop } from "../../../composables/color";
1
2
  /**
2
- * Curve-sampling resolution for the stable view-fit bbox pass — the renderer
3
- * samples the epicycle curve this many times once at mount to size it to the
4
- * canvas with a fixed margin (so the curve never clips and the scale is constant
5
- * across the run). 720 = one sample per half-degree of the unit period.
3
+ * Curve-sampling resolution for the stable view-fit bbox pass — the renderer samples the
4
+ * epicycle curve this many times once at mount to size it to the canvas with a fixed
5
+ * margin (so the curve never clips and the scale is constant across the run). 720 = one
6
+ * sample per half-degree of the unit period.
6
7
  */
7
8
  export declare const FOURIER_FIT_SAMPLES = 720;
9
+ /**
10
+ * The phasor-table uniform ceiling — the WGSL `MAX_PHASORS` #define. The configurator's
11
+ * harmonic count maxes here; a >64-term custom trace books a storage-buffer widen (cheap —
12
+ * the flow-field already uses a storage buffer). The curated ℱ/heart/star set + the
13
+ * generated elliptic spectrum all sit under it.
14
+ */
15
+ export declare const MAX_PHASORS = 64;
16
+ /**
17
+ * The comet-curve sample ceiling — the storage-buffer array bound. The compute pass
18
+ * writes the partial-sum curve point at `M` samples back along the period from the head;
19
+ * the render pass reads them as the comet polyline. 384 gives a smooth bold stroke.
20
+ */
21
+ export declare const MAX_CURVE_SAMPLES = 384;
22
+ /** The palette-stop ceiling — the WGSL `MAX_FOURIER_STOPS` #define. */
23
+ export declare const MAX_FOURIER_STOPS = 4;
24
+ /**
25
+ * The cursor-velocity → head_t clock-coupling gain (BD.W-VIZ-BROKEN-FIX D6 — the weighted
26
+ * scrub). The cursor MOTION (not its absolute X) nudges the loop clock: a flick fast-
27
+ * forwards, a still cursor lets the field drift at its config speed. Velocity-continuous —
28
+ * the head never teleports (the prior `headT = pointerX` absolute-X scrub read as "not
29
+ * following" a 2-D cursor).
30
+ */
31
+ export declare const SCRUB_GAIN = 0.15;
32
+ /**
33
+ * The 2-D cursor-FOLLOW lean depth (BD.W-VIZ-BROKEN-FIX D6b — the spatial follow beside the
34
+ * velocity scrub). A bounded fraction of the model half-span the view-fit center leans
35
+ * toward the cursor, so the whole reconstruction pans TOWARD the cursor on screen (a gentle
36
+ * pull, never a yank — the [[feedback-liquid-weight-universal]] weighted register). At 0
37
+ * the field is byte-identical (the ambient/non-interactive register).
38
+ */
39
+ export declare const FOLLOW_LEAN = 0.12;
40
+ /**
41
+ * The degenerate-tangent guard (BD.W-FOURIER-LOOM §2b). At a cusp the head's instantaneous
42
+ * speed `s = length(head − headBack)` collapses to ~0 and the unit tangent `T = d/s` blows
43
+ * up; below `FOURIER_TANGENT_EPS` the shaders + the GL CPU bead path all fall back to the
44
+ * LAST stable tangent, so `s→0` resolves IDENTICALLY across both engines (the cross-engine
45
+ * cusp-parity fence — one shared constant, no per-engine drift).
46
+ */
47
+ export declare const FOURIER_TANGENT_EPS = 0.0001;
48
+ /**
49
+ * The head squash-and-stretch gain (BD.W-FOURIER-LOOM §2b). The round head bead becomes a
50
+ * volume-preserving anisotropic ellipse: the tangent extent scales `1 + k·ŝ`, the normal
51
+ * extent `1/(1 + k·ŝ)`, where `ŝ` is the normalized head speed. The library identity carries
52
+ * a SMALL non-zero gain (cartoon-weight at rest — the head is never a dead disc); a consumer
53
+ * vivid preset turns it to 11. `0` = the byte-frozen round disc.
54
+ */
55
+ export declare const FOURIER_SQUASH_GAIN = 0.55;
56
+ /**
57
+ * The cartoon cel-shadow gain (BD.W-FOURIER-LOOM §3b). Each chain ring/arm/dot + the comet
58
+ * rope paints a second darker copy OFFSET opposite its travel — the 1940s technicolor ink.
59
+ * The library identity carries a SMALL non-zero gain (a quiet weight under the chain); a
60
+ * consumer vivid preset floors it UP. `0` = no cel pass (byte-frozen). The offset rides the
61
+ * head tangent, mirrored on both engines off the SAME `curveSamples` tangent.
62
+ */
63
+ export declare const FOURIER_CEL_GAIN = 0.35;
64
+ /**
65
+ * The full author schema — the studio's `useConfiguratorState` model. Every field is a
66
+ * tunable the demo configurator drives; the composable resolves it into the uniform table.
67
+ */
68
+ export interface FourierFieldConfig {
69
+ /** The active phasor spectrum source key — `"elliptic"` (generated) or a curated shape key. */
70
+ source: string;
71
+ /** TRUNCATE the partial sum — the harmonic count N (1..min(spectrum.length, MAX_PHASORS)). */
72
+ harmonics: number;
73
+ /** Draw the rotating epicycle chain (orthogonal to N). */
74
+ showEpicycles: boolean;
75
+ /** How many chain arms to draw (1..N; ≤ the harmonic count). */
76
+ epicycleArms: number;
77
+ /** Paint the chain as a warm-anchored hue sweep vs one analogous hue. */
78
+ rainbowChain: boolean;
79
+ /** Comet-body length as a fraction of the period (0.15..1.0). */
80
+ trailArc: number;
81
+ /** Comet stroke weight in CSS px (1..6). */
82
+ trailWidth: number;
83
+ /** Outer loudness envelope (per-layer alpha multiply, 0..2). */
84
+ intensity: number;
85
+ /** Character of the generated elliptic spectrum (0.05..0.4 — smooth ellipse → crinkled). */
86
+ harmonicScale: number;
87
+ /** Clock speed multiplier (0.25/0.5/1/2). */
88
+ speed: number;
89
+ /** The curve-color ramp (the library viz palette; warm default). Resolved via the ColorResolver. */
90
+ palette: OklchStop[];
91
+ /** ONE static frame then park under `prefers-reduced-motion: reduce`. */
92
+ respectReducedMotion: boolean;
93
+ /** Pointer scrubs `head_t` + a flick injects clock momentum (the W-VIZ-INTERACTION consume). */
94
+ interactive: boolean;
95
+ /**
96
+ * Head squash-and-stretch gain (BD.W-FOURIER-LOOM §2b). The head bead stretches along the
97
+ * curve tangent on straights, squashes across it on corners (volume-preserving). The
98
+ * library identity carries a small non-zero default (cartoon-weight at rest); a vivid
99
+ * consumer preset turns it to 11. 0 = the byte-frozen round disc.
100
+ */
101
+ squashGain: number;
102
+ /**
103
+ * Cartoon cel-shadow gain (BD.W-FOURIER-LOOM §3b). A second darker copy of the chain + rope,
104
+ * offset opposite the head travel (the technicolor ink). The library identity carries a
105
+ * small non-zero default; a vivid consumer preset floors it UP. 0 = no cel pass.
106
+ */
107
+ celGain: number;
108
+ }
109
+ /**
110
+ * The warm-cream identity palette (the library default — NOT teal). A two-stop warm-amber
111
+ * ramp over the warm-cream foreground family, resolved via the ColorResolver. The chain's
112
+ * rainbow sweep is warm-anchored over THIS base; a consumer (the demo) themes it through a
113
+ * preset, never a token edit.
114
+ */
115
+ export declare const WARM_IDENTITY_PALETTE: OklchStop[];
116
+ /** The shipped warm-identity default config. */
117
+ export declare const DEFAULT_FOURIER_CONFIG: FourierFieldConfig;
@@ -1,26 +1,31 @@
1
- import type { ColorResolver } from "../../../composables/color";
1
+ import type { ColorResolver, OklchStop } from "../../../composables/color";
2
+ import type { FourierFieldConfig } from "./constants";
3
+ import type { BasisComponent } from "./math";
2
4
  export { default as FourierField } from "./FourierField.vue";
3
5
  export { comp, positionsAt, partialSumAt, dftFromPoints, makeEllipticSpectrum, type BasisComponent, type EllipticSpectrumOptions, } from "./math";
4
- /** The configuration-BUNDLE axis — `hero` (epicycles on, fewer harmonics) vs
5
- * `final` (epicycles off, denser). Not a recolour of one curve; one engine,
6
- * two presets. */
7
- export type FourierFieldVariant = "hero" | "final";
8
- /** The props a consumer forwards when wrapping `<FourierField>` (the seeded
9
- * inverse-DFT epicycle background; ships via `/fourier-field`). Mirrors the
10
- * component's inline `defineProps` shape (an SFC cannot export its inline
11
- * props type). */
6
+ export { DEFAULT_FOURIER_CONFIG, WARM_IDENTITY_PALETTE, MAX_PHASORS, MAX_CURVE_SAMPLES, type FourierFieldConfig, } from "./constants";
7
+ export { useFourierField, type FourierFieldHandle, type UseFourierFieldOptions, } from "./composables/useFourierField";
8
+ /**
9
+ * The props a consumer forwards when wrapping `<FourierField>` (the GPU-substrate epicycle
10
+ * field; ships via `/fourier-field`). Mirrors the component's inline `defineProps` shape (an
11
+ * SFC cannot export its inline props type). BC.W-VIZ-FOURIER — the `variant: "hero"|"final"`
12
+ * enum is RETIRED (folds into config presets); the renderer is the WGSL-primary GPU substrate.
13
+ */
12
14
  export interface FourierFieldProps {
13
- /** Configuration bundle. Default `hero`. */
14
- variant?: FourierFieldVariant;
15
- /** Base CSS color (a `var()`/`light-dark()` token resolves against the host). */
16
- color: string;
17
- /** REQUIRED color seam — resolves a concrete color to a gamma-sRGB [r,g,b] triple in [0,1]. */
18
- colorResolver: ColorResolver;
19
- /** Extra seed mixed into the spectrum PRNG for a unique-but-reproducible curve. Default "". */
15
+ /** The full author config (the studio's `useConfiguratorState` model). Defaults to the warm identity. */
16
+ config?: FourierFieldConfig;
17
+ /** An explicit CPU-minted spectrum (a curated shape's DFT). When absent, a seeded elliptic spectrum is generated. */
18
+ spectrum?: readonly BasisComponent[];
19
+ /** Resolve the curve palette as OKLCh (the studio themes it). */
20
+ getPalette?: () => OklchStop[];
21
+ /** Ambient-consumer color seam — a `var()`/`light-dark()` token or a literal; derives a warm palette. */
22
+ color?: string;
23
+ /** The color resolver (the GooBlob/Aurora seam) — required when `color` is a `var()` token. */
24
+ colorResolver?: ColorResolver;
25
+ /** Extra seed mixed into the generated elliptic spectrum PRNG. Default "". */
20
26
  seed?: string;
21
27
  /** Paint ONE static deterministic best-frame and never animate (the capture lever). Default false. */
22
28
  freeze?: boolean;
23
- /** Outer loudness envelope (the Aurora `opacityCeiling` shape). Scales the
24
- * resolved `peakAlpha`/`headGlowAlpha` at the paint layer. Default 1; clamped [0, 2]. */
29
+ /** Outer loudness envelope (scales the per-layer alpha). Overrides `config.intensity` when set; clamped [0, 2]. */
25
30
  intensity?: number;
26
31
  }
@@ -0,0 +1 @@
1
+ export declare const FOURIER_FIELD_COMPUTE_WGSL = "\nconst MAX_PHASORS: i32 = 64;\nconst TAU: f32 = 6.283185307179586;\n\nstruct Phasor {\n // (re, im, index, _pad)\n data: vec4<f32>,\n};\n\n// \u2500\u2500 Compute uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct ComputeUniforms {\n // c0: (headT, trailArc, _pad, _pad)\n c0: vec4<f32>,\n // ints: (harmonicN, epicycleArmN, sampleCount, phasorCount)\n ints: vec4<i32>,\n};\n\n@group(0) @binding(0) var<uniform> u: ComputeUniforms;\n@group(0) @binding(1) var<storage, read> phasors: array<Phasor>;\n// curveSamples[i] = (x, y, age, _pad)\n@group(0) @binding(2) var<storage, read_write> curveSamples: array<vec4<f32>>;\n// chainTips[k] = (x, y, _pad, _pad) \u2014 the running tip after stacking phasor k\n@group(0) @binding(3) var<storage, read_write> chainTips: array<vec4<f32>>;\n\n// The PARTIAL-SUM curve point at parameter t over the first n phasors \u2014 the WGSL\n// transcription of math.ts:78-95 (partialSumAt). EXACTLY:\n// c += vec2(re\u00B7cos \u2212 im\u00B7sin, re\u00B7sin + im\u00B7cos) with angle = TAU\u00B7index\u00B7t.\nfn partialSumAt(t: f32, n: i32) -> vec2<f32> {\n var c = vec2<f32>(0.0, 0.0);\n let phasorCount = u.ints.w;\n let lim = min(n, phasorCount);\n for (var i = 0; i < MAX_PHASORS; i = i + 1) {\n if (i >= lim) { break; }\n let p = phasors[i].data;\n let re = p.x;\n let im = p.y;\n let index = p.z;\n let angle = TAU * index * t;\n let cs = cos(angle);\n let sn = sin(angle);\n c = c + vec2<f32>(re * cs - im * sn, re * sn + im * cs);\n }\n return c;\n}\n\n// The epicycle chain tip after stacking the first k phasors at head_t \u2014 the WGSL\n// transcription of math.ts:41-60 (positionsAt, read at the running tip). The running tip\n// after phasor (k\u22121) is exactly the partial sum over the first k terms.\nfn epicycleChainTip(t: f32, k: i32) -> vec2<f32> {\n return partialSumAt(t, k);\n}\n\n@compute @workgroup_size(64)\nfn cs_main(@builtin(global_invocation_id) gid: vec3<u32>) {\n let i = i32(gid.x);\n let headT = u.c0.x;\n let trailArc = u.c0.y;\n let harmonicN = u.ints.x;\n let armN = u.ints.y;\n let sampleCount = u.ints.z;\n\n // \u2500\u2500 The comet body samples \u2500\u2500\n if (i < sampleCount) {\n // age: 0 at the oldest tail (i = sampleCount\u22121), 1 at the head (i = 0).\n let denom = max(f32(sampleCount - 1), 1.0);\n let frac = f32(i) / denom; // 0 = head, 1 = tail\n let age = 1.0 - frac; // 1 = head, 0 = tail\n // sample back along the period from the head by trailArc.\n var t = headT - trailArc * frac;\n t = t - floor(t); // fract \u2192 [0,1)\n let pt = partialSumAt(t, harmonicN);\n curveSamples[i] = vec4<f32>(pt.x, pt.y, age, 0.0);\n }\n\n // \u2500\u2500 The epicycle chain tips (k = 0..armN, capped to harmonicN) \u2500\u2500\n // chainTips[0] is the origin; chainTips[k] is the tip after phasor (k\u22121).\n let armLim = min(armN, harmonicN);\n if (i <= armLim && i <= MAX_PHASORS) {\n let tip = epicycleChainTip(headT, i);\n chainTips[i] = vec4<f32>(tip.x, tip.y, 0.0, 0.0);\n }\n}\n";
@@ -0,0 +1,4 @@
1
+ /** The full-screen-triangle vertex shader (the aurora/concentric pattern). */
2
+ export declare const FOURIER_FIELD_VERT_GLSL = "#version 300 es\nin vec2 aPosition;\nout vec2 vClip;\nvoid main() {\n vClip = aPosition;\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}\n";
3
+ /** The fragment SDF — the GLSL twin of fourier-field.render.wgsl.ts's fs_main. */
4
+ export declare const FOURIER_FIELD_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define MAX_CURVE_SAMPLES 256\n#define MAX_PHASORS 64\n// BD.W-FOURIER-LOOM \u00A72b \u2014 MUST equal the WGSL twin + FOURIER_TANGENT_EPS (constants.ts).\n#define TANGENT_EPS 1e-4\n#define SPEED_REF_HALFWIDTHS 6.0\n\nin vec2 vClip;\nout vec4 fragColor;\n\nuniform vec4 uFit; // (centerX, centerY, scale, aspect)\nuniform vec4 uTrail; // (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)\nuniform vec4 uEnv; // (trailFloor, intensity, showEpicycles, rainbowChain)\nuniform vec4 uLoom; // (squashGain, celGain, _pad, _pad) \u2014 FOURIER-LOOM \u00A72b/\u00A73b\nuniform int uSampleCount;\nuniform int uArmCount;\nuniform int uStopCount;\nuniform vec3 uPalette[4]; // linear-sRGB stops\n// curveSamples[i] = (x, y, age) in MODEL space; chainTips[k] = (x, y) in MODEL space.\nuniform vec3 uCurve[MAX_CURVE_SAMPLES];\nuniform vec2 uChain[MAX_PHASORS];\n\nconst float PI = 3.141592653589793;\n\n\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// value.js LINEAR_SRGB_TO_LMS (constants.ts), row-major; written here as GLSL\n// columns (= the transpose) so mat3 * vec3 evaluates the row-major M\u00B7v.\nconst mat3 LINEAR_SRGB_TO_LMS = mat3(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS\u2192OKLab coefficients (gamut.ts lines 295-297 \u2014\n// these differ at the ~1e-9 digit from LMS_TO_OKLAB_MATRIX; use the inline ones to\n// mirror the exact value.js path), row-major \u2192 GLSL columns.\nconst mat3 LMS_TO_OKLAB = mat3(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF (constants.ts), row-major \u2192 GLSL columns. Rows:\n// l = [1, 0.3963377774, 0.2158037573], m = [1, -0.1055613458, -0.0638541728],\n// s = [1, -0.0894841775, -1.2914855480].\nconst mat3 OKLAB_TO_LMS = mat3(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB (constants.ts), row-major \u2192 GLSL columns.\nconst mat3 LMS_TO_LINEAR_SRGB = mat3(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\n// Gamma sRGB \u2192 raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nvec3 srgbToOklab(vec3 c) {\n vec3 lin = srgbToLinear(c);\n vec3 lms = LINEAR_SRGB_TO_LMS * lin;\n vec3 lmsCbrt = sign(lms) * pow(abs(lms), vec3(1.0 / 3.0));\n return LMS_TO_OKLAB * lmsCbrt;\n}\n\n// Raw OKLab (L, a, b) \u2192 linear sRGB. Mirrors value.js oklabToLinearSRGB.\nvec3 oklabToLinearSrgb(vec3 lab) {\n vec3 lms_ = OKLAB_TO_LMS * lab;\n vec3 lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab \u2192 OKLCh: H in RADIANS. Mirrors value.js rawOklabToOklch (which returns\n// degrees; we stay in radians and only fold to [0, 2pi)).\nvec3 oklabToOklch(vec3 lab) {\n float C = length(lab.yz);\n float H = atan(lab.z, lab.y);\n if (H < 0.0) H += 2.0 * PI;\n return vec3(lab.x, C, H);\n}\n\n// OKLCh (H radians) \u2192 OKLab. Mirrors value.js rawOklchToOklab.\nvec3 oklchToOklab(vec3 lch) {\n return vec3(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}\n\n// Negative-safe cube root (the WGSL chunk's cbrt3 twin; the GLSL chunk inlines it).\nvec3 cbrt3(vec3 v) { return sign(v) * pow(abs(v), vec3(1.0 / 3.0)); }\n\nvec3 samplePaletteLin(float t) {\n if (uStopCount <= 1) return uPalette[0];\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n vec3 labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * uPalette[i0]);\n vec3 labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * uPalette[i1]);\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\nvec3 chainColorLin(float seg, bool rainbow) {\n vec3 baseLin = uPalette[0];\n if (!rainbow) return baseLin;\n vec3 lab = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * baseLin);\n vec3 lch = oklabToOklch(lab);\n float hueShift = mix(-0.45, 1.15, clamp(seg, 0.0, 1.0));\n vec3 lifted = vec3(0.66, max(lch.y, 0.14), lch.z + hueShift);\n return oklabToLinearSrgb(oklchToOklab(lifted));\n}\n\nfloat segDist(vec2 p, vec2 a, vec2 b) {\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-8), 0.0, 1.0);\n return length(pa - ba * h);\n}\n\n// BD.W-FOURIER-LOOM \u00A72b \u2014 the head travel frame (T, \u015D), the GLSL twin of the WGSL headFrame.\n// The cusp guard returns +x as the stable fallback when s \u2264 TANGENT_EPS \u2014 identical to the\n// WGSL twin + the CPU bead path.\nstruct HeadFrame { vec2 T; float sHat; };\nHeadFrame headFrame(vec2 head, vec2 headBack, float halfW) {\n vec2 d = head - headBack;\n float s = length(d);\n HeadFrame fr;\n if (s <= TANGENT_EPS) { fr.T = vec2(1.0, 0.0); fr.sHat = 0.0; return fr; }\n fr.T = d / s;\n float refScale = max(halfW * SPEED_REF_HALFWIDTHS, 1e-6);\n fr.sHat = clamp(s / refScale, 0.0, 1.0);\n return fr;\n}\n\n// The volume-preserving anisotropic head distance (the WGSL headAniso twin).\nfloat headAniso(vec2 p, vec2 head, HeadFrame fr, float k) {\n float g = 1.0 + k * fr.sHat;\n vec2 n = vec2(-fr.T.y, fr.T.x);\n vec2 rel = p - head;\n float along = dot(rel, fr.T) / g;\n float across = dot(rel, n) * g;\n return length(vec2(along, across));\n}\n\nvoid main() {\n vec2 center = uFit.xy;\n float scale = max(uFit.z, 1e-6);\n float aspect = max(uFit.w, 1e-4);\n // clip \u2192 model (the inverse of model\u2192clip fit).\n vec2 p = center + vec2(vClip.x * aspect, vClip.y) / scale;\n\n float aa = max(fwidth(p.x) + fwidth(p.y), 1e-5) * 0.75;\n float trailWidth = uTrail.x; // already in model units (packed CPU-side)\n float peak = uTrail.y * uEnv.y;\n float headGlow = uTrail.z * uEnv.y;\n float fadeExp = uTrail.w;\n float trailFloor = uEnv.x;\n bool showEpicycles = uEnv.z > 0.5;\n bool rainbow = uEnv.w > 0.5;\n float squashGain = uLoom.x; // FOURIER-LOOM \u00A72b\n float celGain = uLoom.y; // FOURIER-LOOM \u00A73b\n float halfW = trailWidth * 0.5;\n\n // \u00A72b \u2014 the head travel frame (SAME uCurve[0]/[1] the WGSL twin reads \u2192 parity).\n HeadFrame headFr;\n headFr.T = vec2(1.0, 0.0);\n headFr.sHat = 0.0;\n if (uSampleCount >= 2) {\n headFr = headFrame(uCurve[0].xy, uCurve[1].xy, halfW);\n }\n vec2 celOff = -headFr.T * halfW * 1.4;\n\n vec4 accum = vec4(0.0);\n\n // \u00A73b \u2014 the cartoon CEL-SHADOW: a darker offset copy of the rope + chain, opposite travel,\n // painted FIRST (under the lit chain). PRM-static; celGain = 0 \u2192 no pass (byte-frozen).\n if (celGain > 0.001) {\n vec3 ink = vec3(0.0);\n float celA = clamp(celGain, 0.0, 1.0);\n for (int i = 0; i < MAX_CURVE_SAMPLES; i++) {\n if (i >= uSampleCount - 1) break;\n vec2 sa = uCurve[i].xy + celOff;\n vec2 sb = uCurve[i + 1].xy + celOff;\n float d = segDist(p, sa, sb);\n float cover = 1.0 - smoothstep(halfW, halfW + aa, d);\n if (cover < 0.002) continue;\n float m = cover * celA * peak;\n accum = vec4(ink * m, m) + accum * (1.0 - m);\n }\n if (showEpicycles && uArmCount >= 1) {\n for (int k = 0; k < MAX_PHASORS; k++) {\n if (k >= uArmCount) break;\n vec2 a = uChain[k] + celOff;\n vec2 b = uChain[k + 1] + celOff;\n float dArm = segDist(p, a, b);\n float armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);\n float m = armMask * celA * peak * 0.7;\n accum = vec4(ink * m, m) + accum * (1.0 - m);\n }\n }\n }\n\n if (showEpicycles && uArmCount >= 1) {\n for (int k = 0; k < MAX_PHASORS; k++) {\n if (k >= uArmCount) break;\n vec2 a = uChain[k];\n vec2 b = uChain[k + 1];\n float seg = float(k) / max(float(uArmCount - 1), 1.0);\n vec3 lin = chainColorLin(seg, rainbow);\n float radius = length(b - a);\n float dRing = abs(length(p - a) - radius);\n float ringW = max(halfW * 0.45, aa);\n float ringMask = (1.0 - smoothstep(ringW, ringW + aa, dRing)) * 0.5;\n float dArm = segDist(p, a, b);\n float armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);\n float dotR = max(halfW * 0.7, aa * 2.0);\n float dDot = length(p - a);\n float dotMask = 1.0 - smoothstep(dotR, dotR + aa, dDot);\n float m = clamp(max(max(ringMask, armMask), dotMask), 0.0, 1.0) * peak * 0.7;\n vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));\n accum = vec4(rgb * m, m) + accum * (1.0 - m);\n }\n }\n\n for (int i = 0; i < MAX_CURVE_SAMPLES; i++) {\n if (i >= uSampleCount - 1) break;\n vec3 sa = uCurve[i];\n vec3 sb = uCurve[i + 1];\n float d = segDist(p, sa.xy, sb.xy);\n float cover = 1.0 - smoothstep(halfW, halfW + aa, d);\n if (cover < 0.002) continue;\n float age = max(sa.z, sb.z);\n float a = peak * pow(age, fadeExp);\n a = max(a, peak * trailFloor) * cover;\n vec3 lin = samplePaletteLin(1.0 - age * 0.4);\n vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));\n accum = vec4(rgb * a, a) + accum * (1.0 - a);\n }\n\n if (uSampleCount >= 1) {\n vec2 head = uCurve[0].xy;\n // \u00A72b \u2014 the squash-and-stretch anisotropic head (collapses to the round disc at rest).\n float dHead = headAniso(p, head, headFr, squashGain);\n float coreR = halfW * 1.5;\n float haloR = coreR * 3.0;\n vec3 headRgb = clamp(linearToSrgb(samplePaletteLin(0.0)), vec3(0.0), vec3(1.0));\n float halo = (1.0 - smoothstep(0.0, haloR, dHead)) * headGlow * 0.35;\n accum = vec4(headRgb * halo, halo) + accum * (1.0 - halo);\n float core = (1.0 - smoothstep(coreR, coreR + aa, dHead)) * headGlow;\n accum = vec4(headRgb * core, core) + accum * (1.0 - core);\n float spec = (1.0 - smoothstep(coreR * 0.4, coreR * 0.4 + aa, dHead)) * headGlow * 0.9;\n accum = vec4(vec3(1.0) * spec, spec) + accum * (1.0 - spec);\n }\n\n fragColor = accum;\n}\n";
@@ -0,0 +1 @@
1
+ export declare const FOURIER_FIELD_RENDER_WGSL = "\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst MAX_CURVE_SAMPLES: i32 = 384;\nconst MAX_PHASORS: i32 = 64;\nconst MAX_FOURIER_STOPS: i32 = 4;\n// BD.W-FOURIER-LOOM \u00A72b \u2014 the degenerate-tangent guard (must equal FOURIER_TANGENT_EPS in\n// constants.ts + the GL CPU bead path so a cusp resolves IDENTICALLY across both engines).\nconst TANGENT_EPS: f32 = 1e-4;\n// The speed yardstick: the head speed (model units between curveSamples[0] and [1]) is\n// normalized against this many trail half-widths so \u015D \u2208 [0,1] is scale-free + parity-safe.\nconst SPEED_REF_HALFWIDTHS: f32 = 6.0;\n\n// \u2500\u2500 Render uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct RenderUniforms {\n // r0: (centerX, centerY, scale, aspect) \u2014 model\u2192clip fit transform\n r0: vec4<f32>,\n // r1: (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)\n r1: vec4<f32>,\n // r2: (trailFloor, intensity, showEpicycles, rainbowChain)\n r2: vec4<f32>,\n // r3: (squashGain, celGain, _pad, _pad) \u2014 FOURIER-LOOM \u00A72b/\u00A73b\n r3: vec4<f32>,\n // ints: (sampleCount, armCount, stopCount, _pad)\n ints: vec4<i32>,\n // palette stops: linear-sRGB rgb + _pad\n palette: array<vec4<f32>, 4>,\n};\n\n@group(0) @binding(0) var<uniform> u: RenderUniforms;\n// curveSamples[i] = (x, y, age, _pad) in MODEL space\n@group(0) @binding(1) var<storage, read> curveSamples: array<vec4<f32>>;\n// chainTips[k] = (x, y, _pad, _pad) in MODEL space\n@group(0) @binding(2) var<storage, read> chainTips: array<vec4<f32>>;\n\n\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// value.js LINEAR_SRGB_TO_LMS, row-major \u2192 WGSL columns (= the transpose).\nconst LINEAR_SRGB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS\u2192OKLab coefficients, row-major \u2192 WGSL columns.\nconst LMS_TO_OKLAB: mat3x3<f32> = mat3x3<f32>(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF, row-major \u2192 WGSL columns.\nconst OKLAB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB, row-major \u2192 WGSL columns.\nconst LMS_TO_LINEAR_SRGB: mat3x3<f32> = mat3x3<f32>(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\nfn cbrt3(v: vec3<f32>) -> vec3<f32> {\n return sign(v) * pow(abs(v), vec3<f32>(1.0 / 3.0));\n}\n\n// Gamma sRGB \u2192 raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nfn srgbToOklab(c: vec3<f32>) -> vec3<f32> {\n let lin = srgbToLinear(c);\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\n// Raw OKLab (L, a, b) \u2192 linear sRGB. Mirrors value.js oklabToLinearSRGB.\nfn oklabToLinearSrgb(lab: vec3<f32>) -> vec3<f32> {\n let lms_ = OKLAB_TO_LMS * lab;\n let lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab \u2192 OKLCh: H in RADIANS, folded to [0, 2pi). Mirrors value.js rawOklabToOklch.\nfn oklabToOklch(lab: vec3<f32>) -> vec3<f32> {\n let C = length(lab.yz);\n var H = atan2(lab.z, lab.y);\n if (H < 0.0) { H = H + 2.0 * PI; }\n return vec3<f32>(lab.x, C, H);\n}\n\n// OKLCh (H radians) \u2192 OKLab. Mirrors value.js rawOklchToOklab.\nfn oklchToOklab(lch: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}\n\n// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].\nfn samplePaletteLin(t: f32) -> vec3<f32> {\n let stopCount = u.ints.z;\n if (stopCount <= 1) { return u.palette[0].rgb; }\n let n = f32(stopCount);\n let ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n let i0 = i32(floor(ft));\n let i1 = min(i0 + 1, stopCount - 1);\n let f = ft - f32(i0);\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\n// A warm-anchored chain hue sweep over the palette base \u2014 the rainbow chain register.\n// Tilts the base hue by a tight warm-ward band so the chain stays colourful but warm.\nfn chainColorLin(seg: f32, rainbow: bool) -> vec3<f32> {\n let baseLin = u.palette[0].rgb;\n if (!rainbow) { return baseLin; }\n let lab = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * baseLin);\n let lch = oklabToOklch(lab);\n // warm-anchored: a touch cool at the root climbing warm toward the tips.\n let hueShift = mix(-0.45, 1.15, clamp(seg, 0.0, 1.0)); // radians (~ -26\u00B0..+66\u00B0)\n let h = lch.z + hueShift;\n let lifted = vec3<f32>(0.66, max(lch.y, 0.14), h);\n return oklabToLinearSrgb(oklchToOklab(lifted));\n}\n\n// Distance from point p to segment ab (model space).\nfn segDist(p: vec2<f32>, a: vec2<f32>, b: vec2<f32>) -> f32 {\n let pa = p - a;\n let ba = b - a;\n let h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-8), 0.0, 1.0);\n return length(pa - ba * h);\n}\n\n// BD.W-FOURIER-LOOM \u00A72b \u2014 the head travel frame: the unit tangent T from curveSamples[0]\n// (head) vs [1] (one step back) + the normalized speed \u015D \u2208 [0,1]. The cusp guard returns\n// the +x axis as the stable fallback when s \u2264 TANGENT_EPS, identical to the GL CPU path.\nstruct HeadFrame { T: vec2<f32>, sHat: f32, };\nfn headFrame(head: vec2<f32>, headBack: vec2<f32>, halfW: f32) -> HeadFrame {\n let d = head - headBack;\n let s = length(d);\n var out: HeadFrame;\n if (s <= TANGENT_EPS) {\n out.T = vec2<f32>(1.0, 0.0);\n out.sHat = 0.0;\n return out;\n }\n out.T = d / s;\n let refScale = max(halfW * SPEED_REF_HALFWIDTHS, 1e-6);\n out.sHat = clamp(s / refScale, 0.0, 1.0);\n return out;\n}\n\n// The volume-preserving anisotropic head distance: project (p \u2212 head) onto T and T\u22A5, stretch\n// the tangent extent by (1 + k\u00B7\u015D) and squeeze the normal extent by 1/(1 + k\u00B7\u015D), then length.\n// k = 0 (or \u015D = 0) collapses to the round disc length(p \u2212 head) \u2014 byte-frozen at rest.\nfn headAniso(p: vec2<f32>, head: vec2<f32>, fr: HeadFrame, k: f32) -> f32 {\n let g = 1.0 + k * fr.sHat;\n let n = vec2<f32>(-fr.T.y, fr.T.x);\n let rel = p - head;\n let along = dot(rel, fr.T) / g;\n let across = dot(rel, n) * g;\n return length(vec2<f32>(along, across));\n}\n\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) model: vec2<f32>, // model-space coordinate of this fragment\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n // Full-screen triangle (covers the viewport with 3 verts).\n var p = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -3.0), vec2<f32>(-1.0, 1.0), vec2<f32>(3.0, 1.0),\n );\n let clip = p[vi];\n // Inverse of the model\u2192clip fit: clip = (model \u2212 center)\u00B7scale, aspect-corrected x.\n // \u2192 model = center + clip\u00B7(1/scale), x un-aspect-corrected.\n let center = u.r0.xy;\n let scale = max(u.r0.z, 1e-6);\n let aspect = max(u.r0.w, 1e-4);\n let model = center + vec2<f32>(clip.x * aspect, clip.y) / scale;\n\n var out: VSOut;\n out.pos = vec4<f32>(clip, 0.0, 1.0);\n out.model = model;\n return out;\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n let p = in.model;\n // AA feather: one device pixel in model units (fwidth of the model coord).\n let aa = max(fwidth(p.x) + fwidth(p.y), 1e-5) * 0.75;\n\n let trailWidth = u.r1.x; // already in model units (packed CPU-side)\n let peak = u.r1.y * u.r2.y; // peakAlpha \u00B7 intensity\n let headGlow = u.r1.z * u.r2.y;\n let fadeExp = u.r1.w;\n let trailFloor = u.r2.x;\n let sampleCount = u.ints.x;\n let armCount = u.ints.y;\n let showEpicycles = u.r2.z > 0.5;\n let rainbow = u.r2.w > 0.5;\n let squashGain = u.r3.x; // FOURIER-LOOM \u00A72b\n let celGain = u.r3.y; // FOURIER-LOOM \u00A73b\n let halfW = trailWidth * 0.5;\n\n // BD.W-FOURIER-LOOM \u00A72b \u2014 the head travel frame (the SAME curveSamples[0]/[1] both engines\n // read \u2192 parity by construction). The cel offset (\u00A73b) rides \u2212T (opposite travel).\n var headFr: HeadFrame;\n headFr.T = vec2<f32>(1.0, 0.0);\n headFr.sHat = 0.0;\n if (sampleCount >= 2) {\n headFr = headFrame(curveSamples[0].xy, curveSamples[1].xy, halfW);\n }\n let celOff = -headFr.T * halfW * 1.4; // the ink lags behind the travel\n\n var accum = vec4<f32>(0.0); // premultiplied accumulation\n\n // \u2500\u2500 \u00A73b \u2014 the cartoon CEL-SHADOW: a darker offset copy of the chain + rope, opposite\n // travel, painted FIRST (it sits UNDER the lit chain). PRM-static (the frozen-T travel\n // frame is a fixed offset, no live sweep). celGain = 0 \u2192 no pass (byte-frozen). \u2500\u2500\n if (celGain > 0.001) {\n let ink = vec3<f32>(0.0); // pure ink \u2014 the technicolor 2-tone shadow\n let celA = clamp(celGain, 0.0, 1.0);\n // the rope cel (one offset distance-to-curve band).\n for (var i = 0; i < MAX_CURVE_SAMPLES; i = i + 1) {\n if (i >= sampleCount - 1) { break; }\n let sa = curveSamples[i].xy + celOff;\n let sb = curveSamples[i + 1].xy + celOff;\n let d = segDist(p, sa, sb);\n let cover = 1.0 - smoothstep(halfW, halfW + aa, d);\n if (cover < 0.002) { continue; }\n let m = cover * celA * peak;\n accum = vec4<f32>(ink * m, m) + accum * (1.0 - m);\n }\n // the chain cel (arms only \u2014 the bold scaffold ink).\n if (showEpicycles && armCount >= 1) {\n for (var k = 0; k < MAX_PHASORS; k = k + 1) {\n if (k >= armCount) { break; }\n let a = chainTips[k].xy + celOff;\n let b = chainTips[k + 1].xy + celOff;\n let dArm = segDist(p, a, b);\n let armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);\n let m = armMask * celA * peak * 0.7;\n accum = vec4<f32>(ink * m, m) + accum * (1.0 - m);\n }\n }\n }\n\n // \u2500\u2500 Epicycle scaffolding (orbit rings + arms + joint dots) UNDER the curve \u2500\u2500\n if (showEpicycles && armCount >= 1) {\n for (var k = 0; k < MAX_PHASORS; k = k + 1) {\n if (k >= armCount) { break; }\n let a = chainTips[k].xy;\n let b = chainTips[k + 1].xy;\n let seg = f32(k) / max(f32(armCount - 1), 1.0);\n let lin = chainColorLin(seg, rainbow);\n // orbit RING around a (radius = arm length).\n let radius = length(b - a);\n let dRing = abs(length(p - a) - radius);\n let ringW = max(halfW * 0.45, aa);\n let ringMask = (1.0 - smoothstep(ringW, ringW + aa, dRing)) * 0.5;\n // ARM segment a\u2192b.\n let dArm = segDist(p, a, b);\n let armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);\n // joint DOT at a.\n let dotR = max(halfW * 0.7, aa * 2.0);\n let dDot = length(p - a);\n let dotMask = 1.0 - smoothstep(dotR, dotR + aa, dDot);\n let m = clamp(max(max(ringMask, armMask), dotMask), 0.0, 1.0) * peak * 0.7;\n let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));\n // over-composite (premultiplied).\n accum = vec4<f32>(rgb * m, m) + accum * (1.0 - m);\n }\n }\n\n // \u2500\u2500 The comet TRAIL \u2014 min-distance to the curve polyline, per-segment age fade \u2500\u2500\n for (var i = 0; i < MAX_CURVE_SAMPLES; i = i + 1) {\n if (i >= sampleCount - 1) { break; }\n let sa = curveSamples[i];\n let sb = curveSamples[i + 1];\n let d = segDist(p, sa.xy, sb.xy);\n let cover = 1.0 - smoothstep(halfW, halfW + aa, d);\n if (cover < 0.002) { continue; }\n let age = max(sa.z, sb.z); // 1 at head, 0 at tail\n var a = peak * pow(age, fadeExp);\n a = max(a, peak * trailFloor);\n a = a * cover;\n let lin = samplePaletteLin(1.0 - age * 0.4); // warm core, lighter tail\n let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));\n accum = vec4<f32>(rgb * a, a) + accum * (1.0 - a);\n }\n\n // \u2500\u2500 The comet HEAD \u2014 squash-and-stretch (\u00A72b) halo + saturated core + white specular.\n // dHead is the volume-preserving anisotropic distance off the travel frame; at rest\n // (sHat=0) or squashGain=0 it collapses to the round disc length(p \u2212 head). \u2500\u2500\n if (sampleCount >= 1) {\n let head = curveSamples[0].xy;\n let dHead = headAniso(p, head, headFr, squashGain);\n let coreR = halfW * 1.5;\n let haloR = coreR * 3.0;\n let headLin = samplePaletteLin(0.0);\n let headRgb = clamp(linearToSrgb(headLin), vec3<f32>(0.0), vec3<f32>(1.0));\n // soft halo\n let halo = (1.0 - smoothstep(0.0, haloR, dHead)) * headGlow * 0.35;\n accum = vec4<f32>(headRgb * halo, halo) + accum * (1.0 - halo);\n // saturated core\n let core = (1.0 - smoothstep(coreR, coreR + aa, dHead)) * headGlow;\n accum = vec4<f32>(headRgb * core, core) + accum * (1.0 - core);\n // white specular\n let spec = (1.0 - smoothstep(coreR * 0.4, coreR * 0.4 + aa, dHead)) * headGlow * 0.9;\n accum = vec4<f32>(vec3<f32>(1.0) * spec, spec) + accum * (1.0 - spec);\n }\n\n return accum;\n}\n";
@@ -1,4 +1,4 @@
1
- import type { BlobMood, BlobConfig } from "./types";
1
+ import type { BlobMood, BlobConfig, BlobVariant } from "./types";
2
2
  /**
3
3
  * GooBlob — a gooey metaball creature on a WebGL2 canvas.
4
4
  *
@@ -30,6 +30,14 @@ type __VLS_Props = {
30
30
  * The metaball tuning. Pass `BLOB_CONFIG_DEFAULTS` for the stock look.
31
31
  */
32
32
  config?: BlobConfig;
33
+ /**
34
+ * BC.W-GOOBLOB-PLAIN — the render-variant axis. `"blob"` is the STAGE-1
35
+ * shadowless lightless fill-only floor; `"meatball"` (default) is the full lit
36
+ * register. When set it WINS the resolved config's `variant` (the per-instance
37
+ * override); unset, the config's own `variant` rules. STAGE 1's `uStage` gate
38
+ * strips the lit/shadow blocks for the `"blob"` register.
39
+ */
40
+ variant?: BlobVariant;
33
41
  /** Extra seed string mixed into the satellite PRNG for a unique-but-reproducible system. */
34
42
  seed?: string;
35
43
  /**
@@ -4,3 +4,4 @@ export declare function easeInOut(t: number): number;
4
4
  export declare function easeIn(t: number): number;
5
5
  /** Quadratic ease-out (the satellite retract ramp). */
6
6
  export declare function easeOut(t: number): number;
7
+ export declare function fissionSnap(t: number): number;
@@ -9,6 +9,7 @@ export declare function useBlobSatellites(config: BlobConfig, initialColor: stri
9
9
  tick: (now: number, mood: MoodParams) => void;
10
10
  nudge: () => void;
11
11
  reseed: (color: string) => void;
12
+ onPinch: (cb: (impulse: number) => void) => void;
12
13
  isQuiescent: () => boolean;
13
14
  nextEventMs: (now: number) => number;
14
15
  };
@@ -53,5 +53,30 @@ export declare const BASE_OPACITY = 0.75;
53
53
  export declare const ORBIT_BLEND_MS = 2000;
54
54
  /** Minimum spacing (ms) between satellite merge events. */
55
55
  export declare const MERGE_STAGGER_MS = 3000;
56
- export declare const UNIFORM_NAMES: readonly ["uResolution", "uTime", "uBaseColor", "uPointer", "uPointerActive", "uPointerAttraction", "uPointerStrength", "uBodyRadius", "uPulsePhase", "uPulseAmp", "uNoiseAmp", "uNoiseFreq", "uNoiseSpeed", "uWarpAmp", "uSmoothK", "uMerge", "uMaxReach", "uLit", "uRimColor", "uLightDir", "uSpecStrength", "uSpecShininess", "uRimPower", "uRimStrength", "uIridescence", "uIridHue", "uIridSpeed", "uSssScale", "uSssPower", "uCoreGlow", "uHueRange", "uSatShift", "uBrightnessShift", "uColorNoiseFreq", "uColorNoiseSpeed", "uStopCount", "uSatCount", "uTrailCount", "uVelocity", "uStretch"];
56
+ /**
57
+ * The bounded fission APEX (config-UV) — the orbit radius the fissioning satellite
58
+ * breathes OUT to at its excursion peak. Beyond the body skin (0.22) by a clean gap that
59
+ * exceeds the smin reach so the neck SNAPS; bounded so the single fissioner + apex rule
60
+ * re-prevents the "two unrelated discs" failure WITHOUT the blanket never-leaves-reach
61
+ * clamp. Paints at `FISSION_REACH_MAX · POS_SCALE` uv.
62
+ */
63
+ export declare const FISSION_REACH_MAX = 0.4;
64
+ /** The fission PERIAPSIS (config-UV) — the merged-in radius the satellite gathers to before the snap (well inside the body skin, fully bonded). */
65
+ export declare const FISSION_REACH_MIN = 0.18;
66
+ /**
67
+ * The full fission BEAT duration (ms) — the SLOW gather + FAST snap + re-merge window the
68
+ * `fissioning` phase runs for. Long enough that the colony reads as a steady-state
69
+ * merge↔split breath (perpetually mid-merge on one satellite while mid-split on another),
70
+ * NOT a rare twitch. The `fissionSnap` curve maps the beat's `t in [0,1]` to the reach.
71
+ */
72
+ export declare const FISSION_BEAT_MS = 5200;
73
+ /**
74
+ * The fission INTENSITY → cadence map. `fissionAmp` (0..1, config × mood) scales how
75
+ * OFTEN a satellite enters the fissioning beat vs the calm bonded breath: at amp 0 the
76
+ * fission probability is 0 (the calm default never splits); at amp 1 a satellite reaching
77
+ * its orbit-phase boundary enters `fissioning` with this probability instead of a plain
78
+ * merge. Mood-coupled (excited raises the effective amp, sleepy lowers it).
79
+ */
80
+ export declare const FISSION_PROB_AT_FULL = 0.75;
81
+ export declare const UNIFORM_NAMES: readonly ["uResolution", "uTime", "uBaseColor", "uPointer", "uPointerActive", "uPointerAttraction", "uPointerStrength", "uBodyRadius", "uPulsePhase", "uPulseAmp", "uNoiseAmp", "uNoiseFreq", "uNoiseSpeed", "uWarpAmp", "uSmoothK", "uMerge", "uStage", "uMorphT", "uMaxReach", "uLit", "uRimColor", "uLightDir", "uSpecStrength", "uSpecShininess", "uRimPower", "uRimStrength", "uShadow", "uShadowSoftness", "uIridescence", "uIridHue", "uIridSpeed", "uSssScale", "uSssPower", "uCoreGlow", "uHueRange", "uSatShift", "uBrightnessShift", "uColorNoiseFreq", "uColorNoiseSpeed", "uStopCount", "uSatCount", "uTrailCount", "uVelocity", "uStretch"];
57
82
  export type UniformName = (typeof UNIFORM_NAMES)[number];
@@ -1,5 +1,5 @@
1
1
  export { default as GooBlob } from "./GooBlob.vue";
2
- export type { BlobMood, BlobMerge, BlobQuality, MoodParams, MetaballSource, BlobConfig, BlobGeometry, BlobSatelliteTiming, BlobMembrane, BlobColor, BlobSurface, BlobInteraction, SatellitePhase, SatelliteInternal, } from "./types";
2
+ export type { BlobMood, BlobMerge, BlobVariant, BlobQuality, MoodParams, MetaballSource, BlobConfig, BlobGeometry, BlobSatelliteTiming, BlobMembrane, BlobColor, BlobSurface, BlobInteraction, SatellitePhase, SatelliteInternal, } from "./types";
3
3
  export { BLOB_CONFIG_DEFAULTS, BLOB_CONFIG_KEY } from "./types";
4
4
  export { useBlobMood, type BlobMoodSystem } from "./composables/useBlobMood";
5
5
  export { useBlobPointer, type BlobPointer } from "./composables/useBlobPointer";
@@ -0,0 +1 @@
1
+ export declare const METABALL_NOISE_WGSL = "\nconst FBM_LACUNARITY: f32 = 1.8;\nconst FBM_GAIN: f32 = 0.42;\n\n// \u2500\u2500 Noise (blob-LOCAL 3D-p3 hash + IQ analytic-derivative gradient noise) \u2500\u2500\nfn hash21(p: vec2<f32>) -> f32 {\n var p3 = fract(vec3<f32>(p.x, p.y, p.x) * 0.1031);\n p3 = p3 + dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// IQ analytic-derivative gradient noise \u2014 value in .x, ANALYTIC gradient (d/dx, d/dy) in\n// .yz, from one eval. The quintic fade has a continuous 2nd derivative.\nfn noised(p: vec2<f32>) -> vec3<f32> {\n let i = floor(p);\n let f = fract(p);\n let uu = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n let du = 30.0 * f * f * (f * (f - 2.0) + 1.0);\n\n let ga = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(0.0, 0.0)), hash21(i + vec2<f32>(7.3, 0.0)));\n let gb = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(1.0, 0.0)), hash21(i + vec2<f32>(8.3, 0.0)));\n let gc = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(0.0, 1.0)), hash21(i + vec2<f32>(7.3, 1.0)));\n let gd = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(1.0, 1.0)), hash21(i + vec2<f32>(8.3, 1.0)));\n\n let va = dot(ga, f - vec2<f32>(0.0, 0.0));\n let vb = dot(gb, f - vec2<f32>(1.0, 0.0));\n let vc = dot(gc, f - vec2<f32>(0.0, 1.0));\n let vd = dot(gd, f - vec2<f32>(1.0, 1.0));\n\n let n = va + uu.x * (vb - va) + uu.y * (vc - va) + uu.x * uu.y * (va - vb - vc + vd);\n let value = 0.5 + 0.5 * n;\n\n let grad =\n ga + uu.x * (gb - ga) + uu.y * (gc - ga) + uu.x * uu.y * (ga - gb - gc + gd) +\n du * (vec2<f32>(uu.y, uu.x) * (va - vb - vc + vd) + vec2<f32>(vb, vc) - va);\n return vec3<f32>(value, 0.5 * grad);\n}\n\nfn fbm(p0: vec2<f32>, octaves: i32) -> f32 {\n var value = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var p = p0;\n for (var i = 0; i < 4; i = i + 1) {\n if (i >= octaves) { break; }\n value = value + amp * noised(p * freq).x;\n p = FBM_ROT * p;\n freq = freq * FBM_LACUNARITY;\n amp = amp * FBM_GAIN;\n }\n return value;\n}\n\n// FBM with ANALYTIC GRADIENT \u2014 value in .x, \u2202/\u2202x, \u2202/\u2202y in .yz. The gradient accumulates\n// noised()'s analytic gradient per octave, chain-ruled through the per-octave frequency\n// scale AND the FBM_ROT rotation (the keystone feed for the analytic surface normal).\nfn fbmG(p: vec2<f32>, octaves: i32) -> vec3<f32> {\n var value = 0.0;\n var grad = vec2<f32>(0.0, 0.0);\n var amp = 0.5;\n var freq = 1.0;\n var rotAccum = mat2x2<f32>(1.0, 0.0, 0.0, 1.0);\n var pp = p;\n for (var i = 0; i < 4; i = i + 1) {\n if (i >= octaves) { break; }\n let n = noised(pp * freq);\n value = value + amp * n.x;\n grad = grad + amp * freq * (transpose(rotAccum) * n.yz);\n pp = FBM_ROT * pp;\n freq = freq * FBM_LACUNARITY;\n amp = amp * FBM_GAIN;\n rotAccum = FBM_ROT * rotAccum;\n }\n return vec3<f32>(value, grad);\n}\n\n// One domain-warp pass with the ANALYTIC GRADIENT carried (warp-Jacobian approximation).\nfn fbmWarpedG(p: vec2<f32>, octaves: i32, warpAmp: f32) -> vec3<f32> {\n if (warpAmp <= 0.0) { return fbmG(p, octaves); }\n let q = vec2<f32>(fbm(p + vec2<f32>(0.0, 0.0), octaves),\n fbm(p + vec2<f32>(5.2, 1.3), octaves));\n return fbmG(p + warpAmp * (q - 0.5), octaves);\n}\n";
@@ -0,0 +1 @@
1
+ export declare const METABALL_PALETTE_WGSL = "\n// \u2500\u2500 OKLCh gamut clamp (hue-preserving inward chroma clamp \u2014 blob-local) \u2500\u2500\nfn inGamut(lin: vec3<f32>) -> bool {\n return all(lin >= vec3<f32>(0.0)) && all(lin <= vec3<f32>(1.0));\n}\nfn gamutClampOklch(lch: vec3<f32>) -> vec3<f32> {\n let lin = oklabToLinearSrgb(oklchToOklab(lch));\n if (inGamut(lin)) { return lch; }\n var lo = 0.0;\n var hi = lch.y;\n for (var i = 0; i < 16; i = i + 1) {\n let mid = 0.5 * (lo + hi);\n let test = vec3<f32>(lch.x, mid, lch.z);\n if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) { lo = mid; } else { hi = mid; }\n }\n return vec3<f32>(lch.x, lo, lch.z);\n}\n\n// W11.b \u2014 sample the multi-stop palette at t, OKLab mix + midpoint chroma-bump. Returns\n// an OKLCh stop [L, C, h(rad)]. Falls back to uBaseColor when uStopCount <= 1.\nfn samplePaletteOklch(t: f32) -> vec3<f32> {\n let uStopCount = u.ints.x;\n if (uStopCount <= 1) { return oklabToOklch(srgbToOklab(u.base.rgb)); }\n let n = f32(uStopCount);\n let ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n let i0 = i32(floor(ft));\n let i1 = min(i0 + 1, uStopCount - 1);\n let f = ft - f32(i0);\n let labA = srgbToOklab(u.palette[i0].rgb);\n let labB = srgbToOklab(u.palette[i1].rgb);\n let lab = mix(labA, labB, f);\n var lch = oklabToOklch(lab);\n lch.y = lch.y + 0.03 * sin(PI * f);\n return lch;\n}\n\n// AX.W15 \u2014 de-synced breath (three DETUNED sines at irrational ratios).\nfn breath(phase: f32) -> f32 {\n return (sin(phase) + 0.5 * sin(phase * 1.4444 + 1.7) + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n";
@@ -1 +1 @@
1
- export declare const METABALL_UNIFORMS_GLSL = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette (W11.b) \u2014 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// AX.W16 (arm 5) \u2014 the PRE-FBM bounding-discard radius (UV space). main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane \u2014 domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface (W9.b) \u2014 gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// Iridescence + fake subsurface (W11.a) \u2014 translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform \u2014 OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// Pointer trail (W10) \u2014 a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch (W10).\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n";
1
+ export declare const METABALL_UNIFORMS_GLSL = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette (W11.b) \u2014 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// BC.W-GOOBLOB-PLAIN \u2014 the STAGE-1 gate. 1.0 = the plain shadowless lightless\n// fill-only floor (variant=\"blob\"); 0.0 = the full lit pipeline (variant=\"meatball\" /\n// STAGE 2). The WebGL2 fallback transcribes the SAME stripped branch the WGSL primary\n// gates (research/viz/goo-blob.md \u00A75 \u2014 the GLSL twin).\n// BD.W-GOO-CAROUSEL-DECK \u2014 uStage is now DERIVED from uMorphT (uStage = uMorphT<=0 ?\n// 1 : 0) at upload; the SHADING morph (below) reads uMorphT directly.\nuniform float uStage;\n\n// BD.W-GOO-CAROUSEL-DECK \u2014 the blob to meatball SHADING-MORPH scalar. 0.0 = the flat blob\n// fill (byte-identical to the STAGE-1 floor), 1.0 = the fully-dressed lit meatball; the\n// in-between LERPS the surface shading (NOT the geometry \u2014 the smin field is shared). The\n// renderer resolves it from config.morphT (variant to endpoint back-compat: blob to 0,\n// meatball to 1). A consumer ANIMATING morphT 0 to 1 gets the live morph.\nuniform float uMorphT;\n\n// AX.W16 (arm 5) \u2014 the PRE-FBM bounding-discard radius (UV space). main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane \u2014 domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface (W9.b) \u2014 gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// BC.W-GOOBLOB-MEATBALL \u2014 the procedural 2D SDF soft-shadow march (T2, the GLSL twin of\n// the WGSL res.z/res.w lanes). uShadow gates the IQ rmshadows soft contact shadow that\n// FOLLOWS the irregular silhouette; uShadowSoftness is the penumbra hardness (4-48).\nuniform float uShadow; // 0 = no shadow, 1 = the soft contact shadow ON\nuniform float uShadowSoftness; // penumbra hardness (inverse light-source size, 4-48)\n\n// Iridescence + fake subsurface (W11.a) \u2014 translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform \u2014 OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// Pointer trail (W10) \u2014 a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch (W10).\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n";