@mkbabb/glass-ui 4.0.1 → 4.1.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.
- package/dist/{CardAction-CW7a0m8M.js → CardAction-8whJrLWt.js} +23 -8
- package/dist/{CommandShortcut-DvZNQ_HF.js → CommandShortcut-D3yxgHNn.js} +23 -12
- package/dist/{ConfiguratorRow-BR4l-ixA.js → ConfiguratorRow-CaP7U3ZA.js} +11 -11
- package/dist/ContextMenuContent-B3ZsheLV.js +90 -0
- package/dist/{ContextMenuSubContent-xol4sD2q.js → ContextMenuSubContent-DDRID3qC.js} +15 -15
- package/dist/{DataTable-CuKwF7wr.js → DataTable-Bc9kUtu_.js} +2 -2
- package/dist/{DialogContent-DcKK8k9i.js → DialogContent-6JtTB5x2.js} +8 -5
- package/dist/DialogFooter-9phqcRIS.js +80 -0
- package/dist/DialogScrollContent-TTuovQst.js +93 -0
- package/dist/HoverCardContent-Bel1gdLZ.js +88 -0
- package/dist/{IconChip-BTD-nay5.js → IconChip-DhbdGdFQ.js} +1 -1
- package/dist/{IconTooltip-Bl8gFZ8d.js → IconTooltip-B0zimd2H.js} +1 -1
- package/dist/Input-Cg9DF62r.js +57 -0
- package/dist/{Notification-VUwexFUf.js → Notification-CphK7AAm.js} +3 -3
- package/dist/NumberFieldContent-D8cXeyO4.js +140 -0
- package/dist/PagerDots-Cjx96la-.js +98 -0
- package/dist/{SelectScrollDownButton-CrA8F0iV.js → SelectScrollDownButton-DAKCBEdW.js} +62 -57
- package/dist/{SelectSeparator-DXswVdRz.js → SelectSeparator-C2UGOkXF.js} +1 -1
- package/dist/Separator-DQcwC2TR.js +44 -0
- package/dist/Switch-B8RscmRu.js +49 -0
- package/dist/{Toaster-Bw4xR8xV.js → Toaster-D9qIHjBI.js} +1 -1
- package/dist/{ToggleGroupItem-pEM9vIhs.js → ToggleGroupItem-BLtr3TJq.js} +2 -2
- package/dist/TooltipProvider-BJ_Y5EGX.js +109 -0
- package/dist/animated-digit.js +1 -1
- package/dist/api/index.d.ts +15 -32
- package/dist/api/types-extra.d.ts +31 -0
- package/dist/api.js +1 -1
- package/dist/aurora.js +579 -251
- package/dist/border-progress.js +49 -57
- package/dist/{button-DYCUa-tH.js → button-5dY1Dvhd.js} +13 -14
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -3
- package/dist/card.js +1 -1
- package/dist/carousel.js +20 -20
- package/dist/color-Cs0-oxYL.js +116 -0
- package/dist/color.js +2 -2
- package/dist/command.js +1 -1
- package/dist/completion-seal.d.ts +1 -0
- package/dist/completion-seal.js +89 -0
- package/dist/components/custom/aurora/Aurora.vue.d.ts +10 -5
- package/dist/components/custom/aurora/composables/color.d.ts +13 -0
- package/dist/components/custom/aurora/composables/frameLoop.d.ts +9 -0
- package/dist/components/custom/aurora/composables/runtime.d.ts +12 -0
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +11 -2
- package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +8 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +18 -0
- package/dist/components/custom/aurora/constants/renderMode.d.ts +16 -8
- package/dist/components/custom/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
- package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +14 -18
- package/dist/components/custom/border-progress/index.d.ts +1 -1
- package/dist/components/custom/completion-seal/CompletionSeal.vue.d.ts +21 -0
- package/dist/components/custom/completion-seal/composables/useCompletionSeal.d.ts +37 -0
- package/dist/components/custom/completion-seal/constants.d.ts +46 -0
- package/dist/components/custom/completion-seal/index.d.ts +4 -0
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +7 -0
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +9 -0
- package/dist/components/custom/concentric/composables/ringField.d.ts +57 -16
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +2 -1
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +4 -4
- package/dist/components/custom/concentric/constants.d.ts +30 -6
- package/dist/components/custom/concentric/index.d.ts +2 -2
- package/dist/components/custom/concentric/shaders/concentric.glsl.d.ts +2 -2
- package/dist/components/custom/concentric/shaders/concentric.wgsl.d.ts +1 -1
- package/dist/components/custom/confirm-dialog/ConfirmDialog.vue.d.ts +3 -3
- package/dist/components/custom/constellation/Constellation.vue.d.ts +5 -4
- package/dist/components/custom/constellation/composables/constellationGLSetup.d.ts +10 -0
- package/dist/components/custom/constellation/composables/constellationWGPUSetup.d.ts +19 -0
- package/dist/components/custom/constellation/composables/uniformBridgeWGPU.d.ts +66 -0
- package/dist/components/custom/constellation/composables/useConstellation.d.ts +3 -10
- package/dist/components/custom/constellation/constants.d.ts +33 -0
- package/dist/components/custom/constellation/constellationField.d.ts +31 -1
- package/dist/components/custom/constellation/constellationInteraction.d.ts +23 -14
- package/dist/components/custom/constellation/constellationRender.d.ts +25 -0
- package/dist/components/custom/constellation/constellationTypes.d.ts +38 -0
- package/dist/components/custom/constellation/constellationWell.d.ts +15 -0
- package/dist/components/custom/constellation/index.d.ts +5 -5
- package/dist/components/custom/constellation/shaders/constellation-lines.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-lines.wgsl.d.ts +1 -0
- package/dist/components/custom/constellation/shaders/constellation-points.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-points.wgsl.d.ts +1 -0
- package/dist/components/custom/deck/DeckPager.vue.d.ts +29 -0
- package/dist/components/custom/deck/composables/useDeck.d.ts +27 -0
- package/dist/components/custom/deck/composables/useDeckKeyboard.d.ts +25 -0
- package/dist/components/custom/deck/composables/useDeckSpring.d.ts +22 -0
- package/dist/components/custom/deck/constants.d.ts +14 -0
- package/dist/components/custom/deck/index.d.ts +8 -0
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +12 -0
- package/dist/components/custom/dock/DockStack.vue.d.ts +65 -0
- package/dist/components/custom/dock/GlassDock.vue.d.ts +4 -2
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +80 -0
- package/dist/components/custom/dock/composables/index.d.ts +2 -0
- package/dist/components/custom/dock/composables/useDockSearch.d.ts +85 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +11 -0
- package/dist/components/custom/dock/constants.d.ts +18 -14
- package/dist/components/custom/dock/index.d.ts +5 -2
- package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +15 -11
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +48 -6
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +23 -8
- package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +6 -5
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -5
- package/dist/components/custom/dot-flow-field/constants.d.ts +42 -21
- package/dist/components/custom/dot-flow-field/index.d.ts +2 -2
- package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +4 -20
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-matrix/DotMatrix.vue.d.ts +43 -0
- package/dist/components/custom/dot-matrix/composables/dotMatrixField.d.ts +89 -0
- package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +52 -0
- package/dist/components/custom/dot-matrix/composables/useDotMatrix.d.ts +34 -0
- package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +27 -0
- package/dist/components/custom/dot-matrix/constants.d.ts +58 -0
- package/dist/components/custom/dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +4 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -0
- package/dist/components/custom/easing/EasingPicker.vue.d.ts +2 -2
- package/dist/components/custom/easing/composables/useEasingPicker.d.ts +5 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +40 -47
- package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +15 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +20 -0
- package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +41 -0
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +40 -37
- package/dist/components/custom/fourier-field/constants.d.ts +61 -4
- package/dist/components/custom/fourier-field/index.d.ts +23 -18
- package/dist/components/custom/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +1 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +4 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +9 -1
- package/dist/components/custom/goo-blob/constants.d.ts +1 -1
- package/dist/components/custom/goo-blob/index.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball-noise.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-palette.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/types.d.ts +36 -0
- package/dist/components/custom/goo-dot-matrix/GooDotMatrix.vue.d.ts +49 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotLattice.d.ts +24 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +50 -0
- package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +35 -0
- package/dist/components/custom/goo-dot-matrix/composables/useGooDotMatrix.d.ts +31 -0
- package/dist/components/custom/goo-dot-matrix/constants.d.ts +76 -0
- package/dist/components/custom/goo-dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +11 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +3 -0
- package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +21 -2
- package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +15 -0
- package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +9 -0
- package/dist/components/custom/pager-dots/index.d.ts +2 -0
- package/dist/components/custom/pager-dots/pagerWindow.d.ts +9 -0
- package/dist/components/custom/paper-grid/PaperGrid.vue.d.ts +42 -0
- package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +90 -0
- package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +19 -0
- package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/usePaperGrid.d.ts +31 -0
- package/dist/components/custom/paper-grid/constants.d.ts +57 -0
- package/dist/components/custom/paper-grid/index.d.ts +5 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +4 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -0
- package/dist/components/custom/search/FuzzySearch.vue.d.ts +8 -2
- package/dist/components/custom/search/SearchBar.vue.d.ts +8 -0
- package/dist/components/custom/search/index.d.ts +2 -0
- package/dist/components/custom/search/searchVariants.d.ts +19 -0
- package/dist/components/custom/selectable-chip/SelectableChip.vue.d.ts +50 -0
- package/dist/components/custom/selectable-chip/index.d.ts +2 -0
- package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +23 -0
- package/dist/components/custom/split-chars/SplitChars.vue.d.ts +39 -0
- package/dist/components/custom/split-chars/index.d.ts +1 -0
- package/dist/components/custom/tabs/SegmentedTabs.vue.d.ts +8 -6
- package/dist/components/custom/tabs/constants.d.ts +20 -2
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +29 -16
- package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +10 -5
- package/dist/components/ui/_shared/index.d.ts +2 -0
- package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/card/Card.vue.d.ts +45 -0
- package/dist/components/ui/card/index.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselNext.vue.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +1 -1
- package/dist/components/ui/command/CommandDialog.vue.d.ts +9 -3
- package/dist/components/ui/command/CommandList.vue.d.ts +3 -0
- package/dist/components/ui/context-menu/ContextMenuContent.vue.d.ts +5 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
- package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
- package/dist/components/ui/input/Input.vue.d.ts +3 -0
- package/dist/components/ui/number-field/NumberFieldInput.vue.d.ts +6 -1
- package/dist/components/ui/select/SelectContent.vue.d.ts +3 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
- package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +3 -0
- package/dist/composables/color/index.d.ts +2 -0
- package/dist/composables/color/useAccentTone.d.ts +34 -0
- package/dist/composables/glass/useVizChoreography.d.ts +123 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +10 -0
- package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgpu/index.d.ts +1 -1
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +28 -7
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -0
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
- package/dist/composables/motion/core/index.d.ts +3 -0
- package/dist/composables/motion/scrollReader.d.ts +25 -0
- package/dist/composables/motion/springPresets.d.ts +20 -1
- package/dist/composables/motion/useCharStagger.d.ts +44 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +31 -6
- package/dist/composables/motion/useScrollChrome.d.ts +58 -0
- package/dist/composables/motion/useScrollTrigger.d.ts +67 -0
- package/dist/composables/motion/useSpringPress.d.ts +5 -5
- package/dist/composables/motion/useStaggerReveal.d.ts +24 -0
- package/dist/composables/sidebar/index.d.ts +4 -1
- package/dist/composables/sidebar/types.d.ts +68 -3
- package/dist/composables/sidebar/useClickDelegate.d.ts +4 -0
- package/dist/composables/sidebar/useLazyLoader.d.ts +5 -0
- package/dist/composables/sidebar/useScrollTo.d.ts +5 -0
- package/dist/composables/virtual/index.d.ts +4 -0
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +72 -0
- package/dist/composables/virtual/useWindowedStore.d.ts +43 -0
- package/dist/composables/virtual/virtualSectionLayout.d.ts +103 -0
- package/dist/concentric.js +495 -221
- package/dist/configurator.js +2 -2
- package/dist/confirm-dialog.js +62 -47
- package/dist/constellation.js +635 -235
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +1 -1
- package/dist/createCanvasLifecycle-Gh45Ce-p.js +93 -0
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck.d.ts +1 -0
- package/dist/deck.js +105 -0
- package/dist/dialog.js +4 -3
- package/dist/dock.js +602 -458
- package/dist/dot-flow-field.js +580 -290
- package/dist/dot-matrix.d.ts +1 -0
- package/dist/dot-matrix.js +630 -0
- package/dist/dotMatrixField-D_x9_1qq.js +48 -0
- package/dist/{dropdown-menu-CofSZuk8.js → dropdown-menu-aJmV5SqE.js} +83 -79
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.js +188 -176
- package/dist/expandable-container.js +42 -20
- package/dist/fading-scroll.js +1 -1
- package/dist/flow.glsl-B2P7e0MT.js +4 -0
- package/dist/forms.js +62 -60
- package/dist/fourier-field.js +825 -178
- package/dist/fourier-math.js +1 -1
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +145 -104
- package/dist/goo-blob.js +171 -1228
- package/dist/goo-dot-matrix.d.ts +1 -0
- package/dist/goo-dot-matrix.js +591 -0
- package/dist/handmark.js +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/hover-popover.js +1 -1
- package/dist/icon-chip.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +70 -60
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +11 -2
- package/dist/motion-core.js +54 -32
- package/dist/motion-curves.js +11 -1
- package/dist/motion.js +46 -111
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -91
- package/dist/paper-backdrop.js +1 -1
- package/dist/paper-grid.d.ts +1 -0
- package/dist/paper-grid.js +788 -0
- package/dist/{presets-BW2b-fr1.js → presets-CvOUqtdY.js} +3 -3
- package/dist/{procedural-color.glsl-CIFsJhwI.js → procedural-color.wgsl-m7Zgv35j.js} +2 -2
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/{useCanvas2D-B8w_E3Rr.js → resolveCanvasColor-yPyIpJt9.js} +12 -2
- package/dist/scrollReader-DI1NWxUw.js +42 -0
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +160 -304
- package/dist/select.js +3 -3
- package/dist/selectable-chip.d.ts +1 -0
- package/dist/selectable-chip.js +65 -0
- package/dist/separator.js +1 -1
- package/dist/{sheet-tZMg0E0w.js → sheet-B2flBfLH.js} +2 -2
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +216 -114
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +1 -1
- package/dist/spectrum-walk-BVzA7Biz.js +33 -0
- package/dist/{springPresets-CFQGQfdl.js → springPresets-Ce7OYCm9.js} +12 -6
- package/dist/styles/animations.css +13 -3
- package/dist/styles/cards.css +69 -0
- package/dist/styles/completion-seal.css +131 -0
- package/dist/styles/components.css +2 -3
- package/dist/styles/configurator.css +55 -0
- package/dist/styles/critical-partition.mjs +33 -11
- package/dist/styles/deferred.css +2 -0
- package/dist/styles/dock/cta-seat.css +87 -0
- package/dist/styles/dock/density.css +153 -0
- package/dist/styles/dock/layers.css +55 -7
- package/dist/styles/dock/morph-bridge.css +54 -18
- package/dist/styles/dock/morph.css +41 -33
- package/dist/styles/dock/overflow.css +12 -0
- package/dist/styles/dock/search.css +68 -0
- package/dist/styles/dock/shape.css +124 -0
- package/dist/styles/dock/shell.css +23 -5
- package/dist/styles/dock/stack-rail.css +264 -0
- package/dist/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/dist/styles/dock-controls/icon-button.css +14 -0
- package/dist/styles/dock.css +11 -1
- package/dist/styles/glass/accent-tone.css +66 -0
- package/dist/styles/glass/control-surfaces.css +167 -0
- package/dist/styles/glass/ladder.css +67 -17
- package/dist/styles/glass/rim.css +19 -9
- package/dist/styles/glass/surfaces.css +69 -148
- package/dist/styles/glass.css +10 -0
- package/dist/styles/index.css +15 -0
- package/dist/styles/scroll-chrome.css +123 -0
- package/dist/styles/scroll-driven.css +38 -0
- package/dist/styles/segmented-tabs.css +50 -14
- package/dist/styles/theme/bridges.css +22 -0
- package/dist/styles/theme/radius.css +18 -1
- package/dist/styles/tokens/color-radius.css +13 -3
- package/dist/styles/tokens/dark-arm.css +39 -6
- package/dist/styles/tokens/glass-deep.css +28 -3
- package/dist/styles/tokens/glass-fx.css +44 -1
- package/dist/styles/tokens/glass.css +91 -31
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/offsets.css +27 -0
- package/dist/styles/tokens/property-regs.css +133 -0
- package/dist/styles/tokens/scale-paper.css +73 -29
- package/dist/styles/tokens/scheme-motion.css +44 -6
- package/dist/styles/tokens/sizing-config.css +110 -0
- package/dist/styles/tokens/sizing.css +55 -104
- package/dist/styles/tokens.css +5 -0
- package/dist/styles/typography/semantic.css +18 -5
- package/dist/styles/utilities/a11y-overrides.css +20 -5
- package/dist/styles/utilities/base-misc.css +52 -0
- package/dist/styles/utilities/btn.css +14 -3
- package/dist/styles/utilities/components.css +31 -6
- package/dist/styles/utilities/metal.css +26 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +8 -8
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle-chip.js +10 -10
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/uniformBridgeWGPU-CtAKl45L.js +1204 -0
- package/dist/{useAnimatedNumber-BfUq2bUM.js → useAnimatedNumber-CLrxicG9.js} +1 -1
- package/dist/{useConfiguratorState-DNlOh6c8.js → useConfiguratorState-4xblKfwd.js} +25 -24
- package/dist/useControlSize-SH1UmJCi.js +9 -0
- package/dist/useDockCtaReceive-DfFkmgL1.js +82 -0
- package/dist/{useDragMorph-DgxnsVJz.js → useDragMorph-BUgAC-zK.js} +4 -4
- package/dist/useFuzzySearch-DIhcYtcw.js +177 -0
- package/dist/useGpuSubstrate-4pTcp6mX.js +294 -0
- package/dist/{useLiquidPress-kfb4KX79.js → useLiquidPress-BooG97RY.js} +2 -2
- package/dist/usePointerVelocityField-QLsy3_kv.js +91 -0
- package/dist/useScrollChrome-D66AVP7C.js +258 -0
- package/dist/{useSpringMount-q1amq1SJ.js → useSpringMount-BWDnKIwh.js} +1 -1
- package/dist/useSpringPress-B1-Czp-V.js +36 -0
- package/dist/useViewTransition-CUI1nAgn.js +95 -0
- package/dist/{vendor-CKmzio-i.js → vendor-B2qOlYY3.js} +24 -11
- package/dist/virtual.d.ts +1 -0
- package/dist/virtual.js +225 -0
- package/dist/watercolor-dot.js +116 -73
- package/package.json +127 -7
- package/src/styles/animations.css +13 -3
- package/src/styles/cards.css +69 -0
- package/src/styles/completion-seal.css +131 -0
- package/src/styles/configurator.css +55 -0
- package/src/styles/critical-partition.mjs +33 -11
- package/src/styles/dock/cta-seat.css +87 -0
- package/src/styles/dock/density.css +153 -0
- package/src/styles/dock/layers.css +55 -7
- package/src/styles/dock/morph-bridge.css +54 -18
- package/src/styles/dock/morph.css +41 -33
- package/src/styles/dock/overflow.css +12 -0
- package/src/styles/dock/search.css +68 -0
- package/src/styles/dock/shape.css +124 -0
- package/src/styles/dock/shell.css +23 -5
- package/src/styles/dock/stack-rail.css +264 -0
- package/src/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/src/styles/dock-controls/icon-button.css +14 -0
- package/src/styles/dock.css +11 -1
- package/src/styles/glass/accent-tone.css +66 -0
- package/src/styles/glass/control-surfaces.css +167 -0
- package/src/styles/glass/ladder.css +67 -17
- package/src/styles/glass/rim.css +19 -9
- package/src/styles/glass/surfaces.css +69 -148
- package/src/styles/glass.css +10 -0
- package/src/styles/index.css +15 -0
- package/src/styles/scroll-chrome.css +123 -0
- package/src/styles/scroll-driven.css +38 -0
- package/src/styles/segmented-tabs.css +50 -14
- package/src/styles/theme/bridges.css +22 -0
- package/src/styles/theme/radius.css +18 -1
- package/src/styles/tokens/color-radius.css +13 -3
- package/src/styles/tokens/dark-arm.css +39 -6
- package/src/styles/tokens/glass-deep.css +28 -3
- package/src/styles/tokens/glass-fx.css +44 -1
- package/src/styles/tokens/glass.css +91 -31
- package/src/styles/tokens/light-dark.css +1 -1
- package/src/styles/tokens/offsets.css +27 -0
- package/src/styles/tokens/property-regs.css +133 -0
- package/src/styles/tokens/scale-paper.css +73 -29
- package/src/styles/tokens/scheme-motion.css +44 -6
- package/src/styles/tokens/sizing-config.css +110 -0
- package/src/styles/tokens/sizing.css +55 -104
- package/src/styles/tokens.css +5 -0
- package/src/styles/typography/semantic.css +18 -5
- package/src/styles/utilities/a11y-overrides.css +20 -5
- package/src/styles/utilities/base-misc.css +52 -0
- package/src/styles/utilities/btn.css +14 -3
- package/src/styles/utilities/components.css +31 -6
- package/src/styles/utilities/metal.css +26 -0
- package/dist/ContextMenuContent-uWnVxDab.js +0 -85
- package/dist/DialogFooter-BZNX5aVr.js +0 -165
- package/dist/HoverCardContent-b2uaAMRR.js +0 -83
- package/dist/Input-h9v5LeXf.js +0 -55
- package/dist/NumberFieldContent-Cq7EzX-U.js +0 -138
- package/dist/Separator-pKF0oA4M.js +0 -37
- package/dist/Switch-CwYNf8bo.js +0 -47
- package/dist/TooltipProvider-rzvnXz60.js +0 -104
- package/dist/color-DweYl7pE.js +0 -86
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
- package/dist/components/custom/constellation/constellationDraw.d.ts +0 -30
- package/dist/components/custom/dock/DockRail.vue.d.ts +0 -89
- package/dist/createCanvasLifecycle-CHD5XrDW.js +0 -82
- package/dist/procedural-color.wgsl-CToRHugY.js +0 -224
- package/dist/resolveCanvasColor-CUyHr5Uu.js +0 -11
- package/dist/styles/dock/rail-extend.css +0 -397
- package/dist/usePointerVelocityField-JbRd5CrM.js +0 -137
- package/dist/useRAFLoop-UYa4zoiN.js +0 -109
- package/dist/useSpringPress-BsqPr7FJ.js +0 -34
- package/src/styles/dock/rail-extend.css +0 -397
- /package/dist/{FadingScroll-DI6hQhT9.js → FadingScroll-DLRbH5Xr.js} +0 -0
- /package/dist/{HoverPopover-CbqbNwgU.js → HoverPopover-BcIxvyqZ.js} +0 -0
- /package/dist/{InstrumentChassis-Bx0F_q5g.js → InstrumentChassis-CxsHSyMj.js} +0 -0
- /package/dist/{PaperBackdrop-Vf3tlpvd.js → PaperBackdrop-CqwjnfLv.js} +0 -0
- /package/dist/{Progress-DctG61iZ.js → Progress-CnqB7gLm.js} +0 -0
- /package/dist/{ScrollingText-yOpBzFYq.js → ScrollingText-CTZbA_cG.js} +0 -0
- /package/dist/{SelectGroup-DwwjicPY.js → SelectGroup-BFiod7X2.js} +0 -0
- /package/dist/{compile-CQEFRTmx.js → compile-nZ1xVYTp.js} +0 -0
- /package/dist/{constants-BPOqYJAm.js → constants--C2DkLW8.js} +0 -0
- /package/dist/{math-BINYmg5z.js → math-Eb0w3LqU.js} +0 -0
- /package/dist/{prng-Za0Rmgag.js → prng-B-d9eYX8.js} +0 -0
- /package/dist/{slider-DVb4HXU-.js → slider-2A0rPn79.js} +0 -0
- /package/dist/{useGlobalDark-C28t0VWJ.js → useGlobalDark-CmjB9E32.js} +0 -0
- /package/dist/{useIntersectionPause-Bj4sPkMh.js → useIntersectionPause-Dbozzjgm.js} +0 -0
- /package/dist/{useInterval-CvK1mL92.js → useInterval-CNdua40W.js} +0 -0
- /package/dist/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BPRp33Im.js} +0 -0
- /package/dist/{useLiquidFlex-mZPMiNXh.js → useLiquidFlex-UmA6LMZu.js} +0 -0
- /package/dist/{useScrollProgress-D7bYU2RK.js → useScrollProgress-c3yxmH6a.js} +0 -0
- /package/dist/{useSortable-DHjtZSEd.js → useSortable-BVqlJRBR.js} +0 -0
- /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-NmBM5V_4.js} +0 -0
- /package/dist/{vReveal-Czsb7zQC.js → vReveal-D9k0jADx.js} +0 -0
- /package/dist/{vSpecular-CQFmLNzA.js → vSpecular-EX7loENl.js} +0 -0
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { OklchStop } from "../../../../composables/color";
|
|
2
2
|
import { type FlowFieldConfig } from "../constants";
|
|
3
|
+
/** The domain half-extent (the lattice spans [-half, half]²; mirrors flowField.ts). */
|
|
4
|
+
export declare const FLOW_DOMAIN_HALF = 0.85;
|
|
5
|
+
export interface FlowGridGeometry {
|
|
6
|
+
cols: number;
|
|
7
|
+
count: number;
|
|
8
|
+
/** The lattice pitch in DOMAIN units (the px pitch mapped to the domain). */
|
|
9
|
+
pitchDomain: number;
|
|
10
|
+
}
|
|
11
|
+
/** Compile-time lattice cap (mirrors the WGSL storage-buffer array bound). */
|
|
12
|
+
export declare const FLOW_MAX_LATTICE = 16384;
|
|
13
|
+
export declare function flowGridGeometry(gridPitchPx: number, canvasCssMin: number): FlowGridGeometry;
|
|
3
14
|
export declare const FLOW_COMPUTE_UNIFORM_BYTES: number;
|
|
4
15
|
export interface FlowUniformScratch {
|
|
5
16
|
buffer: ArrayBuffer;
|
|
@@ -7,18 +18,22 @@ export interface FlowUniformScratch {
|
|
|
7
18
|
i32: Int32Array;
|
|
8
19
|
}
|
|
9
20
|
export declare function createFlowComputeScratch(): FlowUniformScratch;
|
|
10
|
-
/** The domain half-extent (mirrors the WGSL `uDomainHalf`). */
|
|
11
|
-
export declare const FLOW_DOMAIN_HALF = 0.85;
|
|
12
21
|
/** Pack the compute uniforms in place. */
|
|
13
|
-
export declare function packFlowComputeUniforms(scratch: FlowUniformScratch, config: FlowFieldConfig, timeSec: number, dt: number,
|
|
22
|
+
export declare function packFlowComputeUniforms(scratch: FlowUniformScratch, config: FlowFieldConfig, timeSec: number, dt: number, geometry: FlowGridGeometry): FlowUniformScratch;
|
|
14
23
|
export declare const FLOW_RENDER_UNIFORM_BYTES: number;
|
|
15
24
|
export declare function createFlowRenderScratch(): FlowUniformScratch;
|
|
25
|
+
/** The base resting brightness (the calm-lattice floor before the band lights a dot). */
|
|
26
|
+
export declare const FLOW_BASE_BRIGHT = 0.22;
|
|
27
|
+
/** The drift-driven size pulse (a subtle breathing; never a re-seed). */
|
|
28
|
+
export declare const FLOW_SIZE_PULSE = 0.4;
|
|
16
29
|
/** Pack the render uniforms in place. */
|
|
17
|
-
export declare function packFlowRenderUniforms(scratch: FlowUniformScratch, config: FlowFieldConfig, timeSec: number, aspect: number, canvasCssMin: number, palette: OklchStop[]): FlowUniformScratch;
|
|
18
|
-
/** The byte size of one
|
|
30
|
+
export declare function packFlowRenderUniforms(scratch: FlowUniformScratch, config: FlowFieldConfig, timeSec: number, aspect: number, canvasCssMin: number, geometry: FlowGridGeometry, palette: OklchStop[]): FlowUniformScratch;
|
|
31
|
+
/** The byte size of one lattice dot in the storage buffer (vec4<f32>). */
|
|
19
32
|
export declare const FLOW_PARTICLE_BYTES = 16;
|
|
20
33
|
/**
|
|
21
|
-
* Seed the
|
|
22
|
-
*
|
|
34
|
+
* Seed the lattice storage buffer: each dot starts AT its anchor origin (the restoring
|
|
35
|
+
* spring needs no initial offset). `(pos.x, pos.y, height=0, |disp|=0)` per index — the
|
|
36
|
+
* compute kernel re-derives the origin from `gridOrigin(index, cols, pitch)` each frame,
|
|
37
|
+
* so the seed only needs the starting position (the lattice settles on the first frames).
|
|
23
38
|
*/
|
|
24
|
-
export declare function
|
|
39
|
+
export declare function seedLatticeBuffer(geometry: FlowGridGeometry): Float32Array;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref } from "vue";
|
|
2
2
|
import { type GpuBackend } from "../../../../composables/glass/webgpu/useGpuSubstrate";
|
|
3
|
-
import {
|
|
3
|
+
import type { OklchStop } from "../../../../composables/color";
|
|
4
4
|
import type { FlowFieldConfig } from "../constants";
|
|
5
5
|
export interface UseDotFlowFieldOptions {
|
|
6
6
|
config: FlowFieldConfig;
|
|
@@ -11,7 +11,7 @@ export interface UseDotFlowFieldOptions {
|
|
|
11
11
|
}
|
|
12
12
|
/** The uniform handle a consumer wires its lifecycle against (backend-agnostic). */
|
|
13
13
|
export interface DotFlowFieldHandle {
|
|
14
|
-
/** The resolved backend (`"webgpu"` where supported, else the
|
|
14
|
+
/** The resolved backend (`"webgpu"` where supported, else the WebGL2 fragment fallback). */
|
|
15
15
|
readonly backend: GpuBackend;
|
|
16
16
|
/** Park the loop (the WCAG-2.2.2 pause seam — `DockBackgroundToggle` wires this). */
|
|
17
17
|
pause: () => void;
|
|
@@ -23,12 +23,13 @@ export interface DotFlowFieldHandle {
|
|
|
23
23
|
renderAt: (timeSec: number) => void;
|
|
24
24
|
/** The live `prefers-reduced-motion: reduce` state. */
|
|
25
25
|
readonly reducedMotion: boolean;
|
|
26
|
-
/** Tear down the renderer + release GPU/
|
|
26
|
+
/** Tear down the renderer + release GPU/GL resources. */
|
|
27
27
|
dispose: () => void;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Mount the dot-flow-field renderer on `canvasRef`. The WebGPU primary runs the
|
|
31
|
-
* compute+render two-pass; the
|
|
32
|
-
* (the ONE math source). Returns the
|
|
31
|
+
* compute+render two-pass over the anchored lattice; the WebGL2 fallback evaluates the SAME
|
|
32
|
+
* `flowField.ts` field as a fullscreen fragment pass (the ONE math source). Returns the
|
|
33
|
+
* uniform lifecycle handle.
|
|
33
34
|
*/
|
|
34
35
|
export declare function useDotFlowField(canvasRef: Ref<HTMLCanvasElement | null>, options: UseDotFlowFieldOptions): DotFlowFieldHandle;
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
import type { WebGPUCanvasFrame } from "../../../../composables/glass/webgpu/useWebGPUCanvas";
|
|
2
|
+
import type { WebGLCanvasFrame } from "../../../../composables/glass/webgl/useWebGLCanvas";
|
|
2
3
|
import type { OklchStop } from "../../../../composables/color";
|
|
3
4
|
import type { FlowFieldConfig } from "../constants";
|
|
4
|
-
export interface
|
|
5
|
+
export interface FlowSetupDeps {
|
|
5
6
|
canvas: HTMLCanvasElement;
|
|
6
7
|
config: FlowFieldConfig;
|
|
7
8
|
/** The resolved (ColorResolver) palette stops as OKLCh — re-read each frame so a live palette edit reaches the buffer. */
|
|
8
9
|
getPalette: () => OklchStop[];
|
|
9
10
|
/** Demand-gate (the renderer's quiescence layer — substrate-agnostic). */
|
|
10
11
|
shouldContinue: () => boolean;
|
|
11
|
-
/**
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The per-frame pointer hook — useDotFlowField advances the shared
|
|
14
|
+
* `usePointerVelocityField` here (the no-own-rAF discipline; the renderer's loop feeds
|
|
15
|
+
* the push-API tick). ZERO own rAF.
|
|
16
|
+
*/
|
|
17
|
+
onFrame?: (timeSec: number) => void;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* Build the dot-flow-field `setupWGPU(device, context, format)` callback. Closes over the
|
|
16
|
-
* config/palette getters + the renderer's demand gate.
|
|
21
|
+
* config/palette getters + the renderer's demand gate + the pointer `onFrame` hook.
|
|
17
22
|
*/
|
|
18
|
-
export declare function createFlowWGPUSetup(deps:
|
|
23
|
+
export declare function createFlowWGPUSetup(deps: FlowSetupDeps): (device: GPUDevice, context: GPUCanvasContext, format: GPUTextureFormat) => WebGPUCanvasFrame;
|
|
24
|
+
/**
|
|
25
|
+
* Build the `setupGL(gl)` callback the `createGpuSubstrate` WebGL2 path invokes — a clean
|
|
26
|
+
* aurora-class fullscreen fragment pass (the retopology made the dot-lattice + brightness
|
|
27
|
+
* model fragment-friendly; the Canvas2D point-cloud is GONE, clean break). It evaluates
|
|
28
|
+
* the SAME `flowField.ts` height/displacement field the WGSL primary does, splicing the
|
|
29
|
+
* SHARED GLSL color chunk (the ONE color source → no drift between the two backends).
|
|
30
|
+
*/
|
|
31
|
+
export declare function createFlowGLSetup(deps: FlowSetupDeps): (gl: WebGL2RenderingContext) => WebGLCanvasFrame;
|
|
@@ -1,48 +1,69 @@
|
|
|
1
1
|
import type { WaveComponent } from "./composables/flowField";
|
|
2
2
|
import type { OklchStop } from "../../../composables/color";
|
|
3
|
-
/** Compile-time
|
|
3
|
+
/** Compile-time lattice cap — mirrors the WGSL storage-buffer array bound. */
|
|
4
4
|
export declare const MAX_PARTICLES = 16384;
|
|
5
5
|
/** Compile-time wave-component cap — mirrors the WGSL `MAX_WAVE_COMPONENTS` #define. */
|
|
6
6
|
export declare const MAX_WAVE_COMPONENTS = 8;
|
|
7
7
|
/** Compile-time palette cap — mirrors the WGSL `MAX_FLOW_STOPS` #define. */
|
|
8
8
|
export declare const MAX_FLOW_STOPS = 4;
|
|
9
|
-
/** The default advected-dot count (coarse-pointer/mobile clamps lower). */
|
|
10
|
-
export declare const DEFAULT_PARTICLE_COUNT = 4000;
|
|
11
9
|
/**
|
|
12
10
|
* The full author schema — the studio's `useConfiguratorState` model. Every field is a
|
|
13
11
|
* tunable the demo configurator drives; the SFC resolves it into the uniform table.
|
|
12
|
+
*
|
|
13
|
+
* RETOPOLOGY: the lattice density is derived from `gridPitch` (a clean break from the free
|
|
14
|
+
* `particleCount` — README MIGRATION row `particleCount → gridPitch`). The brightness/scale
|
|
15
|
+
* shape rides `contrast`/`waveBandCenter`/`waveBandWidth`; the sub-cell drift rides
|
|
16
|
+
* `displaceAmp`/`springK`; `coherence` maps the octave count + persistence.
|
|
14
17
|
*/
|
|
15
18
|
export interface FlowFieldConfig {
|
|
16
|
-
/** The
|
|
17
|
-
particleCount: number;
|
|
18
|
-
/** The Gerstner sum-of-sines table (1..MAX_WAVE_COMPONENTS). */
|
|
19
|
+
/** The Gerstner sum-of-sines table (1..MAX_WAVE_COMPONENTS) — the LARGE-wave ladder. */
|
|
19
20
|
waveComponents: WaveComponent[];
|
|
20
|
-
/** The
|
|
21
|
-
windDirection: number;
|
|
22
|
-
/** The dispersion-driven travel speed (scales ω). */
|
|
21
|
+
/** The dispersion-driven sweep speed (scales ω). LOW = slow sweep (default 0.3). */
|
|
23
22
|
windSpeed: number;
|
|
24
|
-
/** The fbm curl-noise braiding
|
|
23
|
+
/** The fbm curl-noise braiding-break weight (0..0.4 — keep low; default 0.12). */
|
|
25
24
|
curlStrength: number;
|
|
26
|
-
/** The
|
|
25
|
+
/** The lattice spacing in CSS-px (drives N = view/pitch²). ~26px ≈ the reference. */
|
|
26
|
+
gridPitch: number;
|
|
27
|
+
/** The dot billboard base radius in px @ 1×. */
|
|
27
28
|
dotSize: number;
|
|
28
|
-
/** How
|
|
29
|
-
|
|
30
|
-
/** The
|
|
29
|
+
/** How far a dot drifts from its anchor, in pitch fractions (capped < 0.5 pitch). */
|
|
30
|
+
displaceAmp: number;
|
|
31
|
+
/** The restoring-spring rate (the pull-to-anchor stiffness; higher = stiffer). */
|
|
32
|
+
springK: number;
|
|
33
|
+
/** The sweeping-band center over the normalized height (the iso-band the wave rides). */
|
|
34
|
+
waveBandCenter: number;
|
|
35
|
+
/** The sweeping bright-stripe thickness (`waveBand` width over the normalized height). */
|
|
36
|
+
waveBandWidth: number;
|
|
37
|
+
/** The brightness modulation depth (subtle ↔ bold; 0..1). */
|
|
38
|
+
contrast: number;
|
|
39
|
+
/** The Coherence axis (0..1; high = few coarse octaves coherent, low = many fine). */
|
|
40
|
+
coherence: number;
|
|
41
|
+
/** The soft-disc globe mask (the reference's two-sphere composition); off by default. */
|
|
42
|
+
globeMask: boolean;
|
|
43
|
+
/** The dot-color ramp (the demo themes it mono-white); resolved via the ColorResolver. */
|
|
31
44
|
palette: OklchStop[];
|
|
32
|
-
/** The ground color (the demo sets
|
|
45
|
+
/** The ground color (the demo sets near-black; default transparent). */
|
|
33
46
|
background: OklchStop | "transparent";
|
|
34
|
-
/** Pointer-warp the
|
|
47
|
+
/** Pointer-warp the lattice (a local displacement ripple about the cursor). */
|
|
35
48
|
interactive: boolean;
|
|
36
49
|
/** ONE static frame then park under `prefers-reduced-motion: reduce`. */
|
|
37
50
|
respectReducedMotion: boolean;
|
|
38
51
|
}
|
|
39
52
|
/**
|
|
40
|
-
* The warm-cream identity palette (the library default — NOT teal). A two-stop
|
|
41
|
-
*
|
|
42
|
-
*
|
|
53
|
+
* The warm-cream identity palette (the library default — NOT teal). A two-stop warm-amber
|
|
54
|
+
* ramp over the warm-cream foreground family, resolved via the ColorResolver. A consumer
|
|
55
|
+
* (the demo) themes it mono-white-on-near-black through a PRESET, never a token edit.
|
|
43
56
|
*/
|
|
44
57
|
export declare const WARM_IDENTITY_PALETTE: OklchStop[];
|
|
45
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The default LARGE-wave ladder about a 35° diagonal wind — 3 coherent octaves, λ₀ at
|
|
60
|
+
* 2.5× the domain extent (ONE dominant sweeping wave). The §1 regime inversion.
|
|
61
|
+
*/
|
|
46
62
|
export declare const DEFAULT_WAVE_COMPONENTS: WaveComponent[];
|
|
47
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* The shipped warm-identity default config — the SUBTLE + LARGE regime (the §1/§2
|
|
65
|
+
* topology+regime targets): a calm warm-cream lattice (~26px pitch) a slow LARGE wave
|
|
66
|
+
* sweeps through, the dots only breathing a hair off their anchors. globeMask OFF (the
|
|
67
|
+
* neutral register — the reference's soft-disc is a DEMO preset).
|
|
68
|
+
*/
|
|
48
69
|
export declare const DEFAULT_FLOW_CONFIG: FlowFieldConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as DotFlowField } from "./DotFlowField.vue";
|
|
2
2
|
export { useDotFlowField, type DotFlowFieldHandle, type UseDotFlowFieldOptions, } from "./composables/useDotFlowField";
|
|
3
|
-
export { type FlowFieldConfig, DEFAULT_FLOW_CONFIG, DEFAULT_WAVE_COMPONENTS, WARM_IDENTITY_PALETTE, MAX_PARTICLES, MAX_WAVE_COMPONENTS, MAX_FLOW_STOPS,
|
|
4
|
-
export { type WaveComponent, type Vec2, sampleVelocity, gerstnerVelocity, curlFBM, buildWaveLadder, FLOW_GRAVITY, } from "./composables/flowField";
|
|
3
|
+
export { type FlowFieldConfig, DEFAULT_FLOW_CONFIG, DEFAULT_WAVE_COMPONENTS, WARM_IDENTITY_PALETTE, MAX_PARTICLES, MAX_WAVE_COMPONENTS, MAX_FLOW_STOPS, } from "./constants";
|
|
4
|
+
export { type WaveComponent, type Vec2, sampleVelocity, gerstnerVelocity, curlFBM, buildWaveLadder, gridOrigin, sampleHeight, sampleDisplacement, waveBand, FLOW_GRAVITY, FLOW_DOMAIN_HALF, } from "./composables/flowField";
|
|
5
5
|
export type { OklchStop } from "../../../composables/color";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const FLOW_FIELD_COMPUTE_WGSL = "\nconst MAX_WAVE_COMPONENTS: i32 = 8;\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst FLOW_GRAVITY: f32 = 9.81;\nconst CURL_EPS: f32 = 0.012;\nconst FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);\n\nstruct Particle {\n // (pos.x, pos.y,
|
|
1
|
+
export declare const FLOW_FIELD_COMPUTE_WGSL = "\nconst MAX_WAVE_COMPONENTS: i32 = 8;\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst FLOW_GRAVITY: f32 = 9.81;\nconst CURL_EPS: f32 = 0.012;\nconst FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);\n\nstruct Particle {\n // (pos.x, pos.y, height, |disp|) \u2014 the anchored-lattice live state\n data: vec4<f32>,\n};\n\n// \u2500\u2500 Uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct FlowUniforms {\n // p0: (uTime, uDt, uWindSpeed, uCurlStrength)\n p0: vec4<f32>,\n // p1: (uGridPitch, uDisplaceAmp, uSpringK, uGridCols) \u2014 the lattice geometry\n p1: vec4<f32>,\n // ints: (uWaveCount, uParticleCount, uGridColsI, _pad)\n ints: vec4<i32>,\n // each wave row: (amplitude, wavelength, directionDeg, phase)\n waves: array<vec4<f32>, 8>,\n};\n\n@group(0) @binding(0) var<uniform> u: FlowUniforms;\n@group(0) @binding(1) var<storage, read_write> particles: array<Particle>;\n\n// \u2500\u2500 The deterministic lattice origin (transcribes flowField.ts gridOrigin) \u2500\u2500\nfn gridOrigin(index: u32, cols: i32, pitch: f32) -> vec2<f32> {\n let c = max(cols, 1);\n let col = i32(index) % c;\n let row = i32(index) / c;\n let half = f32(c - 1) * pitch * 0.5;\n return vec2<f32>(f32(col) * pitch - half, f32(row) * pitch - half);\n}\n\n// \u2500\u2500 The Gerstner-sum analytic \u2207\u22A5h velocity (transcribes flowField.ts gerstnerVelocity) \u2500\u2500\nfn gerstnerVelocity(p: vec2<f32>, t: f32) -> vec2<f32> {\n var dhdx = 0.0;\n var dhdy = 0.0;\n let windSpeed = u.p0.z;\n let waveCount = u.ints.x;\n for (var i = 0; i < MAX_WAVE_COMPONENTS; i = i + 1) {\n if (i >= waveCount) { break; }\n let w = u.waves[i];\n let amplitude = w.x;\n let wavelength = max(w.y, 1e-4);\n let dirRad = w.z * PI / 180.0;\n let phase = w.w;\n let k = TAU / wavelength;\n let d = vec2<f32>(cos(dirRad), sin(dirRad));\n let omega = sqrt(FLOW_GRAVITY * k) * windSpeed;\n let theta = k * (d.x * p.x + d.y * p.y) - omega * t + phase;\n let akc = amplitude * k * cos(theta);\n dhdx = dhdx + akc * d.x;\n dhdy = dhdy + akc * d.y;\n }\n // v = \u2207\u22A5h = (\u2202h/\u2202y, \u2212\u2202h/\u2202x).\n return vec2<f32>(dhdy, -dhdx);\n}\n\n// \u2500\u2500 The scalar Gerstner HEIGHT (transcribes flowField.ts sampleHeight \u2014 the brightness\n// driver, normalized to \u2248[-1,1] by the total amplitude so the band thresholds are\n// wave-table-independent). \u2500\u2500\nfn sampleHeight(o: vec2<f32>, t: f32) -> f32 {\n var h = 0.0;\n var ampSum = 0.0;\n let windSpeed = u.p0.z;\n let waveCount = u.ints.x;\n for (var i = 0; i < MAX_WAVE_COMPONENTS; i = i + 1) {\n if (i >= waveCount) { break; }\n let w = u.waves[i];\n let k = TAU / max(w.y, 1e-4);\n let dirRad = w.z * PI / 180.0;\n let d = vec2<f32>(cos(dirRad), sin(dirRad));\n let omega = sqrt(FLOW_GRAVITY * k) * windSpeed;\n let theta = k * (d.x * o.x + d.y * o.y) - omega * t + w.w;\n h = h + w.x * sin(theta);\n ampSum = ampSum + abs(w.x);\n }\n return h / max(ampSum, 1e-4);\n}\n\n// \u2500\u2500 Shared curl-noise basis (the WGSL twin of flow.glsl.ts curlFBM) \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\nfn valueNoise(p: vec2<f32>) -> f32 {\n let i = floor(p);\n let f = fract(p);\n let u2 = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n let a = hash21(i + vec2<f32>(0.0, 0.0));\n let b = hash21(i + vec2<f32>(1.0, 0.0));\n let c = hash21(i + vec2<f32>(0.0, 1.0));\n let d = hash21(i + vec2<f32>(1.0, 1.0));\n return mix(mix(a, b, u2.x), mix(c, d, u2.x), u2.y);\n}\n\nfn potentialFBM(p0: vec2<f32>) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var p = p0;\n for (var i = 0; i < 3; i = i + 1) {\n v = v + amp * valueNoise(p * freq);\n p = FBM_ROT * p;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\nfn curlFBM(p: vec2<f32>) -> vec2<f32> {\n let dx = potentialFBM(p + vec2<f32>(CURL_EPS, 0.0)) - potentialFBM(p - vec2<f32>(CURL_EPS, 0.0));\n let dy = potentialFBM(p + vec2<f32>(0.0, CURL_EPS)) - potentialFBM(p - vec2<f32>(0.0, CURL_EPS));\n let g = vec2<f32>(dx, dy) / (2.0 * CURL_EPS);\n return vec2<f32>(g.y, -g.x);\n}\n\n// The composite flow velocity (transcribes flowField.ts sampleVelocity EXACTLY \u2014 the\n// coarse \u00D70.55 curl domain-scale, the \u00A73.2 inversion).\nfn sampleVelocity(p: vec2<f32>, t: f32) -> vec2<f32> {\n let curlStrength = u.p0.w;\n var v = gerstnerVelocity(p, t);\n if (curlStrength > 0.0) {\n let c = curlFBM(vec2<f32>(p.x * 0.55 + t * 0.15, p.y * 0.55));\n v = v + c * curlStrength;\n }\n return v;\n}\n\n// The sub-cell DISPLACEMENT (transcribes flowField.ts sampleDisplacement \u2014 \u2207\u22A5h + the\n// coarse curl break, soft-clamped through tanh so the magnitude rides into [0,1)).\nfn sampleDisplacement(o: vec2<f32>, t: f32) -> vec2<f32> {\n let v = sampleVelocity(o, t);\n let mag = length(v);\n if (mag < 1e-5) { return vec2<f32>(0.0, 0.0); }\n let bounded = tanh(mag);\n return v * (bounded / mag);\n}\n\n@compute @workgroup_size(64)\nfn cs_main(@builtin(global_invocation_id) gid: vec3<u32>) {\n let idx = gid.x;\n let count = u32(u.ints.y);\n if (idx >= count) { return; } // bounds-guard the dispatch tail\n\n let t = u.p0.x;\n let dt = u.p0.y;\n let pitch = u.p1.x;\n let displaceAmp = u.p1.y;\n let springK = u.p1.z;\n let cols = u.ints.z;\n\n // The PERMANENT anchor \u2014 no wrap, no re-seed (the coherence fix).\n let o = gridOrigin(idx, cols, pitch);\n let disp = sampleDisplacement(o, t);\n let anchorTarget = o + disp * (displaceAmp * pitch);\n\n var pr = particles[idx];\n var pos = pr.data.xy;\n // Framerate-independent critically-damped pull-to-anchor:\n // p \u2190 mix(p, anchorTarget, 1 - exp(-springK\u00B7dt)) (the GPGPU influence-pull pattern).\n let k = 1.0 - exp(-springK * dt);\n pos = mix(pos, anchorTarget, k);\n\n let h = sampleHeight(o, t);\n particles[idx] = Particle(vec4<f32>(pos, h, length(disp)));\n}\n";
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
export
|
|
5
|
-
pos: Vec2;
|
|
6
|
-
age: number;
|
|
7
|
-
seed: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* The CPU particle field — alloc + seed + step + paint, over the Canvas2D substrate.
|
|
11
|
-
* `step(dt, timeSec)` advects every particle through the SAME `sampleVelocity` evaluator
|
|
12
|
-
* the WGSL compute kernel transcribes; `paint(ctx)` draws the soft dots. The fallback's
|
|
13
|
-
* `degraded` parity is the CPU step count vs the GPU's per-particle instancing — the same
|
|
14
|
-
* flow, a coarser density.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createCpuFlowField(config: FlowFieldConfig): {
|
|
17
|
-
particles: CpuParticle[];
|
|
18
|
-
step: (dt: number, timeSec: number) => void;
|
|
19
|
-
paint: (ctx: CanvasRenderingContext2D, wCss: number, hCss: number, timeSec: number, dotColor: string) => void;
|
|
20
|
-
};
|
|
1
|
+
/** The full-screen-triangle vertex shader (the substrate's standard fullscreen pass). */
|
|
2
|
+
export declare const FLOW_FIELD_VERT_GLSL = "#version 300 es\nprecision highp float;\nin vec2 aPosition;\nout vec2 vUv;\nvoid main() {\n vUv = aPosition; // [-1,1]\u00B2 domain\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}";
|
|
3
|
+
/** The dot-lattice + sweeping-brightness fragment source (the anchored-grid model). */
|
|
4
|
+
export declare const FLOW_FIELD_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define FLOW_GRAVITY 9.81\n#define CURL_EPS 0.012\n#define MAX_WAVE_COMPONENTS 8\n#define MAX_FLOW_STOPS 4\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uWindSpeed;\nuniform float uCurlStrength;\nuniform float uDomainHalf;\nuniform float uAspect;\nuniform float uGridPitchDomain; // lattice pitch in DOMAIN units\nuniform float uDotRadiusDomain; // dot radius in DOMAIN units\nuniform float uDisplaceAmp; // sub-cell drift in pitch fractions\nuniform float uContrast;\nuniform float uBaseBright;\nuniform float uWaveBandCenter;\nuniform float uWaveBandWidth;\nuniform float uGlobeMask;\nuniform int uWaveCount;\nuniform int uStopCount;\nuniform float uHasBackground;\nuniform vec3 uBg;\nuniform vec4 uWaves[MAX_WAVE_COMPONENTS]; // (amplitude, wavelength, directionDeg, phase)\nuniform vec3 uPalette[MAX_FLOW_STOPS]; // linear-sRGB stops\n\nconst mat2 FBM_ROT = mat2(0.8, 0.6, -0.6, 0.8);\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// \u2500\u2500 The Gerstner-sum analytic \u2207\u22A5h velocity (transcribes flowField.ts gerstnerVelocity) \u2500\u2500\nvec2 gerstnerVelocity(vec2 p, float t) {\n float dhdx = 0.0;\n float dhdy = 0.0;\n for (int i = 0; i < MAX_WAVE_COMPONENTS; i++) {\n if (i >= uWaveCount) break;\n vec4 w = uWaves[i];\n float k = TAU / max(w.y, 1e-4);\n float dirRad = w.z * PI / 180.0;\n vec2 d = vec2(cos(dirRad), sin(dirRad));\n float omega = sqrt(FLOW_GRAVITY * k) * uWindSpeed;\n float theta = k * (d.x * p.x + d.y * p.y) - omega * t + w.w;\n float akc = w.x * k * cos(theta);\n dhdx += akc * d.x;\n dhdy += akc * d.y;\n }\n return vec2(dhdy, -dhdx);\n}\n\n// \u2500\u2500 The scalar Gerstner HEIGHT (transcribes flowField.ts sampleHeight) \u2500\u2500\nfloat sampleHeight(vec2 o, float t) {\n float h = 0.0;\n float ampSum = 0.0;\n for (int i = 0; i < MAX_WAVE_COMPONENTS; i++) {\n if (i >= uWaveCount) break;\n vec4 w = uWaves[i];\n float k = TAU / max(w.y, 1e-4);\n float dirRad = w.z * PI / 180.0;\n vec2 d = vec2(cos(dirRad), sin(dirRad));\n float omega = sqrt(FLOW_GRAVITY * k) * uWindSpeed;\n float theta = k * (d.x * o.x + d.y * o.y) - omega * t + w.w;\n h += w.x * sin(theta);\n ampSum += abs(w.x);\n }\n return h / max(ampSum, 1e-4);\n}\n\n// \u2500\u2500 Shared curl-noise basis (the GLSL twin of flow.glsl.ts curlFBM) \u2500\u2500\nfloat hash21(vec2 p) {\n vec3 p3 = fract(vec3(p.x, p.y, p.x) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\nfloat valueNoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u2 = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n float a = hash21(i + vec2(0.0, 0.0));\n float b = hash21(i + vec2(1.0, 0.0));\n float c = hash21(i + vec2(0.0, 1.0));\n float d = hash21(i + vec2(1.0, 1.0));\n return mix(mix(a, b, u2.x), mix(c, d, u2.x), u2.y);\n}\nfloat potentialFBM(vec2 p0) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n vec2 p = p0;\n for (int i = 0; i < 3; i++) {\n v += amp * valueNoise(p * freq);\n p = FBM_ROT * p;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\nvec2 curlFBM(vec2 p) {\n float dx = potentialFBM(p + vec2(CURL_EPS, 0.0)) - potentialFBM(p - vec2(CURL_EPS, 0.0));\n float dy = potentialFBM(p + vec2(0.0, CURL_EPS)) - potentialFBM(p - vec2(0.0, CURL_EPS));\n vec2 g = vec2(dx, dy) / (2.0 * CURL_EPS);\n return vec2(g.y, -g.x);\n}\nvec2 sampleVelocity(vec2 p, float t) {\n vec2 v = gerstnerVelocity(p, t);\n if (uCurlStrength > 0.0) {\n vec2 c = curlFBM(vec2(p.x * 0.55 + t * 0.15, p.y * 0.55));\n v += c * uCurlStrength;\n }\n return v;\n}\n// sub-cell displacement (transcribes flowField.ts sampleDisplacement \u2014 tanh soft-clamp).\nvec2 sampleDisplacement(vec2 o, float t) {\n vec2 v = sampleVelocity(o, t);\n float mag = length(v);\n if (mag < 1e-5) return vec2(0.0);\n return v * (tanh(mag) / mag);\n}\n\n// The sweeping bright-stripe band (transcribes flowField.ts waveBand).\nfloat waveBand(float h, float center, float width) {\n float w = max(width, 1e-3);\n float d = abs(h - center);\n return 1.0 - smoothstep(0.0, w, d);\n}\n\n// The optional soft-disc globe mask (the reference's two-sphere composition).\nfloat globeMask(vec2 o, float t, float on) {\n if (on <= 0.5) return 1.0;\n float cx = 0.35 * sin(t * 0.13);\n float cy = 0.28 * cos(t * 0.11);\n float d = length(o - vec2(cx, cy));\n return 1.0 - smoothstep(0.45, 0.75, d);\n}\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 lmsA = LINEAR_SRGB_TO_LMS * uPalette[i0];\n vec3 lmsB = LINEAR_SRGB_TO_LMS * uPalette[i1];\n vec3 labA = LMS_TO_OKLAB * (sign(lmsA) * pow(abs(lmsA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(lmsB) * pow(abs(lmsB), vec3(1.0 / 3.0)));\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\nvoid main() {\n float aspect = max(uAspect, 1e-4);\n // Domain-space pixel (aspect-corrected x so the lattice stays square).\n vec2 p = vec2(vUv.x * aspect, vUv.y);\n float pitch = max(uGridPitchDomain, 1e-3);\n\n // The nearest lattice cell ORIGIN (the anchored grid \u2014 the deterministic gridOrigin\n // mapping, evaluated per-pixel: round p/pitch to the nearest cell center).\n vec2 cell = floor(p / pitch + 0.5);\n vec2 o = cell * pitch;\n\n // The dot DRIFTS toward o + disp\u00B7displaceAmp\u00B7pitch (the same sub-cell offset the\n // compute kernel writes \u2014 here evaluated analytically per pixel).\n vec2 disp = sampleDisplacement(o, uTime);\n vec2 dotCenter = o + disp * (uDisplaceAmp * pitch);\n\n // The soft circle around the (drifted) dot center.\n float dist = length(p - dotCenter);\n float radius = max(uDotRadiusDomain, 1e-4);\n float mask = 1.0 - smoothstep(radius * 0.6, radius, dist);\n if (mask < 0.002) {\n if (uHasBackground > 0.5) {\n fragColor = vec4(clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0)), 1.0);\n } else {\n fragColor = vec4(0.0);\n }\n return;\n }\n\n // The brightness lights the dot \u2014 the SWEEPING band over the height at the anchor.\n float h = sampleHeight(o, uTime);\n float band = waveBand(h, uWaveBandCenter, uWaveBandWidth);\n float bright = (uBaseBright + band * uContrast) * globeMask(o, uTime, uGlobeMask);\n bright = clamp(bright, 0.0, 1.6);\n\n float tone = clamp(bright, 0.0, 1.0);\n vec3 lin = samplePaletteLin(tone) * bright;\n vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));\n float alpha = mask * clamp(bright * 0.8 + 0.12, 0.0, 1.0);\n\n if (uHasBackground > 0.5) {\n vec3 bg = clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0));\n fragColor = vec4(mix(bg, rgb, alpha), 1.0);\n return;\n }\n fragColor = vec4(rgb * alpha, alpha);\n}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const FLOW_FIELD_RENDER_WGSL = "\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst
|
|
1
|
+
export declare const FLOW_FIELD_RENDER_WGSL = "\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst MAX_FLOW_STOPS: i32 = 4;\n\nstruct Particle {\n // (pos.x, pos.y, height, |disp|)\n data: vec4<f32>,\n};\n\n// \u2500\u2500 Render uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct RenderUniforms {\n // r0: (uTime, uContrast, uBaseBright, uDomainHalf)\n r0: vec4<f32>,\n // r1: (uDotSize, uSizePulse, uAspect, uGridPitch)\n r1: vec4<f32>,\n // r2: (uWaveBandCenter, uWaveBandWidth, uGlobeMask, _pad)\n r2: vec4<f32>,\n // ints: (uStopCount, uParticleCount, _pad, _pad)\n ints: vec4<i32>,\n // bg: (background.rgb, hasBackground)\n bg: vec4<f32>,\n // each palette stop: linear-sRGB rgb + _pad\n palette: array<vec4<f32>, 4>,\n};\n\n@group(0) @binding(0) var<uniform> u: RenderUniforms;\n@group(0) @binding(1) var<storage, read> particles: array<Particle>;\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// The sweeping bright-stripe band (transcribes flowField.ts waveBand): a soft two-sided\n// ridge over the normalized height \u2014 1 at the band center, falling to 0 at \u00B1width.\nfn waveBand(h: f32, center: f32, width: f32) -> f32 {\n let w = max(width, 1e-3);\n let d = abs(h - center);\n return 1.0 - smoothstep(0.0, w, d);\n}\n\n// The optional soft-disc globe mask \u2014 a slow Lissajous-drifting radial field (the\n// reference's two-sphere composition). OFF when uGlobeMask <= 0.5 (returns 1).\nfn globeMask(o: vec2<f32>, t: f32, on: f32) -> f32 {\n if (on <= 0.5) { return 1.0; }\n // a slow Lissajous center drift within the domain\n let cx = 0.35 * sin(t * 0.13);\n let cy = 0.28 * cos(t * 0.11);\n let d = length(o - vec2<f32>(cx, cy));\n // a soft disc of radius ~0.6 with a feathered edge\n return 1.0 - smoothstep(0.45, 0.75, d);\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.x;\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\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) local: vec2<f32>, // [-1,1] billboard-local coords for the soft circle\n @location(1) bright: f32, // band-driven brightness [0, ~1.6]\n};\n\n@vertex\nfn vs_main(\n @builtin(vertex_index) vi: u32,\n @builtin(instance_index) ii: u32,\n) -> VSOut {\n // Two-triangle quad corners in billboard-local space.\n var corners = array<vec2<f32>, 6>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(1.0, -1.0), vec2<f32>(-1.0, 1.0),\n vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, -1.0), vec2<f32>(1.0, 1.0),\n );\n let local = corners[vi];\n\n let pr = particles[ii].data;\n let p = pr.xy;\n let h = pr.z;\n let dispMag = pr.w;\n let half = u.r0.w;\n\n // Brightness = base + band\u00B7contrast, masked by the optional globe (read at the live\n // position \u2014 close enough to the anchor at the sub-cell cap). The band SWEEPS as h\n // translates across the lattice.\n let band = waveBand(h, u.r2.x, u.r2.y);\n var bright = u.r0.z + band * u.r0.y;\n bright = bright * globeMask(p, u.r0.x, u.r2.z);\n\n // A subtle drift-driven size pulse (never a re-seed \u2014 the dot only breathes).\n let sizePulse = u.r1.y;\n let sizeWorld = u.r1.x * (1.0 + dispMag * sizePulse);\n\n // Position the quad at the dot in clip space. Domain [-half,half] \u2192 NDC [-1,1];\n // the quad half-extent rides sizeWorld (in domain units, aspect-corrected x).\n let aspect = u.r1.z;\n let ndc = p / half;\n let off = local * sizeWorld / half;\n let offX = off.x / max(aspect, 1e-4);\n\n var out: VSOut;\n out.pos = vec4<f32>(ndc.x + offX, ndc.y + off.y, 0.0, 1.0);\n out.local = local;\n out.bright = bright;\n return out;\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n // Soft circle \u2014 radial smoothstep over the billboard-local radius.\n let r = length(in.local);\n let feather = 0.4;\n let mask = 1.0 - smoothstep(1.0 - feather, 1.0, r);\n if (mask < 0.002) { return vec4<f32>(0.0); }\n\n // The brightness lights the dot core; the palette tints it (the warm-cream identity).\n let bright = clamp(in.bright, 0.0, 1.6);\n let tone = clamp(bright, 0.0, 1.0);\n let lin = samplePaletteLin(tone) * bright;\n // A floor alpha so even an off-band dot stays a faint lattice point (the calm grid).\n let alpha = mask * clamp(bright * 0.8 + 0.12, 0.0, 1.0);\n let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));\n // Premultiplied-alpha output.\n return vec4<f32>(rgb * alpha, alpha);\n}\n";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DotMatrixConfig } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* DotMatrix — a globe of fine warm-cream dots on a sphere SURFACE (BC.W-VIZ-DOTMATRIX —
|
|
4
|
+
* the Claude co-work "fine-dot spheres on dark" reference).
|
|
5
|
+
*
|
|
6
|
+
* The dots are laid via the Fibonacci phyllotaxis spiral (even-by-area, no pole-pinching)
|
|
7
|
+
* and depth-shaded so the globe reads as a translucent dot-SHELL — the near hemisphere
|
|
8
|
+
* brighter + larger, the rim/far side fading toward near-invisible (the shape is painted
|
|
9
|
+
* by BRIGHTNESS + DEPTH, not motion; stop the spin and it STILL reads as a sphere). It
|
|
10
|
+
* spins slowly on a gently tilted axis. WebGPU-FIRST: the render pass draws instanced
|
|
11
|
+
* billboard quads + the crisp `fwidth` SDF fragment; a WebGL2 instanced-billboard fallback
|
|
12
|
+
* draws the SAME dots where WebGPU is absent (born-GPU — no Canvas2D). It composes
|
|
13
|
+
* `useDotMatrix` → the `createGpuSubstrate` picker over the ONE canvas lifecycle leaf
|
|
14
|
+
* (offscreen-pause, live-PRM freeze, the shared pointer field) — it never bootstraps its
|
|
15
|
+
* own context.
|
|
16
|
+
*
|
|
17
|
+
* The DEFAULT palette is the warm-cream library identity over a transparent ground (the
|
|
18
|
+
* glass card shows through); the mono-warm-white-on-near-black reference + the two-globe
|
|
19
|
+
* composition are DEMO presets (presets-in-consumers — never a library token). The
|
|
20
|
+
* teal-on-navy is GONE entirely.
|
|
21
|
+
*/
|
|
22
|
+
type __VLS_Props = {
|
|
23
|
+
/** The full author schema (the studio's `useConfiguratorState` model). */
|
|
24
|
+
config?: DotMatrixConfig;
|
|
25
|
+
/**
|
|
26
|
+
* The declarative WCAG-2.2.2 pause seam. `v-model:paused` parks the render loop
|
|
27
|
+
* (the substrate's `manual` suspend) when `true`. Wire `<DockBackgroundToggle>`'s
|
|
28
|
+
* `@update:paused` to this `v-model`.
|
|
29
|
+
*/
|
|
30
|
+
paused?: boolean;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
33
|
+
pause: () => void;
|
|
34
|
+
resume: () => void;
|
|
35
|
+
wake: () => void;
|
|
36
|
+
renderAt: (timeSec: number) => void;
|
|
37
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
|
+
"update:paused": (value: boolean) => any;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
40
|
+
"onUpdate:paused"?: ((value: boolean) => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** A 3-vector. */
|
|
2
|
+
export interface Vec3 {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
}
|
|
7
|
+
/** A row-major 3×3 matrix (the spin matrix the WGSL transcribes column-for-column). */
|
|
8
|
+
export type Mat3 = readonly [
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number,
|
|
17
|
+
number
|
|
18
|
+
];
|
|
19
|
+
/** The depth-fade result — the per-dot opacity + size multipliers. */
|
|
20
|
+
export interface FacingFade {
|
|
21
|
+
/** The camera-facing opacity multiplier ∈ [facingLo, facingLo+facingHi]. */
|
|
22
|
+
opacity: number;
|
|
23
|
+
/** The depth-of-field size taper ∈ [0.6, 1.0]. */
|
|
24
|
+
size: number;
|
|
25
|
+
/** The raw facing term ∈ [0,1] (1 = dead-front, 0 = dead-back). */
|
|
26
|
+
facing: number;
|
|
27
|
+
}
|
|
28
|
+
/** The golden ratio φ = (1+√5)/2 ≈ 1.6180339887. */
|
|
29
|
+
export declare const GOLDEN_RATIO: number;
|
|
30
|
+
/** The golden angle = 2π/φ = π·(3−√5) ≈ 2.39996 rad ≈ 137.508° (the irrational azimuth). */
|
|
31
|
+
export declare const GOLDEN_ANGLE: number;
|
|
32
|
+
/**
|
|
33
|
+
* The Fibonacci-phyllotaxis position for dot `i` of `N` on the UNIT sphere — the
|
|
34
|
+
* area-centered half-offset variant (admits ANY `N`, the cheaper no-`acos` `y = cos(polar)`
|
|
35
|
+
* form). The WGSL `instance_index → unit position` mapping transcribes this EXACTLY (the
|
|
36
|
+
* F3 round-trip anchor):
|
|
37
|
+
*
|
|
38
|
+
* y = 1 − 2·(i + 0.5) / N // y ∈ (−1,1), the cos(polar) — even by AREA
|
|
39
|
+
* r = sqrt(1 − y²) // ring radius at that latitude
|
|
40
|
+
* theta = i · goldenAngle // the golden-angle azimuth spiral
|
|
41
|
+
* pos = (cos(theta)·r, y, sin(theta)·r)
|
|
42
|
+
*
|
|
43
|
+
* This beats lat-long (`theta = 2πi/cols, phi = πj/rows`, which clusters at the poles →
|
|
44
|
+
* banded rings) because the irrational golden ratio gives near-equal AREA with no
|
|
45
|
+
* resonance gaps (extremelearning.com.au; arXiv 0912.4540).
|
|
46
|
+
*/
|
|
47
|
+
export declare function fibonacciDot(i: number, n: number): Vec3;
|
|
48
|
+
/** The opacity floor (a dead-back dot stays a faint shell point, never fully gone). */
|
|
49
|
+
export declare const FACING_LO = 0.15;
|
|
50
|
+
/** The opacity facing-gain (dead-front lifts to facingLo + facingHi). */
|
|
51
|
+
export declare const FACING_HI = 0.85;
|
|
52
|
+
/** The size depth-of-field taper base (a dead-back dot is 0.6× the dead-front size). */
|
|
53
|
+
export declare const SIZE_TAPER_BASE = 0.6;
|
|
54
|
+
/** The size depth-of-field taper gain. */
|
|
55
|
+
export declare const SIZE_TAPER_GAIN = 0.4;
|
|
56
|
+
/**
|
|
57
|
+
* The §T2 depth-fade — the part that makes the dot field READ as a sphere. After the spin,
|
|
58
|
+
* modulate per-dot opacity + size by the rotated-normal's camera-facing-ness (a SOFT
|
|
59
|
+
* falloff, NOT a binary back-face cull — the soft fade is what reads as a translucent
|
|
60
|
+
* shell vs a flat disc). For a sphere centered at origin the surface normal IS the
|
|
61
|
+
* normalized dot position, so the facing term is the rotated-normal's z:
|
|
62
|
+
*
|
|
63
|
+
* facing = clamp(n.z · 0.5 + 0.5, 0, 1) // 1 = dead-front, 0 = dead-back
|
|
64
|
+
* opacity = facingLo + facingHi · facing // 0.15 + 0.85·facing
|
|
65
|
+
* size = 0.6 + 0.4 · facing // the DOF dot-size taper
|
|
66
|
+
*
|
|
67
|
+
* `depthFade` ∈ [0,1] scales the facing GAIN (depthFade=1 → the full 0.85 shell read;
|
|
68
|
+
* depthFade=0 → flat uniform opacity, the no-shell degenerate the gate's clause-6 flat-
|
|
69
|
+
* uniform bite catches).
|
|
70
|
+
*/
|
|
71
|
+
export declare function facingFade(normal: Vec3, depthFade?: number): FacingFade;
|
|
72
|
+
/**
|
|
73
|
+
* The spin matrix at time `t` — a slow Y-rotation about a gently TILTED axis (a tilted
|
|
74
|
+
* globe reads more alive than a dead-vertical spin). The axis is the Y-axis tilted by
|
|
75
|
+
* `axisTilt` (radians) toward +x; the rotation angle is `rate · t`. Returns a row-major
|
|
76
|
+
* mat3 the WGSL transcribes column-for-column (mat3x3 is column-major → the transpose is
|
|
77
|
+
* written as the SAME columns). A fixed `renderAt(t)` drives it deterministically for the
|
|
78
|
+
* π capture (the spin reads at the same `t` on every host).
|
|
79
|
+
*/
|
|
80
|
+
export declare function spinMatrix(t: number, axisTilt: number, rate: number): Mat3;
|
|
81
|
+
/** Apply a row-major mat3 to a Vec3 (the rotated surface normal `n = spin · unitPos`). */
|
|
82
|
+
export declare function applyMat3(m: Mat3, v: Vec3): Vec3;
|
|
83
|
+
/**
|
|
84
|
+
* The breathing radius scalar at time `t` — a gentle `R·(1 + breathDepth·sin(t·breathRate))`
|
|
85
|
+
* pulse, the calmest non-dead register (`breathDepth ≈ 0.02`, far below the dot-flow sweep).
|
|
86
|
+
* Returns the multiplier on the base radius (1 at rest when `depth=0`). The WGSL transcribes
|
|
87
|
+
* the SAME `1 + depth·sin(t·rate)` form.
|
|
88
|
+
*/
|
|
89
|
+
export declare function breathRadius(t: number, depth: number, rate: number): number;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { OklchStop } from "../../../../composables/color";
|
|
2
|
+
import { type DotMatrixConfig } from "../constants";
|
|
3
|
+
/** The byte size of one dot in the instance buffer (vec4<f32> = unitPos.xyz + sphereIdx). */
|
|
4
|
+
export declare const DOT_BYTES = 16;
|
|
5
|
+
/** The per-sphere offset of the SECOND globe (the reference two-globe composition). */
|
|
6
|
+
export declare const SPHERE2_OFFSET: {
|
|
7
|
+
readonly x: 0.62;
|
|
8
|
+
readonly y: 0.32;
|
|
9
|
+
};
|
|
10
|
+
/** The per-sphere scale of the SECOND globe (a smaller satellite). */
|
|
11
|
+
export declare const SPHERE2_SCALE = 0.46;
|
|
12
|
+
/** The transient pointer state the interactive arm writes (closed over, never the config). */
|
|
13
|
+
export interface DotPointerState {
|
|
14
|
+
/** Normalized-host pointer (0..1) → NDC offset; (0.5,0.5) is screen center. */
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
/** 1 while the pointer is over the host, 0 at rest (decays the parallax/dimple). */
|
|
18
|
+
active: number;
|
|
19
|
+
/** The repel/attract sign × strength (the dimple direction · velocity scale). */
|
|
20
|
+
push: number;
|
|
21
|
+
/** The accel-burst brightness/scale bloom 0..1 (the flick term). */
|
|
22
|
+
bloom: number;
|
|
23
|
+
}
|
|
24
|
+
/** A fresh resting pointer state. */
|
|
25
|
+
export declare function restingPointer(): DotPointerState;
|
|
26
|
+
export declare const DOT_RENDER_UNIFORM_BYTES: number;
|
|
27
|
+
export interface DotUniformScratch {
|
|
28
|
+
buffer: ArrayBuffer;
|
|
29
|
+
f32: Float32Array;
|
|
30
|
+
i32: Int32Array;
|
|
31
|
+
}
|
|
32
|
+
export declare function createDotRenderScratch(): DotUniformScratch;
|
|
33
|
+
/**
|
|
34
|
+
* Build the STATIC Fibonacci-phyllotaxis instance buffer — `dotCount` dots per sphere,
|
|
35
|
+
* each `(unitPos.xyz, sphereIdx)`. The second sphere's dots are CONCATENATED with
|
|
36
|
+
* `sphereIdx = 1` so the shader resolves the per-sphere offset/scale. Built ONCE (the
|
|
37
|
+
* layout is time-invariant; the spin + depth-fade are per-frame). The WGSL
|
|
38
|
+
* `instance_index → unit position` mapping reads this buffer (it does NOT re-derive the
|
|
39
|
+
* phyllotaxis on the GPU — the JS+GPU agree by construction).
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildDotsBuffer(config: DotMatrixConfig): Float32Array;
|
|
42
|
+
/** The total dot instance count for a config (per-sphere × spheres). */
|
|
43
|
+
export declare function dotInstanceCount(config: DotMatrixConfig): number;
|
|
44
|
+
/**
|
|
45
|
+
* Pack the per-frame render uniforms in place. `timeSec` drives the spin matrix + the
|
|
46
|
+
* breathing; `pointer` carries the interactive parallax/dimple/bloom; `palette` is the
|
|
47
|
+
* live ColorResolver stops (re-read each frame so a studio edit reaches the buffer).
|
|
48
|
+
*/
|
|
49
|
+
export declare function packDotRenderUniforms(scratch: DotUniformScratch, config: DotMatrixConfig, timeSec: number, resolutionPx: {
|
|
50
|
+
w: number;
|
|
51
|
+
h: number;
|
|
52
|
+
}, dpr: number, pointer: DotPointerState, breathRadius: number, palette: OklchStop[]): DotUniformScratch;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { DotMatrixConfig } from "../constants";
|
|
5
|
+
export interface UseDotMatrixOptions {
|
|
6
|
+
config: DotMatrixConfig;
|
|
7
|
+
/** Resolve the dot-color palette as OKLCh (the demo themes it; default warm-identity). */
|
|
8
|
+
getPalette: () => OklchStop[];
|
|
9
|
+
/** `"capture"` → renderAt-only (the deterministic π capture path). Default `"live"`. */
|
|
10
|
+
mode?: "live" | "capture";
|
|
11
|
+
}
|
|
12
|
+
/** The uniform handle a consumer wires its lifecycle against (backend-agnostic). */
|
|
13
|
+
export interface DotMatrixHandle {
|
|
14
|
+
/** The resolved backend (`"webgpu"` where supported, else the WebGL2 fallback). */
|
|
15
|
+
readonly backend: GpuBackend;
|
|
16
|
+
/** Park the loop (the WCAG-2.2.2 pause seam — `DockBackgroundToggle` wires this). */
|
|
17
|
+
pause: () => void;
|
|
18
|
+
/** Re-arm the loop. */
|
|
19
|
+
resume: () => void;
|
|
20
|
+
/** Re-arm a parked loop on demand (a pointer/setter that re-introduced motion). */
|
|
21
|
+
wake: () => void;
|
|
22
|
+
/** Draw one frame out-of-loop (capture / thumbnail). */
|
|
23
|
+
renderAt: (timeSec: number) => void;
|
|
24
|
+
/** The live `prefers-reduced-motion: reduce` state. */
|
|
25
|
+
readonly reducedMotion: boolean;
|
|
26
|
+
/** Tear down the renderer + release GPU/GL resources. */
|
|
27
|
+
dispose: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Mount the dot-matrix renderer on `canvasRef`. The WebGPU primary runs the instanced-
|
|
31
|
+
* billboard render pass over the static phyllotaxis dots buffer; the WebGL2 fallback draws
|
|
32
|
+
* the SAME instanced billboards (the ONE math source). Returns the uniform lifecycle handle.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useDotMatrix(canvasRef: Ref<HTMLCanvasElement | null>, options: UseDotMatrixOptions): DotMatrixHandle;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WebGPUCanvasFrame } from "../../../../composables/glass/webgpu/useWebGPUCanvas";
|
|
2
|
+
import type { WebGLCanvasFrame } from "../../../../composables/glass/webgl/useWebGLCanvas";
|
|
3
|
+
import type { OklchStop } from "../../../../composables/color";
|
|
4
|
+
import { type DotMatrixConfig } from "../constants";
|
|
5
|
+
import { restingPointer, type DotPointerState } from "./uniformBridgeWGPU";
|
|
6
|
+
export interface DotSetupDeps {
|
|
7
|
+
canvas: HTMLCanvasElement;
|
|
8
|
+
config: DotMatrixConfig;
|
|
9
|
+
/** The resolved (ColorResolver) palette stops as OKLCh — re-read each frame. */
|
|
10
|
+
getPalette: () => OklchStop[];
|
|
11
|
+
/** The live transient pointer state (the interactive parallax/dimple/bloom). */
|
|
12
|
+
pointer: DotPointerState;
|
|
13
|
+
/** Demand-gate (the renderer's quiescence layer — substrate-agnostic). */
|
|
14
|
+
shouldContinue: () => boolean;
|
|
15
|
+
/** The per-frame pointer hook — advances the shared field (the no-own-rAF discipline). */
|
|
16
|
+
onFrame?: (timeSec: number) => void;
|
|
17
|
+
}
|
|
18
|
+
/** Build the dot-matrix `setupWGPU(device, context, format)` callback. */
|
|
19
|
+
export declare function createDotWGPUSetup(deps: DotSetupDeps): (device: GPUDevice, context: GPUCanvasContext, format: GPUTextureFormat) => WebGPUCanvasFrame;
|
|
20
|
+
/**
|
|
21
|
+
* Build the `setupGL(gl)` callback the `createGpuSubstrate` WebGL2 path invokes — the SAME
|
|
22
|
+
* instanced billboards via `gl.drawArraysInstanced`. It seeds the SAME JS phyllotaxis dot
|
|
23
|
+
* buffer the WGSL primary uses + splices the SHARED GLSL color chunk (the ONE color source
|
|
24
|
+
* → no drift between backends). No Canvas2D anywhere (§E).
|
|
25
|
+
*/
|
|
26
|
+
export declare function createDotGLSetup(deps: DotSetupDeps): (gl: WebGL2RenderingContext) => WebGLCanvasFrame;
|
|
27
|
+
export { restingPointer };
|