@mkbabb/glass-ui 4.1.0 → 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.
- package/dist/{CardAction-8whJrLWt.js → CardAction-DlVP2evz.js} +58 -54
- package/dist/{CommandShortcut-D3yxgHNn.js → CommandShortcut-By-VQcLO.js} +3 -3
- package/dist/{ConfiguratorRow-CaP7U3ZA.js → ConfiguratorRow-YMXdINHx.js} +3 -3
- package/dist/{ContextMenuContent-B3ZsheLV.js → ContextMenuContent-CMWn6huB.js} +1 -1
- package/dist/{ContextMenuSubContent-DDRID3qC.js → ContextMenuSubContent-DvwWCUc0.js} +1 -1
- package/dist/{DataTable-Bc9kUtu_.js → DataTable-C4tG3eIJ.js} +4 -4
- package/dist/DialogContent-D8U9ZfWS.js +121 -0
- package/dist/{DialogScrollContent-TTuovQst.js → DialogScrollContent-BMekN7gq.js} +1 -1
- package/dist/{FadingScroll-DLRbH5Xr.js → FadingScroll-P8B30rAD.js} +1 -1
- package/dist/{HoverCardContent-Bel1gdLZ.js → HoverCardContent-DAmGYglo.js} +1 -1
- package/dist/{HoverPopover-BcIxvyqZ.js → HoverPopover-DYpBOzzF.js} +1 -1
- package/dist/{IconChip-DhbdGdFQ.js → IconChip-CQa7XZYc.js} +7 -5
- package/dist/{IconTooltip-B0zimd2H.js → IconTooltip-_df8M3xm.js} +1 -1
- package/dist/{Input-Cg9DF62r.js → Input-CyU4_hIC.js} +2 -2
- package/dist/{MetricBadge-RHdBP72w.js → MetricBadge-DQt_dGah.js} +1 -1
- package/dist/{Notification-CphK7AAm.js → Notification-BlSPJhtZ.js} +1 -1
- package/dist/{NumberFieldContent-D8cXeyO4.js → NumberFieldContent-Z3VxGu_6.js} +3 -3
- package/dist/PagerDots-CYlqVFd4.js +196 -0
- package/dist/PaperBackdrop-DYWgrnh8.js +42 -0
- package/dist/{PopoverContent-DL7E6vJP.js → PopoverContent-BuKyHZSz.js} +2 -2
- package/dist/{Progress-CnqB7gLm.js → Progress-C9SsdwIZ.js} +1 -1
- package/dist/{ScrollingText-CTZbA_cG.js → ScrollingText-DY3W1Jfh.js} +2 -2
- package/dist/{SelectScrollDownButton-DAKCBEdW.js → SelectScrollDownButton-3mFHX_R-.js} +15 -12
- package/dist/{Switch-B8RscmRu.js → Switch-uf-UKPA2.js} +1 -1
- package/dist/{Toaster-D9qIHjBI.js → Toaster-ozrsR4mP.js} +1 -1
- package/dist/{ToggleGroupItem-BLtr3TJq.js → ToggleGroupItem-BpzaVzNm.js} +4 -4
- package/dist/{TooltipProvider-BJ_Y5EGX.js → TooltipProvider-QQVM_80r.js} +1 -1
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +1 -0
- package/dist/api/types-extra.d.ts +3 -1
- package/dist/api.js +2 -2
- package/dist/aurora.js +163 -131
- package/dist/badge-Bt14yURi.js +72 -0
- package/dist/badge.js +1 -1
- package/dist/border-progress.js +1 -1
- package/dist/button-D1W9PrzI.js +130 -0
- package/dist/button.js +1 -1
- package/dist/canvas.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.js +227 -98
- package/dist/chipVariants-BJQ0I2kB.js +18 -0
- package/dist/collapsible.js +1 -1
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/components/custom/aurora/composables/glSetup.d.ts +1 -1
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +1 -1
- package/dist/components/custom/aurora/constants/presets.d.ts +29 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/concentric/Concentric.vue.d.ts +15 -12
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +8 -3
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +8 -4
- package/dist/components/custom/concentric/composables/levelField.d.ts +50 -0
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +7 -4
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +3 -3
- package/dist/components/custom/concentric/constants.d.ts +62 -41
- 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/configurator/Configurator.vue.d.ts +23 -2
- package/dist/components/custom/configurator/index.d.ts +1 -1
- package/dist/components/custom/dock/DockDropdownTrigger.vue.d.ts +4 -3
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +10 -0
- package/dist/components/custom/dock/DockPopoverTrigger.vue.d.ts +19 -0
- package/dist/components/custom/dock/DockStack.vue.d.ts +35 -22
- package/dist/components/custom/dock/GlassDock.vue.d.ts +19 -3
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +18 -32
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +76 -145
- package/dist/components/custom/dock/composables/index.d.ts +1 -0
- package/dist/components/custom/dock/composables/railProjection.d.ts +45 -0
- package/dist/components/custom/dock/composables/useDockContextSilhouette.d.ts +192 -0
- package/dist/components/custom/dock/composables/useDockFission.d.ts +158 -0
- package/dist/components/custom/dock/composables/useDockItemDrag.d.ts +18 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +38 -0
- package/dist/components/custom/dock/constants.d.ts +14 -3
- package/dist/components/custom/dock/index.d.ts +3 -0
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +21 -0
- package/dist/components/custom/dot-flow-field/composables/flowGLProgram.d.ts +8 -0
- package/dist/components/custom/dot-flow-field/composables/flowSetupGL.d.ts +9 -0
- package/dist/components/custom/dot-flow-field/composables/flowSetupGLFlow.d.ts +12 -0
- package/dist/components/custom/dot-flow-field/composables/flowSetupWGPU.d.ts +7 -0
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +28 -2
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -17
- package/dist/components/custom/dot-flow-field/constants.d.ts +51 -0
- package/dist/components/custom/dot-flow-field/index.d.ts +1 -1
- 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 +29 -0
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +2 -1
- package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +10 -1
- package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +7 -0
- package/dist/components/custom/dot-matrix/constants.d.ts +14 -0
- package/dist/components/custom/dot-matrix/index.d.ts +1 -1
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +2 -2
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -1
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +4 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +9 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +11 -0
- package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +16 -1
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +22 -1
- package/dist/components/custom/fourier-field/constants.d.ts +53 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +1 -1
- package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/composables/easing.d.ts +1 -0
- package/dist/components/custom/goo-blob/composables/useBlobSatellites.d.ts +1 -0
- package/dist/components/custom/goo-blob/constants.d.ts +26 -1
- 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 +50 -1
- package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +32 -3
- package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +14 -4
- package/dist/components/custom/goo-dot-matrix/constants.d.ts +55 -16
- package/dist/components/custom/goo-dot-matrix/index.d.ts +1 -1
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +2 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-filter/GooFilter.vue.d.ts +22 -0
- package/dist/components/custom/goo-filter/index.d.ts +1 -0
- package/dist/components/custom/handmark/brush.d.ts +17 -17
- package/dist/components/custom/handmark/constants.d.ts +28 -8
- package/dist/components/custom/handmark/geometry.d.ts +34 -1
- package/dist/components/custom/handmark/index.d.ts +1 -1
- package/dist/components/custom/icon-chip/types.d.ts +10 -0
- package/dist/components/custom/paper-backdrop/PaperBackdrop.vue.d.ts +18 -0
- package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +44 -29
- package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +2 -0
- package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +3 -1
- package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +2 -2
- package/dist/components/custom/paper-grid/constants.d.ts +44 -6
- package/dist/components/custom/paper-grid/index.d.ts +2 -2
- package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +1 -1
- package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -1
- package/dist/components/custom/selectable-chip/chipVariants.d.ts +39 -0
- package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +12 -20
- package/dist/components/custom/tabs/constants.d.ts +16 -8
- package/dist/components/custom/timeline/ScrubberTimeline.vue.d.ts +16 -0
- package/dist/components/custom/timeline/geometry.d.ts +0 -8
- package/dist/components/custom/toggle-chip/index.d.ts +15 -4
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +12 -10
- package/dist/components/ui/_shared/useSurfaceAxis.d.ts +17 -3
- package/dist/components/ui/badge/Badge.vue.d.ts +14 -0
- package/dist/components/ui/badge/index.d.ts +1 -0
- package/dist/components/ui/button/Button.vue.d.ts +1 -0
- package/dist/components/ui/card/Card.vue.d.ts +1 -1
- package/dist/components/ui/card/ScrollCard.vue.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselContent.vue.d.ts +2 -4
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +9 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +33 -14
- package/dist/components/ui/drawer/constants.d.ts +8 -6
- package/dist/components/ui/drawer/index.d.ts +12 -2
- package/dist/components/ui/select/SelectContent.vue.d.ts +9 -0
- package/dist/components/ui/slider/Slider.vue.d.ts +9 -0
- package/dist/composables/dom/index.d.ts +1 -0
- package/dist/composables/dom/useDragVelocity.d.ts +46 -0
- package/dist/composables/glass/wave/index.d.ts +4 -0
- package/dist/composables/glass/wave/waveField.d.ts +115 -0
- package/dist/composables/glass/wave/waveField.glsl.d.ts +1 -0
- package/dist/composables/glass/wave/waveField.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +95 -2
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +40 -2
- package/dist/composables/glass/webgpu/index.d.ts +1 -0
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +37 -0
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +49 -2
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +1 -1
- package/dist/composables/motion/core/index.d.ts +4 -0
- package/dist/composables/motion/core/useHaptic.d.ts +48 -0
- package/dist/composables/motion/core/writeVelocityWeight.d.ts +31 -0
- package/dist/composables/motion/index.d.ts +2 -0
- package/dist/composables/motion/springPresets.d.ts +16 -17
- package/dist/composables/motion/suite.d.ts +2 -2
- package/dist/composables/motion/useBloomUp.d.ts +97 -0
- package/dist/composables/motion/useCelebrationBurst.d.ts +50 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +10 -28
- package/dist/composables/motion/useGooMorph.d.ts +72 -0
- package/dist/composables/motion/useLiquidFlex.d.ts +18 -0
- package/dist/composables/motion/useLiquidMorph.d.ts +108 -0
- package/dist/composables/motion/useLiquidPress.d.ts +12 -0
- package/dist/composables/motion/useLiquidReveal.d.ts +7 -4
- package/dist/composables/motion/useMorphField.d.ts +157 -0
- package/dist/composables/motion/useScrollPin.d.ts +49 -0
- package/dist/composables/motion/useScrollScene.d.ts +67 -0
- package/dist/concentric.js +532 -563
- package/dist/configurator.js +2 -2
- package/dist/confirm-dialog.js +3 -3
- package/dist/constellation.js +4 -4
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +2 -2
- package/dist/createCanvasLifecycle-CuCrGRfq.js +173 -0
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck.js +1 -1
- package/dist/dialog.js +3 -3
- package/dist/dock.js +1163 -618
- package/dist/dockContext-gFVS2gMg.js +18 -0
- package/dist/dom.js +7 -6
- package/dist/dot-flow-field.js +1114 -523
- package/dist/dot-matrix.js +348 -204
- package/dist/drawer.js +106 -96
- package/dist/{dropdown-menu-aJmV5SqE.js → dropdown-menu-CCfcCQ68.js} +3 -3
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.js +3 -3
- package/dist/expandable-container.js +2 -2
- package/dist/fading-scroll.js +1 -1
- package/dist/forms.js +6 -6
- package/dist/fourier-field.js +441 -197
- package/dist/fourier-math.js +1 -1
- package/dist/glass-panel.js +2 -2
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +139 -135
- package/dist/goo-blob.js +11 -9
- package/dist/goo-dot-matrix.js +418 -198
- package/dist/handmark.js +137 -94
- package/dist/header-ribbon.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 +3 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +7 -7
- package/dist/metric-badge.js +1 -1
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/motion-core.js +42 -39
- package/dist/motion-curves.js +20 -14
- package/dist/motion.js +226 -26
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +1 -1
- package/dist/paper-backdrop.js +1 -1
- package/dist/paper-grid.js +315 -342
- package/dist/paperGrid-CXCSMbZ1.js +191 -0
- package/dist/popover.js +1 -1
- package/dist/{presets-CvOUqtdY.js → presets-QvYgnFIZ.js} +13 -12
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +2 -2
- package/dist/{resolveCanvasColor-yPyIpJt9.js → resolveCanvasColor-DsSJk06I.js} +5 -5
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +7 -7
- package/dist/select.js +3 -3
- package/dist/selectable-chip.js +18 -35
- package/dist/separator.js +1 -1
- package/dist/{sheet-B2flBfLH.js → sheet-DUCIoOe0.js} +3 -3
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider-CcICPe3u.js +149 -0
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +3 -3
- package/dist/{spectrum-walk-BVzA7Biz.js → spectrum-walk-cBNSx_zm.js} +1 -1
- package/dist/springPresets-DfoQ6XRY.js +64 -0
- package/dist/stacked-icons.js +54 -39
- package/dist/styles/cards.css +202 -2
- package/dist/styles/components.css +1 -3
- package/dist/styles/configurator.css +172 -7
- package/dist/styles/critical-partition.mjs +35 -2
- package/dist/styles/deferred.css +2 -0
- package/dist/styles/dock/adaptive-legibility.css +119 -0
- package/dist/styles/dock/density.css +18 -10
- package/dist/styles/dock/fission-bridge.css +552 -0
- package/dist/styles/dock/layers.css +88 -124
- package/dist/styles/dock/morph-bridge.css +15 -2
- package/dist/styles/dock/morph.css +45 -114
- package/dist/styles/dock/shape.css +137 -11
- package/dist/styles/dock/shell.css +1 -3
- package/dist/styles/dock/stack-rail.css +95 -7
- package/dist/styles/dock-controls/icon-button.css +34 -2
- package/dist/styles/dock-controls/triggers.css +23 -1
- package/dist/styles/dock-controls.css +18 -0
- package/dist/styles/dock.css +16 -1
- package/dist/styles/drawer.css +166 -0
- package/dist/styles/glass/glass-atom.css +244 -0
- package/dist/styles/glass/glass-capsule.css +143 -0
- package/dist/styles/glass/glass-chip.css +215 -0
- package/dist/styles/glass/liquid-enter.css +252 -0
- package/dist/styles/glass/liquid-morph.css +850 -0
- package/dist/styles/glass/material.css +70 -1
- package/dist/styles/glass/reveal.css +22 -2
- package/dist/styles/glass/rim.css +13 -1
- package/dist/styles/glass/surfaces.css +18 -8
- package/dist/styles/glass.css +11 -0
- package/dist/styles/icon-chip.css +45 -0
- package/dist/styles/index.css +11 -0
- package/dist/styles/jubilance.css +65 -0
- package/dist/styles/motion/morph-field.css +229 -0
- package/dist/styles/paper.css +230 -14
- package/dist/styles/scroll-choreography.css +135 -78
- package/dist/styles/segmented-tabs.css +85 -51
- package/dist/styles/select.css +151 -0
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm.css +57 -8
- package/dist/styles/tokens/glass-deep.css +8 -4
- package/dist/styles/tokens/glass-fx.css +80 -2
- package/dist/styles/tokens/glass.css +140 -8
- package/dist/styles/tokens/light-dark.css +2 -2
- package/dist/styles/tokens/property-regs.css +144 -0
- package/dist/styles/tokens/scale-paper.css +20 -8
- package/dist/styles/tokens/scheme-motion.css +92 -157
- package/dist/styles/tokens/scheme-spring.css +239 -0
- package/dist/styles/tokens/scroll-tokens.css +15 -15
- package/dist/styles/tokens/shadow.css +73 -13
- package/dist/styles/tokens.css +9 -2
- package/dist/styles/utilities/btn.css +70 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +198 -181
- package/dist/timeline.js +241 -206
- package/dist/toast.js +1 -1
- package/dist/toggle-chip.js +14 -41
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{uniformBridgeWGPU-CtAKl45L.js → uniformBridgeWGPU-BCse1SHU.js} +191 -127
- package/dist/{useAnimatedNumber-CLrxicG9.js → useAnimatedNumber-BntskVdQ.js} +1 -1
- package/dist/{useConfiguratorState-4xblKfwd.js → useConfiguratorState-22BcULzF.js} +37 -35
- package/dist/useDockCtaReceive-DX7RDb6_.js +88 -0
- package/dist/{useDragMorph-BUgAC-zK.js → useDragMorph-DGLSewwB.js} +2 -2
- package/dist/useDragVelocity-CjcfX3dA.js +57 -0
- package/dist/useGooMorph-Cs13NgYL.js +104 -0
- package/dist/useGpuSubstrate-Ceet70xq.js +347 -0
- package/dist/{useViewTransition-CUI1nAgn.js → useHaptic-CPz5BT9I.js} +40 -1
- package/dist/{useLiquidFlex-UmA6LMZu.js → useLiquidFlex-Cc6PjVJD.js} +8 -3
- package/dist/useLiquidPress-CtOQ8Z0_.js +43 -0
- package/dist/useMorphField-ogBM7ubT.js +141 -0
- package/dist/{useScrollChrome-D66AVP7C.js → useScrollChrome-JuImi1DM.js} +2 -2
- package/dist/{useSpringMount-BWDnKIwh.js → useSpringMount-DFxtzmkR.js} +1 -1
- package/dist/{useSpringPress-B1-Czp-V.js → useSpringPress-VM9RgVq3.js} +1 -1
- package/dist/{useSurfaceAxis-g0NloYEF.js → useSurfaceAxis-Ci7Dnaw2.js} +1 -1
- package/dist/{useTouchGate-CBZTD4SD.js → useTouchGate-B1Lf9XqN.js} +1 -1
- package/dist/virtual.js +1 -1
- package/dist/watercolor-dot.js +16 -26
- package/dist/writeVelocityWeight-Bh83xZfs.js +19 -0
- package/package.json +14 -3
- package/src/styles/cards.css +202 -2
- package/src/styles/configurator.css +172 -7
- package/src/styles/critical-partition.mjs +35 -2
- package/src/styles/dock/adaptive-legibility.css +119 -0
- package/src/styles/dock/density.css +18 -10
- package/src/styles/dock/fission-bridge.css +552 -0
- package/src/styles/dock/layers.css +88 -124
- package/src/styles/dock/morph-bridge.css +15 -2
- package/src/styles/dock/morph.css +45 -114
- package/src/styles/dock/shape.css +137 -11
- package/src/styles/dock/shell.css +1 -3
- package/src/styles/dock/stack-rail.css +95 -7
- package/src/styles/dock-controls/icon-button.css +34 -2
- package/src/styles/dock-controls/triggers.css +23 -1
- package/src/styles/dock-controls.css +18 -0
- package/src/styles/dock.css +16 -1
- package/src/styles/drawer.css +164 -0
- package/src/styles/glass/glass-atom.css +244 -0
- package/src/styles/glass/glass-capsule.css +143 -0
- package/src/styles/glass/glass-chip.css +215 -0
- package/src/styles/glass/liquid-enter.css +252 -0
- package/src/styles/glass/liquid-morph.css +850 -0
- package/src/styles/glass/material.css +70 -1
- package/src/styles/glass/reveal.css +22 -2
- package/src/styles/glass/rim.css +13 -1
- package/src/styles/glass/surfaces.css +18 -8
- package/src/styles/glass.css +11 -0
- package/src/styles/icon-chip.css +45 -0
- package/src/styles/index.css +11 -0
- package/src/styles/jubilance.css +65 -0
- package/src/styles/motion/morph-field.css +229 -0
- package/src/styles/paper.css +230 -14
- package/src/styles/scroll-choreography.css +135 -78
- package/src/styles/segmented-tabs.css +85 -47
- package/src/styles/select.css +151 -0
- package/src/styles/tokens/color-radius.css +1 -1
- package/src/styles/tokens/dark-arm.css +57 -8
- package/src/styles/tokens/glass-deep.css +8 -4
- package/src/styles/tokens/glass-fx.css +80 -2
- package/src/styles/tokens/glass.css +140 -8
- package/src/styles/tokens/light-dark.css +2 -2
- package/src/styles/tokens/property-regs.css +144 -0
- package/src/styles/tokens/scale-paper.css +20 -8
- package/src/styles/tokens/scheme-motion.css +92 -157
- package/src/styles/tokens/scheme-spring.css +239 -0
- package/src/styles/tokens/scroll-tokens.css +15 -15
- package/src/styles/tokens/shadow.css +73 -13
- package/src/styles/tokens.css +9 -2
- package/src/styles/utilities/btn.css +70 -0
- package/dist/DialogContent-6JtTB5x2.js +0 -106
- package/dist/PagerDots-Cjx96la-.js +0 -98
- package/dist/PaperBackdrop-CqwjnfLv.js +0 -31
- package/dist/badge-D9XWW4GT.js +0 -53
- package/dist/button-5dY1Dvhd.js +0 -125
- package/dist/components/custom/concentric/composables/ringField.d.ts +0 -85
- package/dist/createCanvasLifecycle-Gh45Ce-p.js +0 -93
- package/dist/dockContext-BNfyPLe9.js +0 -17
- package/dist/slider-2A0rPn79.js +0 -142
- package/dist/springPresets-Ce7OYCm9.js +0 -46
- package/dist/useDockCtaReceive-DfFkmgL1.js +0 -82
- package/dist/useGpuSubstrate-4pTcp6mX.js +0 -294
- package/dist/useLiquidPress-BooG97RY.js +0 -39
- /package/dist/{CollapsibleContent-68dEXIAl.js → CollapsibleContent-D7UNsXQr.js} +0 -0
- /package/dist/{DialogFooter-9phqcRIS.js → DialogFooter-DoLy0ewI.js} +0 -0
- /package/dist/{InstrumentChassis-CxsHSyMj.js → InstrumentChassis-UUJX0-mW.js} +0 -0
- /package/dist/{Label-C2ejNWeC.js → Label-B_HPqi_q.js} +0 -0
- /package/dist/{ModalOverlay-D1VrWyoi.js → ModalOverlay-DfAf7o15.js} +0 -0
- /package/dist/{SelectGroup-BFiod7X2.js → SelectGroup-Dcczq44n.js} +0 -0
- /package/dist/{SelectSeparator-C2UGOkXF.js → SelectSeparator-CNRGG7Ew.js} +0 -0
- /package/dist/{Separator-DQcwC2TR.js → Separator-Cf9-JFgi.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-gLzyemvl.js} +0 -0
- /package/dist/{color-Cs0-oxYL.js → color-B9jZdhJX.js} +0 -0
- /package/dist/{compile-nZ1xVYTp.js → compile-INR_tPk_.js} +0 -0
- /package/dist/{constants--C2DkLW8.js → constants-BWj7DkMn.js} +0 -0
- /package/dist/{createContext-CpBNTRMI.js → createContext-Cd23P9j0.js} +0 -0
- /package/dist/{dotMatrixField-D_x9_1qq.js → dotMatrixField-CRO0ZFk4.js} +0 -0
- /package/dist/{flow.glsl-B2P7e0MT.js → flow.glsl-DqEGRpl4.js} +0 -0
- /package/dist/{math-Eb0w3LqU.js → math-5RcIgCB4.js} +0 -0
- /package/dist/{menuItemVariants-D8VNHq22.js → menuItemVariants-DAXquKja.js} +0 -0
- /package/dist/{prng-B-d9eYX8.js → prng-B5tIXTtj.js} +0 -0
- /package/dist/{procedural-color.wgsl-m7Zgv35j.js → procedural-color.wgsl-C1Y5PkM6.js} +0 -0
- /package/dist/{scrollReader-DI1NWxUw.js → scrollReader-rc3Ns_NM.js} +0 -0
- /package/dist/{useControlSize-SH1UmJCi.js → useControlSize-DAZ062x7.js} +0 -0
- /package/dist/{useFuzzySearch-DIhcYtcw.js → useFuzzySearch-0fTYOhS4.js} +0 -0
- /package/dist/{useGlobalDark-CmjB9E32.js → useGlobalDark-B4HO9LXG.js} +0 -0
- /package/dist/{useIntersectionPause-Dbozzjgm.js → useIntersectionPause-DO8Vl4gs.js} +0 -0
- /package/dist/{useInterval-CNdua40W.js → useInterval-BVUI-sez.js} +0 -0
- /package/dist/{useKeyboardShortcuts-BPRp33Im.js → useKeyboardShortcuts-BEut54Tk.js} +0 -0
- /package/dist/{usePointerVelocityField-QLsy3_kv.js → usePointerVelocityField-BrkqZFhj.js} +0 -0
- /package/dist/{useResizeObserver-Bpoi7tRE.js → useResizeObserver-DdEn3v2f.js} +0 -0
- /package/dist/{useResolveTokenColor-vAylyR0x.js → useResolveTokenColor-ChOnCckA.js} +0 -0
- /package/dist/{useScrollProgress-c3yxmH6a.js → useScrollProgress-A0M6qRl7.js} +0 -0
- /package/dist/{useSortable-BVqlJRBR.js → useSortable-DQV_UNDw.js} +0 -0
- /package/dist/{useTextHighlight-NmBM5V_4.js → useTextHighlight-Bma3UlKA.js} +0 -0
- /package/dist/{useTimer-BHJOKr35.js → useTimer-BBLGPXR8.js} +0 -0
- /package/dist/{useUserInvalidAria-y5namzeE.js → useUserInvalidAria-EmmwWPOl.js} +0 -0
- /package/dist/{useViewportReady-anbac3m6.js → useViewportReady-C9pYnn7K.js} +0 -0
- /package/dist/{vReveal-D9k0jADx.js → vReveal-CT1KtwZA.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AURORA_WGSL = "\nconst MAX_NUCLEI: i32 = 6;\nconst MAX_STOPS: i32 = 8;\nconst PI: f32 = 3.141592653589793;\n\n// \u2500\u2500 Uniforms (the typed-struct source-of-truth \u2014 see aurora.wgsl.uniforms.ts) \u2500\u2500\n// Scalars are packed into vec4 lanes to keep the std140/WGSL 16-byte struct alignment\n// trivial. nuc0[i] = (pos.x, pos.y, radius, paletteBias); nuc1[i] = (valueBias,\n// driftRadius, driftPhase, elong); nuc2[i] = (angle, _, _, _). palette[i].rgb is the\n// CPU-baked linear-sRGB stop.\nstruct Uniforms {\n // scalars0: (uTime, uSoftmaxBeta, uValueVariance, uWarpAmount)\n scalars0: vec4<f32>,\n // scalars1: (uWarpScale, uWarpDrift, uSaturation, uPaperGrain)\n scalars1: vec4<f32>,\n // scalars2: (uAlpha, uNucleiDrift, uPaletteDrift, uBreathDepth)\n scalars2: vec4<f32>,\n // scalars3: (uBreathPeriod, uCursorStrength, uCursorRadius, _pad)\n scalars3: vec4<f32>,\n // cursor: (uCursor.x, uCursor.y, _pad, _pad)\n cursor: vec4<f32>,\n // ints: (uStopCount, uNucleiCount, uWarpMode, uNoiseOctaves)\n ints0: vec4<i32>,\n // ints1: (uMedium, uHuePath, _, _)\n ints1: vec4<i32>,\n palette: array<vec4<f32>, 8>,\n nuc0: array<vec4<f32>, 6>,\n nuc1: array<vec4<f32>, 6>,\n nuc2: array<vec4<f32>, 6>,\n // BC.W-VIZ-AURORA (T4) \u2014 the painterly-medium scalar lanes. APPENDED after the\n // arrays so EVERY existing offset (and the smooth-default parity capture) is\n // byte-identical (these lanes are written 0 on a smooth config). scalars4:\n // (uStrokeAmount, uStrokeScale, uStrokeAnisotropy, uCanvasGrain). scalars5:\n // (uWetEdge, uGranulation, uBrokenColor, uKuwaharaQ). kuwahara: (uKuwaharaRadius,\n // uKuwaharaSectors, _, _) \u2014 the Kuwahara radius/sectors/q in lockstep with\n // packAuroraWGPUUniforms (the typed-struct discipline).\n scalars4: vec4<f32>,\n scalars5: vec4<f32>,\n kuwahara: vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> u: Uniforms;\n\n// \u2500\u2500 Authoring-scale \u2192 rad/sec lifts (byte-identical to aurora.frag.ts) \u2500\u2500\nconst K_NUCLEI: f32 = 14.0;\nconst K_PAL: f32 = 24.0;\nconst K_WARP: f32 = 5.0;\n\n// \u2500\u2500 Noise (aurora-local hash21/vnoise/fbm \u2014 legitimately divergent per AV.W2 \u00A73a) \u2500\u2500\nfn hash21(p0: vec2<f32>) -> f32 {\n var p = fract(p0 * vec2<f32>(123.34, 456.21));\n p = p + dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nfn hash22(p0: vec2<f32>) -> vec2<f32> {\n let p = vec2<f32>(dot(p0, vec2<f32>(127.1, 311.7)),\n dot(p0, vec2<f32>(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nfn vnoise(p: vec2<f32>) -> f32 {\n let i = floor(p);\n let f = fract(p);\n let uu = f * f * (3.0 - 2.0 * f);\n let a = hash21(i);\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, uu.x), mix(c, d, uu.x), uu.y);\n}\n\nconst FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);\n\nfn fbm(p0: vec2<f32>) -> f32 {\n var v = 0.0;\n var a = 0.5;\n var p = p0;\n let octaves = u.ints0.w;\n for (var i = 0; i < 5; i = i + 1) {\n if (i >= octaves) { break; }\n v = v + a * vnoise(p);\n p = FBM_ROT * p * 2.02;\n a = a * 0.5;\n }\n return v;\n}\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// value.js interpolateHue in the NORMALIZED-TURNS domain. methods: 0 shorter,\n// 1 longer, 2 increasing, 3 decreasing.\nfn interpolateHueTurns(h0: f32, h1: f32, t: f32, method: i32) -> f32 {\n let TAU = 2.0 * PI;\n var a = h0 / TAU;\n var b = h1 / TAU;\n let i = b - a;\n if (method == 0) { // shorter\n if (i > 0.5) { a = a + 1.0; } else if (i < -0.5) { b = b + 1.0; }\n } else if (method == 1) { // longer\n if (i > 0.0 && i < 0.5) { a = a + 1.0; } else if (i > -0.5 && i <= 0.0) { b = b + 1.0; }\n } else if (method == 2) { // increasing\n if (i < 0.0) { b = b + 1.0; }\n } else { // decreasing\n if (i > 0.0) { a = a + 1.0; }\n }\n var r = a + t * (b - a);\n r = fract(r); // fract is non-negative in WGSL\n return r * TAU; // back to radians\n}\n\n// Linear-sRGB endpoint pair \u2192 OKLab-rectangular interpolation \u2192 linear sRGB.\nfn mixPaletteOklab(linA: vec3<f32>, linB: vec3<f32>, t: f32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lab = mix(labA, labB, t);\n return oklabToLinearSrgb(lab);\n}\n\n// Linear-sRGB endpoint pair \u2192 OKLCh hue-arc interpolation \u2192 linear sRGB.\nfn mixPaletteOklchArc(linA: vec3<f32>, linB: vec3<f32>, t: f32, method: i32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lchA = oklabToOklch(labA);\n let lchB = oklabToOklch(labB);\n let L = mix(lchA.x, lchB.x, t);\n let C = mix(lchA.y, lchB.y, t);\n let H = interpolateHueTurns(lchA.z, lchB.z, t, method);\n return oklabToLinearSrgb(oklchToOklab(vec3<f32>(L, C, H)));\n}\n\n// The ramp dispatcher (the samplePalette splices it). tRaw is the raw inter-stop\n// parameter [0,1]; the smoothstep ease + the huePath branch live here so the ramp is\n// one source. increasing(2)/decreasing(3) take the OKLCh hue-arc; every other method\n// takes the OKLab-rectangular straight line.\nfn samplePaletteRamp(a: vec3<f32>, b: vec3<f32>, tRaw: f32, huePath: i32) -> vec3<f32> {\n let t = smoothstep(0.0, 1.0, tRaw);\n if (huePath == 2 || huePath == 3) {\n return mixPaletteOklchArc(a, b, t, huePath);\n }\n return mixPaletteOklab(a, b, t);\n}\n\n// Interleaved Gradient Noise (Jimenez) \u2014 display-space 1-LSB dither.\nfn ign(p: vec2<f32>) -> f32 {\n return fract(52.9829189 * fract(dot(p, vec2<f32>(0.06711056, 0.00583715))));\n}\n\n// Cellular / Worley f1.\nfn cellular(p: vec2<f32>) -> f32 {\n let i = floor(p);\n let f = fract(p);\n var m = 1e9;\n for (var y = -1; y <= 1; y = y + 1) {\n for (var x = -1; x <= 1; x = x + 1) {\n let g = vec2<f32>(f32(x), f32(y));\n let o = hash22(i + g);\n let r = g + o - f;\n m = min(m, dot(r, r));\n }\n }\n return sqrt(m);\n}\n\n// \u2500\u2500 Warp (Quilez double warp + the three warp modes + the cursor swirl) \u2500\u2500\nfn domainWarp(p: vec2<f32>, t: f32) -> vec2<f32> {\n let warpScale = u.scalars1.x;\n let warpDrift = u.scalars1.y;\n let warpAmount = u.scalars0.w;\n let warpMode = u.ints0.z;\n let cursorStrength = u.scalars3.y;\n let cursorRadius = u.scalars3.z;\n let cursor = u.cursor.xy;\n\n let q = vec2<f32>(fbm(p * warpScale + vec2<f32>(0.0, 0.0) + t * warpDrift * K_WARP),\n fbm(p * warpScale + vec2<f32>(5.2, 1.3) + t * warpDrift * K_WARP));\n let r = vec2<f32>(fbm(p * warpScale + 4.0 * q + vec2<f32>(1.7, 9.2)),\n fbm(p * warpScale + 4.0 * q + vec2<f32>(8.3, 2.8)));\n\n var warp = r;\n if (warpMode == 1) {\n // cellular \u2014 chunky territories\n let c1 = cellular(p * warpScale * 1.5 + vec2<f32>(t * warpDrift * K_WARP * 2.0, 0.0));\n let c2 = cellular(p * warpScale * 1.5 + vec2<f32>(11.0, 7.0 + t * warpDrift * K_WARP * 2.0));\n warp = vec2<f32>(c1, c2);\n } else if (warpMode == 2) {\n // hybrid \u2014 fbm + cellular averaged\n let c1 = cellular(p * warpScale * 1.2);\n let c2 = cellular(p * warpScale * 1.2 + vec2<f32>(11.0, 7.0));\n warp = mix(r, vec2<f32>(c1, c2), 0.5);\n }\n var warped = p + warpAmount * warp;\n\n // Cursor swirl \u2014 rotate p around the cursor with radial falloff.\n if (cursorStrength > 0.001) {\n let toP = p - cursor;\n let d = length(toP);\n let rr = max(cursorRadius, 0.01);\n let w = exp(-(d * d) / (rr * rr * 0.45));\n let ang = w * cursorStrength * 2.1;\n let ca = cos(ang);\n let sa = sin(ang);\n var rotated = vec2<f32>(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + cursor;\n let pinch = w * cursorStrength * 0.08;\n rotated = mix(rotated, cursor, pinch);\n warped = mix(warped, rotated + warpAmount * warp * 0.7, w * cursorStrength);\n }\n return warped;\n}\n\n// \u2500\u2500 Palette LUT \u2500\u2500\nfn samplePalette(id0: f32) -> vec3<f32> {\n let id = clamp(id0, 0.0, 1.0);\n let stopCount = u.ints0.x;\n let scaled = id * f32(stopCount - 1);\n let i0 = i32(floor(scaled));\n let i1 = min(i0 + 1, stopCount - 1);\n let t = fract(scaled);\n return samplePaletteRamp(u.palette[i0].rgb, u.palette[i1].rgb, t, u.ints1.y);\n}\n\n// \u2500\u2500 Nuclei field (anisotropic Gaussian softmax + drift + palette drift) \u2500\u2500\nstruct NucleiResult { paletteId: f32, valueMod: f32 };\n\nfn nucleiField(p: vec2<f32>, t: f32) -> NucleiResult {\n let nucleiCount = u.ints0.y;\n let nucleiDrift = u.scalars2.y;\n let paletteDrift = u.scalars2.z;\n let softmaxBeta = u.scalars0.y;\n\n var accumBias = 0.0;\n var accumValue = 0.0;\n var accumW = 0.0;\n for (var i = 0; i < MAX_NUCLEI; i = i + 1) {\n if (i >= nucleiCount) { break; }\n let n0 = u.nuc0[i]; // pos.x, pos.y, radius, paletteBias\n let n1 = u.nuc1[i]; // valueBias, driftRadius, driftPhase, elong\n let angle = u.nuc2[i].x;\n let driftRadius = n1.y;\n let driftPhase = n1.z;\n let posI = n0.xy + driftRadius * vec2<f32>(\n cos(t * nucleiDrift * K_NUCLEI + driftPhase),\n sin(t * nucleiDrift * K_NUCLEI + driftPhase * 1.13)\n );\n let diff = p - posI;\n let ca = cos(angle);\n let sa = sin(angle);\n let local = vec2<f32>(ca * diff.x + sa * diff.y, -sa * diff.x + ca * diff.y);\n let along = local.x / max(n1.w, 0.01);\n let across = local.y;\n let d2 = along * along + across * across;\n let r = max(n0.z, 0.01);\n let w = exp(-softmaxBeta * d2 / (r * r));\n accumBias = accumBias + w * n0.w;\n accumValue = accumValue + w * n1.x;\n accumW = accumW + w;\n }\n var paletteId = accumBias / max(accumW, 1e-4);\n let valueMod = accumValue / max(accumW, 1e-4);\n\n let palAmp = clamp(paletteDrift * 6.0, 0.0, 0.06);\n paletteId = paletteId + palAmp * sin(t * paletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n return NucleiResult(paletteId, valueMod);\n}\n\n// \u2500\u2500 Color utils (OKLCh saturation) \u2500\u2500\nfn linOklab(lin: vec3<f32>) -> vec3<f32> {\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\nfn saturate3(c: vec3<f32>, amt: f32) -> vec3<f32> {\n var lch = oklabToOklch(linOklab(c));\n lch.y = max(lch.y * amt, 0.0);\n return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3<f32>(0.0));\n}\n\n// \u2500\u2500 PBR-Neutral tonemap (named aces() in the GLSL \u2014 the tonemap slot) \u2500\u2500\nfn aces(color0: vec3<f32>) -> vec3<f32> {\n let startCompression = 0.8 - 0.04;\n let desaturation = 0.15;\n var color = color0;\n let x = min(color.r, min(color.g, color.b));\n var offset = 0.04;\n if (x < 0.08) { offset = x - 6.25 * x * x; }\n color = color - offset;\n let peak = max(color.r, max(color.g, color.b));\n if (peak < startCompression) { return clamp(color, vec3<f32>(0.0), vec3<f32>(1.0)); }\n let d = 1.0 - startCompression;\n let newPeak = 1.0 - d * d / (peak + d - startCompression);\n color = color * (newPeak / peak);\n let g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);\n return clamp(mix(color, newPeak * vec3<f32>(1.0), g), vec3<f32>(0.0), vec3<f32>(1.0));\n}\n\n// \u2500\u2500 BC.W-VIZ-AURORA (T4) \u2014 the painterly-medium bodies (the keystone WGSL port) \u2500\u2500\n// Spliced HERE, after every helper the mediums consume is defined (domainWarp,\n// nucleiField, samplePalette, linOklab, saturate3, oklabToOklch/oklchToOklab,\n// hash21/vnoise/fbm) and before the vertex/fragment stages. applyMedium(col,p,t)\n// is the dispatch the fragment stage calls.\n\n// \u2500\u2500 Painterly luma + medium scalar accessors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconst W_LUMA: vec3<f32> = vec3<f32>(0.2126, 0.7152, 0.0722);\n\nfn mStrokeAmount() -> f32 { return u.scalars4.x; }\nfn mStrokeScale() -> f32 { return u.scalars4.y; }\nfn mStrokeAnisotropy() -> f32 { return u.scalars4.z; }\nfn mCanvasGrain() -> f32 { return u.scalars4.w; }\nfn mWetEdge() -> f32 { return u.scalars5.x; }\nfn mGranulation() -> f32 { return u.scalars5.y; }\nfn mBrokenColor() -> f32 { return u.scalars5.z; }\nfn mKuwaharaQ() -> f32 { return u.scalars5.w; }\nfn mKuwaharaRadius() -> f32 { return u.kuwahara.x; }\n\n// \u2500\u2500 Base color re-sample (the edge-mask operator the mediums Sobel/sector-sample) \u2500\u2500\n// The WGSL twin of mediums.glsl.ts sampleBase: warp -> nuclei field -> palette -> value.\nfn sampleBase(p: vec2<f32>, t: f32) -> vec3<f32> {\n let pw = domainWarp(p, t);\n let nf = nucleiField(pw, t);\n var c = samplePalette(nf.paletteId);\n c = c * (1.0 + u.scalars0.z * nf.valueMod);\n return c;\n}\n\n// \u2500\u2500 Broken color (hue + chroma jitter at constant OKLCh L) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfn brokenColorJitter(c: vec3<f32>, hueSeed: f32, valueSeed: f32, strength: f32) -> vec3<f32> {\n let amt = clamp(mBrokenColor() * strength, 0.0, 1.0);\n if (amt <= 0.001) { return c; }\n var lch = oklabToOklch(linOklab(c));\n lch.z = lch.z + (hueSeed - 0.5) * (32.0 * PI / 180.0) * amt;\n lch.y = max(lch.y * (1.0 + (valueSeed - 0.5) * 0.28 * amt), 0.0);\n return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3<f32>(0.0));\n}\n\n// \u2500\u2500 Structure-tensor / edge-tangent-flow (AW.W4.1; the WGSL twin) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Returns vec3(tangent.x, tangent.y, A) \u2014 the minor-eigenvector edge-tangent + coherence.\nfn structureTensorField(p: vec2<f32>, t: f32, fallbackDir: vec2<f32>) -> vec3<f32> {\n let e = 0.0035;\n let l00 = dot(sampleBase(p + vec2<f32>(-e, -e), t), W_LUMA);\n let l10 = dot(sampleBase(p + vec2<f32>(0.0, -e), t), W_LUMA);\n let l20 = dot(sampleBase(p + vec2<f32>( e, -e), t), W_LUMA);\n let l01 = dot(sampleBase(p + vec2<f32>(-e, 0.0), t), W_LUMA);\n let l21 = dot(sampleBase(p + vec2<f32>( e, 0.0), t), W_LUMA);\n let l02 = dot(sampleBase(p + vec2<f32>(-e, e), t), W_LUMA);\n let l12 = dot(sampleBase(p + vec2<f32>(0.0, e), t), W_LUMA);\n let l22 = dot(sampleBase(p + vec2<f32>( e, e), t), W_LUMA);\n let Gx = (l20 + 2.0 * l21 + l22) - (l00 + 2.0 * l01 + l02);\n let Gy = (l02 + 2.0 * l12 + l22) - (l00 + 2.0 * l10 + l20);\n let Jxx = Gx * Gx;\n let Jyy = Gy * Gy;\n let Jxy = Gx * Gy;\n let tr = Jxx + Jyy;\n let disc = sqrt(max((Jxx - Jyy) * (Jxx - Jyy) + 4.0 * Jxy * Jxy, 0.0));\n let lambdaMaj = 0.5 * (tr + disc);\n let lambdaMin = 0.5 * (tr - disc);\n var tangent: vec2<f32>;\n if (disc < 1e-7) {\n tangent = fallbackDir;\n } else {\n let theta = 0.5 * atan2(2.0 * Jxy, Jxx - Jyy);\n tangent = vec2<f32>(-sin(theta), cos(theta));\n }\n var A = (lambdaMaj - lambdaMin) / (lambdaMaj + lambdaMin + 1e-6);\n A = clamp(A, 0.0, 1.0);\n if (dot(tangent, fallbackDir) < 0.0) { tangent = -tangent; }\n let blendW = pow(A, 0.28);\n let dir = normalize(mix(fallbackDir, tangent, blendW) + vec2<f32>(1e-6, 1e-6));\n return vec3<f32>(dir, A);\n}\n\n// \u2500\u2500 Flow field (the WGSL twin \u2014 the simple flow seed the medium fallback dirs use) \u2500\u2500\nfn flowField(p: vec2<f32>, t: f32) -> vec2<f32> {\n // Curl-noise-driven swirl (the medium-default dir; the full radial/swirl/diagonal\n // dispatch rides uniforms the WGSL struct does not carry \u2014 the procedural mediums\n // use this multi/curl seed as the fallback the structure tensor relaxes toward).\n let n = fbm(p * 2.0 + vec2<f32>(t * 0.02, t * 0.02));\n let a = n * 6.2831853;\n var dir = vec2<f32>(cos(a), sin(a));\n // Cursor swirl bias (matches the GLSL flow cursor term \u2014 the steady attraction).\n let cursorStrength = u.scalars3.y;\n let cursorRadius = u.scalars3.z;\n let cursor = u.cursor.xy;\n if (cursorStrength > 0.001) {\n let toCur = cursor - p;\n let d = length(toCur);\n let r = max(cursorRadius, 0.01);\n let w = exp(-(d * d) / (r * r * 0.5));\n let tangent = vec2<f32>(-toCur.y, toCur.x) / max(d, 1e-4);\n let a0 = atan2(dir.y, dir.x);\n let a1 = atan2(tangent.y, tangent.x);\n var da = a1 - a0;\n da = atan2(sin(da), cos(da));\n let aa = a0 + da * w * cursorStrength;\n dir = vec2<f32>(cos(aa), sin(aa));\n }\n return dir;\n}\n\n// \u2500\u2500 Watercolor \u2014 wet-edge cauliflowers + granulation + wash banding \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfn mediumWatercolor(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n var col = col0;\n let eps = 0.004;\n let cx1 = sampleBase(p + vec2<f32>(eps, 0.0), t);\n let cx2 = sampleBase(p - vec2<f32>(eps, 0.0), t);\n let cy1 = sampleBase(p + vec2<f32>(0.0, eps), t);\n let cy2 = sampleBase(p - vec2<f32>(0.0, eps), t);\n let gx = dot(cx1 - cx2, W_LUMA);\n let gy = dot(cy1 - cy2, W_LUMA);\n let edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n let mask = smoothstep(0.0, 2.5, edge);\n col = col * mix(1.0, 0.78, mask * mWetEdge());\n\n let paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n let pigLoad = 1.0 - dot(col, W_LUMA);\n col = col * (1.0 - mGranulation() * pigLoad * (paper - 0.5));\n\n let band = fbm(vec2<f32>(p.x * 1.5, p.y * 0.4));\n col = col * (1.0 + 0.04 * (band - 0.5));\n return col;\n}\n\n// \u2500\u2500 Pastel \u2014 anisotropic stroke noise along the flow + tooth grain \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfn mediumPastel(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n var col = col0;\n let flow = flowField(p, t);\n let perp = vec2<f32>(-flow.y, flow.x);\n let strokeScale = mStrokeScale();\n let along = dot(p, flow) * strokeScale;\n var across = dot(p, perp) * strokeScale;\n across = across + 0.03 * (vnoise(p * 260.0) - 0.5);\n\n let aniso = mix(1.0, 0.18, mStrokeAnisotropy());\n let stroke = fbm(vec2<f32>(along * aniso, across));\n col = col * mix(1.0, 0.82 + 0.32 * stroke, mStrokeAmount());\n\n let tooth = vnoise(p * 800.0);\n col = col * (1.0 - 0.08 * mStrokeAmount() * (tooth - 0.5));\n return col;\n}\n\n// \u2500\u2500 Crayon \u2014 DRY wax pigment on paper tooth (the tooth-multiply + scumble) \u2500\u2500\nfn mediumCrayon(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n let flow = structureTensorField(p, t, flowField(p, t)).xy;\n let ang = atan2(flow.y, flow.x);\n let ca = cos(-ang);\n let sa = sin(-ang);\n let pr = vec2<f32>(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n let aniso = mix(0.45, 0.95, mStrokeAnisotropy());\n let scale = max(mStrokeScale() * 1.6, 180.0);\n\n let t1 = vnoise(vec2<f32>(pr.x * scale * aniso, pr.y * scale));\n let t2 = vnoise(vec2<f32>(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + vec2<f32>(11.0, 11.0));\n let t3 = vnoise(vec2<f32>(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + vec2<f32>(23.0, 23.0));\n let tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n\n let pressure = clamp(mStrokeAmount(), 0.0, 1.0);\n let bite = mix(0.18, 0.46, pressure);\n var result = col0 * (1.0 - bite * (0.5 - tooth));\n\n let scumbleMask = smoothstep(0.42, 0.78, vnoise(vec2<f32>(pr.x * scale * 0.55, pr.y * scale * 0.22) + vec2<f32>(7.0, 7.0)));\n let scumbleCoverage = scumbleMask * pressure * 0.7;\n let paper = col0 * mix(0.80, 0.94, pressure);\n result = mix(paper, result, scumbleCoverage);\n\n let pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n let pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + vec2<f32>(19.0, 19.0)));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + vec2<f32>(17.0, 17.0)),\n hash21(pigmentCell * 2.1 + vec2<f32>(31.0, 31.0)),\n 0.45 + 0.55 * pigmentMask\n );\n\n result = saturate3(result, 1.08);\n return result;\n}\n\n// \u2500\u2500 Kuwahara \u2014 the SOFT anisotropic generalized Kuwahara painterly finish \u2500\u2500\u2500\u2500\n// THE KEYSTONE (Kyprianidis 2010). Aurora is a PROCEDURAL field (no input texture) so the\n// operator runs over sampleBase directly: an elliptical kernel oriented along the structure\n// tensor (elongated along the edge-tangent, narrowed across by the anisotropy), 8 OVERLAPPING\n// sectors via SMOOTH gaussian-angular weights, blended by 1/(1+var^q) (the SOFT criterion \u2192\n// no 8-spoke pinwheel by construction). 4 rings \u00D7 8 angular taps = 32 procedural samples.\nfn mediumKuwahara(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n let stf = structureTensorField(p, t, flowField(p, t));\n let tangent = stf.xy;\n let A = stf.z;\n // The studio knob drives the patch radius; clamp into the procedural patch band.\n let radius = clamp(mKuwaharaRadius() + mStrokeScale() * 0.00018, 0.006, 0.024);\n let aniso = mix(1.0, 0.34, clamp(A, 0.0, 1.0));\n let ax = tangent;\n let ay = vec2<f32>(-tangent.y, tangent.x);\n\n // Per-sector weighted sums (8 sectors). WGSL has no runtime-indexed local arrays of\n // vectors as cleanly as GLSL, so unroll the sector accumulators explicitly.\n var mSum: array<vec3<f32>, 8>;\n var sSum: array<vec3<f32>, 8>;\n var wSum: array<f32, 8>;\n for (var i = 0; i < 8; i = i + 1) {\n mSum[i] = vec3<f32>(0.0);\n sSum[i] = vec3<f32>(0.0);\n wSum[i] = 0.0;\n }\n\n let RINGS = 4;\n let TAPS = 8;\n for (var r = 1; r <= RINGS; r = r + 1) {\n let rr = f32(r) / f32(RINGS);\n let radial = 1.0 - 0.6 * rr;\n for (var a = 0; a < TAPS; a = a + 1) {\n let ang = 6.2831853 * f32(a) / f32(TAPS);\n let dirE = ax * cos(ang) + ay * (sin(ang) * aniso);\n let off = dirE * (radius * rr);\n let c = sampleBase(p + off, t);\n for (var k = 0; k < 8; k = k + 1) {\n let sectorAng = 6.2831853 * f32(k) / 8.0;\n var d = ang - sectorAng;\n d = atan2(sin(d), cos(d));\n let sw = exp(-d * d * 2.2) * radial;\n mSum[k] = mSum[k] + c * sw;\n sSum[k] = sSum[k] + c * c * sw;\n wSum[k] = wSum[k] + sw;\n }\n }\n }\n\n let q = max(mKuwaharaQ(), 1.0);\n var accum = vec3<f32>(0.0);\n var accumW = 0.0;\n for (var k = 0; k < 8; k = k + 1) {\n let wk = max(wSum[k], 1e-4);\n let mean = mSum[k] / wk;\n let var3 = max(sSum[k] / wk - mean * mean, vec3<f32>(0.0));\n let variance = dot(var3, W_LUMA);\n let sectorW = 1.0 / (1.0 + pow(variance * 320.0, q));\n accum = accum + mean * sectorW;\n accumW = accumW + sectorW;\n }\n var result = accum / max(accumW, 1e-4);\n\n // Anchor in near-flat zones so the smoothing only bites at edges.\n let center = sampleBase(p, t);\n result = mix(center, result, clamp(0.35 + 0.65 * A, 0.0, 1.0));\n\n // Faint canvas tooth + pigment-saturation so the flattened patches read as oil paint.\n let tooth = vnoise(p * 300.0) - 0.5;\n result = result * (1.0 + tooth * 0.06 * mCanvasGrain());\n result = saturate3(result, 1.04);\n\n return mix(col0, result, clamp(mStrokeAmount(), 0.0, 1.0));\n}\n\n// \u2500\u2500 Medium dispatch (the WGSL twin of the GLSL main() if-ladder) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// uMedium: 0 smooth \u00B7 1 pastel \u00B7 2 watercolor \u00B7 3 oil \u00B7 4 crayon \u00B7 5 vangogh \u00B7\n// 6 oil-pastel \u00B7 7 kuwahara. The cheap peer mediums (pastel/watercolor/crayon) +\n// kuwahara port their own bodies; the oil/vangogh/oil-pastel STROKE cascade renders\n// the anisotropic-Kuwahara PAINTERLY finish here (a real oil-paint read, never the\n// smooth core \u2014 the \"NO FALLBACKS on Safari\" mandate; the full per-dab Starry-Night\n// stroke WGSL is the booked W-AURORA-WGPU-MEDIUMS-STROKES tail).\nfn applyMedium(col: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n let medium = u.ints1.x;\n if (medium == 1) { return mediumPastel(col, p, t); }\n if (medium == 2) { return mediumWatercolor(col, p, t); }\n if (medium == 4) { return mediumCrayon(col, p, t); }\n // oil(3) / vangogh(5) / oil-pastel(6) / kuwahara(7) all render the painterly\n // anisotropic-Kuwahara finish on the WGSL primary (the WebGL2 fallback carries the\n // full per-dab stroke cascade for oil/vangogh/oil-pastel).\n if (medium == 3 || medium == 5 || medium == 6 || medium == 7) {\n return mediumKuwahara(col, p, t);\n }\n return col;\n}\n\n\n// \u2500\u2500 Full-screen triangle vertex stage (the pilot idiom \u2014 no vertex buffer) \u2500\u2500\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) uv: vec2<f32>,\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n // NDC corners of the covering triangle (-1,-1), (3,-1), (-1,3).\n var p = vec2<f32>(-1.0, -1.0);\n if (vi == 1u) { p = vec2<f32>(3.0, -1.0); }\n else if (vi == 2u) { p = vec2<f32>(-1.0, 3.0); }\n var out: VSOut;\n out.pos = vec4<f32>(p, 0.0, 1.0);\n // vUv = aPos * 0.5 + 0.5 (the aurora.vert convention).\n out.uv = p * 0.5 + 0.5;\n return out;\n}\n\n// \u2500\u2500 Fragment stage (the main() transcription) \u2500\u2500\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n let t = u.scalars0.x;\n let valueVariance = u.scalars0.z;\n let breathDepth = u.scalars2.w;\n let breathPeriod = u.scalars3.x;\n let saturation = u.scalars1.z;\n let paperGrain = u.scalars1.w;\n let alpha = u.scalars2.x;\n\n let uv = in.uv;\n let pN = uv;\n\n let p_warp = domainWarp(pN, t);\n\n let nf = nucleiField(p_warp, t);\n var col = samplePalette(nf.paletteId);\n col = col * (1.0 + valueVariance * nf.valueMod);\n\n // Breath \u2014 slow global luminance wobble.\n let breath = sin(t * 6.2831 / max(breathPeriod, 1.0));\n col = col * (1.0 + breathDepth * breath * 0.5);\n\n // BC.W-VIZ-AURORA (T4) \u2014 the painterly-medium dispatch. uMedium 0 (smooth) is a\n // no-op pass-through so the DEFAULT smooth config is byte-identical to the prior\n // WGSL primary (the parity capture); uMedium 1-7 render the ported painterly\n // bodies (pastel/watercolor/crayon/kuwahara) or the anisotropic-Kuwahara finish\n // (oil/vangogh/oil-pastel) \u2014 never a silent smooth degrade on Safari 26.\n col = applyMedium(col, pN, t);\n\n // Saturation trim.\n col = saturate3(col, saturation);\n\n // Tonemap + film grain.\n col = aces(col);\n // gl_FragCoord.xy \u2192 the device-pixel position (the WGSL @builtin(position)).\n let fragCoord = in.pos.xy;\n let grain = hash21(fragCoord + t * 17.0);\n col = col + (grain - 0.5) * paperGrain;\n\n col = clamp(col * 0.985 + 0.008, vec3<f32>(0.0), vec3<f32>(1.0));\n\n // MANDATORY OETF \u2014 closes the seam (the whole pipeline above runs in LINEAR).\n col = linearToSrgb(col);\n\n // 1-LSB triangular IGN dither in DISPLAY space, AFTER the OETF.\n col = col + (1.0 / 255.0) * (ign(fragCoord) - 0.5);\n\n // Premultiply on DISPLAY-space color (matches the WebGL2 path: OETF, then premul).\n return vec4<f32>(col * alpha, alpha);\n}\n";
|
|
1
|
+
export declare const AURORA_WGSL = "\nconst MAX_NUCLEI: i32 = 6;\nconst MAX_STOPS: i32 = 8;\nconst PI: f32 = 3.141592653589793;\n\n// \u2500\u2500 Uniforms (the typed-struct source-of-truth \u2014 see aurora.wgsl.uniforms.ts) \u2500\u2500\n// Scalars are packed into vec4 lanes to keep the std140/WGSL 16-byte struct alignment\n// trivial. nuc0[i] = (pos.x, pos.y, radius, paletteBias); nuc1[i] = (valueBias,\n// driftRadius, driftPhase, elong); nuc2[i] = (angle, _, _, _). palette[i].rgb is the\n// CPU-baked linear-sRGB stop.\nstruct Uniforms {\n // scalars0: (uTime, uSoftmaxBeta, uValueVariance, uWarpAmount)\n scalars0: vec4<f32>,\n // scalars1: (uWarpScale, uWarpDrift, uSaturation, uPaperGrain)\n scalars1: vec4<f32>,\n // scalars2: (uAlpha, uNucleiDrift, uPaletteDrift, uBreathDepth)\n scalars2: vec4<f32>,\n // scalars3: (uBreathPeriod, uCursorStrength, uCursorRadius, uVividness)\n // BD.W-AUR-VIVIDNESS \u2014 the .w pad lane now carries the \u00A73 chroma-floor strength.\n scalars3: vec4<f32>,\n // cursor: (uCursor.x, uCursor.y, _pad, _pad)\n cursor: vec4<f32>,\n // ints: (uStopCount, uNucleiCount, uWarpMode, uNoiseOctaves)\n ints0: vec4<i32>,\n // ints1: (uMedium, uHuePath, _, _)\n ints1: vec4<i32>,\n palette: array<vec4<f32>, 8>,\n nuc0: array<vec4<f32>, 6>,\n nuc1: array<vec4<f32>, 6>,\n nuc2: array<vec4<f32>, 6>,\n // BC.W-VIZ-AURORA (T4) \u2014 the painterly-medium scalar lanes. APPENDED after the\n // arrays so EVERY existing offset (and the smooth-default parity capture) is\n // byte-identical (these lanes are written 0 on a smooth config). scalars4:\n // (uStrokeAmount, uStrokeScale, uStrokeAnisotropy, uCanvasGrain). scalars5:\n // (uWetEdge, uGranulation, uBrokenColor, uKuwaharaQ). kuwahara: (uKuwaharaRadius,\n // uKuwaharaSectors, _, _) \u2014 the Kuwahara radius/sectors/q in lockstep with\n // packAuroraWGPUUniforms (the typed-struct discipline).\n scalars4: vec4<f32>,\n scalars5: vec4<f32>,\n kuwahara: vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> u: Uniforms;\n\n// \u2500\u2500 Authoring-scale \u2192 rad/sec lifts (byte-identical to aurora.frag.ts) \u2500\u2500\nconst K_NUCLEI: f32 = 14.0;\nconst K_PAL: f32 = 24.0;\nconst K_WARP: f32 = 5.0;\n\n// \u2500\u2500 Noise (aurora-local hash21/vnoise/fbm \u2014 legitimately divergent per AV.W2 \u00A73a) \u2500\u2500\nfn hash21(p0: vec2<f32>) -> f32 {\n var p = fract(p0 * vec2<f32>(123.34, 456.21));\n p = p + dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nfn hash22(p0: vec2<f32>) -> vec2<f32> {\n let p = vec2<f32>(dot(p0, vec2<f32>(127.1, 311.7)),\n dot(p0, vec2<f32>(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nfn vnoise(p: vec2<f32>) -> f32 {\n let i = floor(p);\n let f = fract(p);\n let uu = f * f * (3.0 - 2.0 * f);\n let a = hash21(i);\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, uu.x), mix(c, d, uu.x), uu.y);\n}\n\nconst FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);\n\nfn fbm(p0: vec2<f32>) -> f32 {\n var v = 0.0;\n var a = 0.5;\n var p = p0;\n let octaves = u.ints0.w;\n for (var i = 0; i < 5; i = i + 1) {\n if (i >= octaves) { break; }\n v = v + a * vnoise(p);\n p = FBM_ROT * p * 2.02;\n a = a * 0.5;\n }\n return v;\n}\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// value.js interpolateHue in the NORMALIZED-TURNS domain. methods: 0 shorter,\n// 1 longer, 2 increasing, 3 decreasing.\nfn interpolateHueTurns(h0: f32, h1: f32, t: f32, method: i32) -> f32 {\n let TAU = 2.0 * PI;\n var a = h0 / TAU;\n var b = h1 / TAU;\n let i = b - a;\n if (method == 0) { // shorter\n if (i > 0.5) { a = a + 1.0; } else if (i < -0.5) { b = b + 1.0; }\n } else if (method == 1) { // longer\n if (i > 0.0 && i < 0.5) { a = a + 1.0; } else if (i > -0.5 && i <= 0.0) { b = b + 1.0; }\n } else if (method == 2) { // increasing\n if (i < 0.0) { b = b + 1.0; }\n } else { // decreasing\n if (i > 0.0) { a = a + 1.0; }\n }\n var r = a + t * (b - a);\n r = fract(r); // fract is non-negative in WGSL\n return r * TAU; // back to radians\n}\n\n// Linear-sRGB endpoint pair \u2192 OKLab-rectangular interpolation \u2192 linear sRGB.\nfn mixPaletteOklab(linA: vec3<f32>, linB: vec3<f32>, t: f32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lab = mix(labA, labB, t);\n return oklabToLinearSrgb(lab);\n}\n\n// Linear-sRGB endpoint pair \u2192 OKLCh hue-arc interpolation \u2192 linear sRGB.\nfn mixPaletteOklchArc(linA: vec3<f32>, linB: vec3<f32>, t: f32, method: i32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lchA = oklabToOklch(labA);\n let lchB = oklabToOklch(labB);\n let L = mix(lchA.x, lchB.x, t);\n let C = mix(lchA.y, lchB.y, t);\n let H = interpolateHueTurns(lchA.z, lchB.z, t, method);\n return oklabToLinearSrgb(oklchToOklab(vec3<f32>(L, C, H)));\n}\n\n// The ramp dispatcher (the samplePalette splices it). tRaw is the raw inter-stop\n// parameter [0,1]; the smoothstep ease + the huePath branch live here so the ramp is\n// one source. increasing(2)/decreasing(3) take the OKLCh hue-arc; every other method\n// takes the OKLab-rectangular straight line.\nfn samplePaletteRamp(a: vec3<f32>, b: vec3<f32>, tRaw: f32, huePath: i32) -> vec3<f32> {\n let t = smoothstep(0.0, 1.0, tRaw);\n if (huePath == 2 || huePath == 3) {\n return mixPaletteOklchArc(a, b, t, huePath);\n }\n return mixPaletteOklab(a, b, t);\n}\n\n// Interleaved Gradient Noise (Jimenez) \u2014 display-space 1-LSB dither.\nfn ign(p: vec2<f32>) -> f32 {\n return fract(52.9829189 * fract(dot(p, vec2<f32>(0.06711056, 0.00583715))));\n}\n\n// Cellular / Worley f1.\nfn cellular(p: vec2<f32>) -> f32 {\n let i = floor(p);\n let f = fract(p);\n var m = 1e9;\n for (var y = -1; y <= 1; y = y + 1) {\n for (var x = -1; x <= 1; x = x + 1) {\n let g = vec2<f32>(f32(x), f32(y));\n let o = hash22(i + g);\n let r = g + o - f;\n m = min(m, dot(r, r));\n }\n }\n return sqrt(m);\n}\n\n// \u2500\u2500 Warp (Quilez double warp + the three warp modes + the cursor swirl) \u2500\u2500\nfn domainWarp(p: vec2<f32>, t: f32) -> vec2<f32> {\n let warpScale = u.scalars1.x;\n let warpDrift = u.scalars1.y;\n let warpAmount = u.scalars0.w;\n let warpMode = u.ints0.z;\n let cursorStrength = u.scalars3.y;\n let cursorRadius = u.scalars3.z;\n let cursor = u.cursor.xy;\n\n let q = vec2<f32>(fbm(p * warpScale + vec2<f32>(0.0, 0.0) + t * warpDrift * K_WARP),\n fbm(p * warpScale + vec2<f32>(5.2, 1.3) + t * warpDrift * K_WARP));\n let r = vec2<f32>(fbm(p * warpScale + 4.0 * q + vec2<f32>(1.7, 9.2)),\n fbm(p * warpScale + 4.0 * q + vec2<f32>(8.3, 2.8)));\n\n var warp = r;\n if (warpMode == 1) {\n // cellular \u2014 chunky territories\n let c1 = cellular(p * warpScale * 1.5 + vec2<f32>(t * warpDrift * K_WARP * 2.0, 0.0));\n let c2 = cellular(p * warpScale * 1.5 + vec2<f32>(11.0, 7.0 + t * warpDrift * K_WARP * 2.0));\n warp = vec2<f32>(c1, c2);\n } else if (warpMode == 2) {\n // hybrid \u2014 fbm + cellular averaged\n let c1 = cellular(p * warpScale * 1.2);\n let c2 = cellular(p * warpScale * 1.2 + vec2<f32>(11.0, 7.0));\n warp = mix(r, vec2<f32>(c1, c2), 0.5);\n }\n var warped = p + warpAmount * warp;\n\n // Cursor swirl \u2014 rotate p around the cursor with radial falloff.\n if (cursorStrength > 0.001) {\n let toP = p - cursor;\n let d = length(toP);\n let rr = max(cursorRadius, 0.01);\n let w = exp(-(d * d) / (rr * rr * 0.45));\n let ang = w * cursorStrength * 2.1;\n let ca = cos(ang);\n let sa = sin(ang);\n var rotated = vec2<f32>(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + cursor;\n let pinch = w * cursorStrength * 0.08;\n rotated = mix(rotated, cursor, pinch);\n warped = mix(warped, rotated + warpAmount * warp * 0.7, w * cursorStrength);\n }\n return warped;\n}\n\n// \u2500\u2500 Palette LUT \u2500\u2500\nfn samplePalette(id0: f32) -> vec3<f32> {\n let id = clamp(id0, 0.0, 1.0);\n let stopCount = u.ints0.x;\n let scaled = id * f32(stopCount - 1);\n let i0 = i32(floor(scaled));\n let i1 = min(i0 + 1, stopCount - 1);\n let t = fract(scaled);\n return samplePaletteRamp(u.palette[i0].rgb, u.palette[i1].rgb, t, u.ints1.y);\n}\n\n// \u2500\u2500 Nuclei field (anisotropic Gaussian softmax + drift + palette drift) \u2500\u2500\nstruct NucleiResult { paletteId: f32, valueMod: f32 };\n\nfn nucleiField(p: vec2<f32>, t: f32) -> NucleiResult {\n let nucleiCount = u.ints0.y;\n let nucleiDrift = u.scalars2.y;\n let paletteDrift = u.scalars2.z;\n let softmaxBeta = u.scalars0.y;\n\n var accumBias = 0.0;\n var accumValue = 0.0;\n var accumW = 0.0;\n for (var i = 0; i < MAX_NUCLEI; i = i + 1) {\n if (i >= nucleiCount) { break; }\n let n0 = u.nuc0[i]; // pos.x, pos.y, radius, paletteBias\n let n1 = u.nuc1[i]; // valueBias, driftRadius, driftPhase, elong\n let angle = u.nuc2[i].x;\n let driftRadius = n1.y;\n let driftPhase = n1.z;\n let posI = n0.xy + driftRadius * vec2<f32>(\n cos(t * nucleiDrift * K_NUCLEI + driftPhase),\n sin(t * nucleiDrift * K_NUCLEI + driftPhase * 1.13)\n );\n let diff = p - posI;\n let ca = cos(angle);\n let sa = sin(angle);\n let local = vec2<f32>(ca * diff.x + sa * diff.y, -sa * diff.x + ca * diff.y);\n let along = local.x / max(n1.w, 0.01);\n let across = local.y;\n let d2 = along * along + across * across;\n let r = max(n0.z, 0.01);\n let w = exp(-softmaxBeta * d2 / (r * r));\n accumBias = accumBias + w * n0.w;\n accumValue = accumValue + w * n1.x;\n accumW = accumW + w;\n }\n var paletteId = accumBias / max(accumW, 1e-4);\n let valueMod = accumValue / max(accumW, 1e-4);\n\n let palAmp = clamp(paletteDrift * 6.0, 0.0, 0.06);\n paletteId = paletteId + palAmp * sin(t * paletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n return NucleiResult(paletteId, valueMod);\n}\n\n// \u2500\u2500 Color utils (OKLCh saturation) \u2500\u2500\nfn linOklab(lin: vec3<f32>) -> vec3<f32> {\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\nfn saturate3(c: vec3<f32>, amt: f32) -> vec3<f32> {\n var lch = oklabToOklch(linOklab(c));\n lch.y = max(lch.y * amt, 0.0);\n return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3<f32>(0.0));\n}\n\n// BD.W-AUR-VIVIDNESS \u2014 the \u00A73 chroma FLOOR, the WGSL twin of the GLSL vividnessFloor.\n// OKLab chroma lifted toward the floor, hue + L preserved; below VIVID_EPS the (a,b)\n// direction is precision noise so the lift synthesizes along the WARM anchor (amber,\n// both components positive) \u2014 never teal/navy. vividness (scalars3.w) == 0 is a no-op\n// (the byte-identity opt-out). Mode factor lifts a dim field a touch (read through glass).\nconst VIVID_TARGET: f32 = 0.115;\nconst VIVID_EPS: f32 = 0.012;\nconst VIVID_WARM_ANCHOR: vec2<f32> = vec2<f32>(0.34202, 0.93969);\nfn vividnessFloor(c: vec3<f32>, vividness: f32) -> vec3<f32> {\n if (vividness <= 0.0001) { return c; }\n var lab = linOklab(c);\n let C = length(lab.yz);\n let modeLift = mix(1.18, 1.0, clamp(lab.x * 1.4, 0.0, 1.0));\n let Cmin = vividness * VIVID_TARGET * modeLift;\n var hueDir = VIVID_WARM_ANCHOR;\n if (C > VIVID_EPS) { hueDir = lab.yz / C; }\n let yz = hueDir * max(C, Cmin);\n lab = vec3<f32>(lab.x, yz.x, yz.y);\n return max(oklabToLinearSrgb(lab), vec3<f32>(0.0));\n}\n\n// \u2500\u2500 PBR-Neutral tonemap (named aces() in the GLSL \u2014 the tonemap slot) \u2500\u2500\nfn aces(color0: vec3<f32>) -> vec3<f32> {\n let startCompression = 0.8 - 0.04;\n let desaturation = 0.15;\n var color = color0;\n let x = min(color.r, min(color.g, color.b));\n var offset = 0.04;\n if (x < 0.08) { offset = x - 6.25 * x * x; }\n color = color - offset;\n let peak = max(color.r, max(color.g, color.b));\n if (peak < startCompression) { return clamp(color, vec3<f32>(0.0), vec3<f32>(1.0)); }\n let d = 1.0 - startCompression;\n let newPeak = 1.0 - d * d / (peak + d - startCompression);\n color = color * (newPeak / peak);\n let g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);\n return clamp(mix(color, newPeak * vec3<f32>(1.0), g), vec3<f32>(0.0), vec3<f32>(1.0));\n}\n\n// \u2500\u2500 BC.W-VIZ-AURORA (T4) \u2014 the painterly-medium bodies (the keystone WGSL port) \u2500\u2500\n// Spliced HERE, after every helper the mediums consume is defined (domainWarp,\n// nucleiField, samplePalette, linOklab, saturate3, oklabToOklch/oklchToOklab,\n// hash21/vnoise/fbm) and before the vertex/fragment stages. applyMedium(col,p,t)\n// is the dispatch the fragment stage calls.\n\n// \u2500\u2500 Painterly luma + medium scalar accessors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconst W_LUMA: vec3<f32> = vec3<f32>(0.2126, 0.7152, 0.0722);\n\nfn mStrokeAmount() -> f32 { return u.scalars4.x; }\nfn mStrokeScale() -> f32 { return u.scalars4.y; }\nfn mStrokeAnisotropy() -> f32 { return u.scalars4.z; }\nfn mCanvasGrain() -> f32 { return u.scalars4.w; }\nfn mWetEdge() -> f32 { return u.scalars5.x; }\nfn mGranulation() -> f32 { return u.scalars5.y; }\nfn mBrokenColor() -> f32 { return u.scalars5.z; }\nfn mKuwaharaQ() -> f32 { return u.scalars5.w; }\nfn mKuwaharaRadius() -> f32 { return u.kuwahara.x; }\n\n// \u2500\u2500 Base color re-sample (the edge-mask operator the mediums Sobel/sector-sample) \u2500\u2500\n// The WGSL twin of mediums.glsl.ts sampleBase: warp -> nuclei field -> palette -> value.\nfn sampleBase(p: vec2<f32>, t: f32) -> vec3<f32> {\n let pw = domainWarp(p, t);\n let nf = nucleiField(pw, t);\n var c = samplePalette(nf.paletteId);\n c = c * (1.0 + u.scalars0.z * nf.valueMod);\n return c;\n}\n\n// \u2500\u2500 Broken color (hue + chroma jitter at constant OKLCh L) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfn brokenColorJitter(c: vec3<f32>, hueSeed: f32, valueSeed: f32, strength: f32) -> vec3<f32> {\n let amt = clamp(mBrokenColor() * strength, 0.0, 1.0);\n if (amt <= 0.001) { return c; }\n var lch = oklabToOklch(linOklab(c));\n lch.z = lch.z + (hueSeed - 0.5) * (32.0 * PI / 180.0) * amt;\n lch.y = max(lch.y * (1.0 + (valueSeed - 0.5) * 0.28 * amt), 0.0);\n return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3<f32>(0.0));\n}\n\n// \u2500\u2500 Structure-tensor / edge-tangent-flow (AW.W4.1; the WGSL twin) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Returns vec3(tangent.x, tangent.y, A) \u2014 the minor-eigenvector edge-tangent + coherence.\nfn structureTensorField(p: vec2<f32>, t: f32, fallbackDir: vec2<f32>) -> vec3<f32> {\n let e = 0.0035;\n let l00 = dot(sampleBase(p + vec2<f32>(-e, -e), t), W_LUMA);\n let l10 = dot(sampleBase(p + vec2<f32>(0.0, -e), t), W_LUMA);\n let l20 = dot(sampleBase(p + vec2<f32>( e, -e), t), W_LUMA);\n let l01 = dot(sampleBase(p + vec2<f32>(-e, 0.0), t), W_LUMA);\n let l21 = dot(sampleBase(p + vec2<f32>( e, 0.0), t), W_LUMA);\n let l02 = dot(sampleBase(p + vec2<f32>(-e, e), t), W_LUMA);\n let l12 = dot(sampleBase(p + vec2<f32>(0.0, e), t), W_LUMA);\n let l22 = dot(sampleBase(p + vec2<f32>( e, e), t), W_LUMA);\n let Gx = (l20 + 2.0 * l21 + l22) - (l00 + 2.0 * l01 + l02);\n let Gy = (l02 + 2.0 * l12 + l22) - (l00 + 2.0 * l10 + l20);\n let Jxx = Gx * Gx;\n let Jyy = Gy * Gy;\n let Jxy = Gx * Gy;\n let tr = Jxx + Jyy;\n let disc = sqrt(max((Jxx - Jyy) * (Jxx - Jyy) + 4.0 * Jxy * Jxy, 0.0));\n let lambdaMaj = 0.5 * (tr + disc);\n let lambdaMin = 0.5 * (tr - disc);\n var tangent: vec2<f32>;\n if (disc < 1e-7) {\n tangent = fallbackDir;\n } else {\n let theta = 0.5 * atan2(2.0 * Jxy, Jxx - Jyy);\n tangent = vec2<f32>(-sin(theta), cos(theta));\n }\n var A = (lambdaMaj - lambdaMin) / (lambdaMaj + lambdaMin + 1e-6);\n A = clamp(A, 0.0, 1.0);\n if (dot(tangent, fallbackDir) < 0.0) { tangent = -tangent; }\n let blendW = pow(A, 0.28);\n let dir = normalize(mix(fallbackDir, tangent, blendW) + vec2<f32>(1e-6, 1e-6));\n return vec3<f32>(dir, A);\n}\n\n// \u2500\u2500 Flow field (the WGSL twin \u2014 the simple flow seed the medium fallback dirs use) \u2500\u2500\nfn flowField(p: vec2<f32>, t: f32) -> vec2<f32> {\n // Curl-noise-driven swirl (the medium-default dir; the full radial/swirl/diagonal\n // dispatch rides uniforms the WGSL struct does not carry \u2014 the procedural mediums\n // use this multi/curl seed as the fallback the structure tensor relaxes toward).\n let n = fbm(p * 2.0 + vec2<f32>(t * 0.02, t * 0.02));\n let a = n * 6.2831853;\n var dir = vec2<f32>(cos(a), sin(a));\n // Cursor swirl bias (matches the GLSL flow cursor term \u2014 the steady attraction).\n let cursorStrength = u.scalars3.y;\n let cursorRadius = u.scalars3.z;\n let cursor = u.cursor.xy;\n if (cursorStrength > 0.001) {\n let toCur = cursor - p;\n let d = length(toCur);\n let r = max(cursorRadius, 0.01);\n let w = exp(-(d * d) / (r * r * 0.5));\n let tangent = vec2<f32>(-toCur.y, toCur.x) / max(d, 1e-4);\n let a0 = atan2(dir.y, dir.x);\n let a1 = atan2(tangent.y, tangent.x);\n var da = a1 - a0;\n da = atan2(sin(da), cos(da));\n let aa = a0 + da * w * cursorStrength;\n dir = vec2<f32>(cos(aa), sin(aa));\n }\n return dir;\n}\n\n// \u2500\u2500 Watercolor \u2014 wet-edge cauliflowers + granulation + wash banding \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfn mediumWatercolor(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n var col = col0;\n let eps = 0.004;\n let cx1 = sampleBase(p + vec2<f32>(eps, 0.0), t);\n let cx2 = sampleBase(p - vec2<f32>(eps, 0.0), t);\n let cy1 = sampleBase(p + vec2<f32>(0.0, eps), t);\n let cy2 = sampleBase(p - vec2<f32>(0.0, eps), t);\n let gx = dot(cx1 - cx2, W_LUMA);\n let gy = dot(cy1 - cy2, W_LUMA);\n let edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n let mask = smoothstep(0.0, 2.5, edge);\n col = col * mix(1.0, 0.78, mask * mWetEdge());\n\n let paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n let pigLoad = 1.0 - dot(col, W_LUMA);\n col = col * (1.0 - mGranulation() * pigLoad * (paper - 0.5));\n\n let band = fbm(vec2<f32>(p.x * 1.5, p.y * 0.4));\n col = col * (1.0 + 0.04 * (band - 0.5));\n return col;\n}\n\n// \u2500\u2500 Pastel \u2014 anisotropic stroke noise along the flow + tooth grain \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfn mediumPastel(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n var col = col0;\n let flow = flowField(p, t);\n let perp = vec2<f32>(-flow.y, flow.x);\n let strokeScale = mStrokeScale();\n let along = dot(p, flow) * strokeScale;\n var across = dot(p, perp) * strokeScale;\n across = across + 0.03 * (vnoise(p * 260.0) - 0.5);\n\n let aniso = mix(1.0, 0.18, mStrokeAnisotropy());\n let stroke = fbm(vec2<f32>(along * aniso, across));\n col = col * mix(1.0, 0.82 + 0.32 * stroke, mStrokeAmount());\n\n let tooth = vnoise(p * 800.0);\n col = col * (1.0 - 0.08 * mStrokeAmount() * (tooth - 0.5));\n return col;\n}\n\n// \u2500\u2500 Crayon \u2014 DRY wax pigment on paper tooth (the tooth-multiply + scumble) \u2500\u2500\nfn mediumCrayon(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n let flow = structureTensorField(p, t, flowField(p, t)).xy;\n let ang = atan2(flow.y, flow.x);\n let ca = cos(-ang);\n let sa = sin(-ang);\n let pr = vec2<f32>(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n let aniso = mix(0.45, 0.95, mStrokeAnisotropy());\n let scale = max(mStrokeScale() * 1.6, 180.0);\n\n let t1 = vnoise(vec2<f32>(pr.x * scale * aniso, pr.y * scale));\n let t2 = vnoise(vec2<f32>(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + vec2<f32>(11.0, 11.0));\n let t3 = vnoise(vec2<f32>(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + vec2<f32>(23.0, 23.0));\n let tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n\n let pressure = clamp(mStrokeAmount(), 0.0, 1.0);\n let bite = mix(0.18, 0.46, pressure);\n var result = col0 * (1.0 - bite * (0.5 - tooth));\n\n let scumbleMask = smoothstep(0.42, 0.78, vnoise(vec2<f32>(pr.x * scale * 0.55, pr.y * scale * 0.22) + vec2<f32>(7.0, 7.0)));\n let scumbleCoverage = scumbleMask * pressure * 0.7;\n let paper = col0 * mix(0.80, 0.94, pressure);\n result = mix(paper, result, scumbleCoverage);\n\n let pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n let pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + vec2<f32>(19.0, 19.0)));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + vec2<f32>(17.0, 17.0)),\n hash21(pigmentCell * 2.1 + vec2<f32>(31.0, 31.0)),\n 0.45 + 0.55 * pigmentMask\n );\n\n result = saturate3(result, 1.08);\n return result;\n}\n\n// \u2500\u2500 Kuwahara \u2014 the SOFT anisotropic generalized Kuwahara painterly finish \u2500\u2500\u2500\u2500\n// THE KEYSTONE (Kyprianidis 2010). Aurora is a PROCEDURAL field (no input texture) so the\n// operator runs over sampleBase directly: an elliptical kernel oriented along the structure\n// tensor (elongated along the edge-tangent, narrowed across by the anisotropy), 8 OVERLAPPING\n// sectors via SMOOTH gaussian-angular weights, blended by 1/(1+var^q) (the SOFT criterion \u2192\n// no 8-spoke pinwheel by construction). 4 rings \u00D7 8 angular taps = 32 procedural samples.\nfn mediumKuwahara(col0: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n let stf = structureTensorField(p, t, flowField(p, t));\n let tangent = stf.xy;\n let A = stf.z;\n // The studio knob drives the patch radius; clamp into the procedural patch band.\n let radius = clamp(mKuwaharaRadius() + mStrokeScale() * 0.00018, 0.006, 0.024);\n let aniso = mix(1.0, 0.34, clamp(A, 0.0, 1.0));\n let ax = tangent;\n let ay = vec2<f32>(-tangent.y, tangent.x);\n\n // Per-sector weighted sums (8 sectors). WGSL has no runtime-indexed local arrays of\n // vectors as cleanly as GLSL, so unroll the sector accumulators explicitly.\n var mSum: array<vec3<f32>, 8>;\n var sSum: array<vec3<f32>, 8>;\n var wSum: array<f32, 8>;\n for (var i = 0; i < 8; i = i + 1) {\n mSum[i] = vec3<f32>(0.0);\n sSum[i] = vec3<f32>(0.0);\n wSum[i] = 0.0;\n }\n\n let RINGS = 4;\n let TAPS = 8;\n for (var r = 1; r <= RINGS; r = r + 1) {\n let rr = f32(r) / f32(RINGS);\n let radial = 1.0 - 0.6 * rr;\n for (var a = 0; a < TAPS; a = a + 1) {\n let ang = 6.2831853 * f32(a) / f32(TAPS);\n let dirE = ax * cos(ang) + ay * (sin(ang) * aniso);\n let off = dirE * (radius * rr);\n let c = sampleBase(p + off, t);\n for (var k = 0; k < 8; k = k + 1) {\n let sectorAng = 6.2831853 * f32(k) / 8.0;\n var d = ang - sectorAng;\n d = atan2(sin(d), cos(d));\n let sw = exp(-d * d * 2.2) * radial;\n mSum[k] = mSum[k] + c * sw;\n sSum[k] = sSum[k] + c * c * sw;\n wSum[k] = wSum[k] + sw;\n }\n }\n }\n\n let q = max(mKuwaharaQ(), 1.0);\n var accum = vec3<f32>(0.0);\n var accumW = 0.0;\n for (var k = 0; k < 8; k = k + 1) {\n let wk = max(wSum[k], 1e-4);\n let mean = mSum[k] / wk;\n let var3 = max(sSum[k] / wk - mean * mean, vec3<f32>(0.0));\n let variance = dot(var3, W_LUMA);\n let sectorW = 1.0 / (1.0 + pow(variance * 320.0, q));\n accum = accum + mean * sectorW;\n accumW = accumW + sectorW;\n }\n var result = accum / max(accumW, 1e-4);\n\n // Anchor in near-flat zones so the smoothing only bites at edges.\n let center = sampleBase(p, t);\n result = mix(center, result, clamp(0.35 + 0.65 * A, 0.0, 1.0));\n\n // Faint canvas tooth + pigment-saturation so the flattened patches read as oil paint.\n let tooth = vnoise(p * 300.0) - 0.5;\n result = result * (1.0 + tooth * 0.06 * mCanvasGrain());\n result = saturate3(result, 1.04);\n\n return mix(col0, result, clamp(mStrokeAmount(), 0.0, 1.0));\n}\n\n// \u2500\u2500 Medium dispatch (the WGSL twin of the GLSL main() if-ladder) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// uMedium: 0 smooth \u00B7 1 pastel \u00B7 2 watercolor \u00B7 3 oil \u00B7 4 crayon \u00B7 5 vangogh \u00B7\n// 6 oil-pastel \u00B7 7 kuwahara. The cheap peer mediums (pastel/watercolor/crayon) +\n// kuwahara port their own bodies; the oil/vangogh/oil-pastel STROKE cascade renders\n// the anisotropic-Kuwahara PAINTERLY finish here (a real oil-paint read, never the\n// smooth core \u2014 the \"NO FALLBACKS on Safari\" mandate; the full per-dab Starry-Night\n// stroke WGSL is the booked W-AURORA-WGPU-MEDIUMS-STROKES tail).\nfn applyMedium(col: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {\n let medium = u.ints1.x;\n if (medium == 1) { return mediumPastel(col, p, t); }\n if (medium == 2) { return mediumWatercolor(col, p, t); }\n if (medium == 4) { return mediumCrayon(col, p, t); }\n // oil(3) / vangogh(5) / oil-pastel(6) / kuwahara(7) all render the painterly\n // anisotropic-Kuwahara finish on the WGSL primary (the WebGL2 fallback carries the\n // full per-dab stroke cascade for oil/vangogh/oil-pastel).\n if (medium == 3 || medium == 5 || medium == 6 || medium == 7) {\n return mediumKuwahara(col, p, t);\n }\n return col;\n}\n\n\n// \u2500\u2500 Full-screen triangle vertex stage (the pilot idiom \u2014 no vertex buffer) \u2500\u2500\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) uv: vec2<f32>,\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n // NDC corners of the covering triangle (-1,-1), (3,-1), (-1,3).\n var p = vec2<f32>(-1.0, -1.0);\n if (vi == 1u) { p = vec2<f32>(3.0, -1.0); }\n else if (vi == 2u) { p = vec2<f32>(-1.0, 3.0); }\n var out: VSOut;\n out.pos = vec4<f32>(p, 0.0, 1.0);\n // vUv = aPos * 0.5 + 0.5 (the aurora.vert convention).\n out.uv = p * 0.5 + 0.5;\n return out;\n}\n\n// \u2500\u2500 Fragment stage (the main() transcription) \u2500\u2500\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n let t = u.scalars0.x;\n let valueVariance = u.scalars0.z;\n let breathDepth = u.scalars2.w;\n let breathPeriod = u.scalars3.x;\n let saturation = u.scalars1.z;\n let paperGrain = u.scalars1.w;\n let alpha = u.scalars2.x;\n let vividness = u.scalars3.w;\n\n let uv = in.uv;\n let pN = uv;\n\n let p_warp = domainWarp(pN, t);\n\n let nf = nucleiField(p_warp, t);\n var col = samplePalette(nf.paletteId);\n col = col * (1.0 + valueVariance * nf.valueMod);\n\n // Breath \u2014 slow global luminance wobble.\n let breath = sin(t * 6.2831 / max(breathPeriod, 1.0));\n col = col * (1.0 + breathDepth * breath * 0.5);\n\n // BC.W-VIZ-AURORA (T4) \u2014 the painterly-medium dispatch. uMedium 0 (smooth) is a\n // no-op pass-through so the DEFAULT smooth config is byte-identical to the prior\n // WGSL primary (the parity capture); uMedium 1-7 render the ported painterly\n // bodies (pastel/watercolor/crayon/kuwahara) or the anisotropic-Kuwahara finish\n // (oil/vangogh/oil-pastel) \u2014 never a silent smooth degrade on Safari 26.\n col = applyMedium(col, pN, t);\n\n // Saturation trim.\n col = saturate3(col, saturation);\n\n // BD.W-AUR-VIVIDNESS \u2014 the \u00A73 chroma floor (warm-anchored, hue-preserving). The WGSL\n // twin of the GLSL call; vividness:0 is a no-op so the smooth/pale default stays gated.\n col = vividnessFloor(col, vividness);\n\n // Tonemap + film grain.\n col = aces(col);\n // gl_FragCoord.xy \u2192 the device-pixel position (the WGSL @builtin(position)).\n let fragCoord = in.pos.xy;\n let grain = hash21(fragCoord + t * 17.0);\n col = col + (grain - 0.5) * paperGrain;\n\n col = clamp(col * 0.985 + 0.008, vec3<f32>(0.0), vec3<f32>(1.0));\n\n // MANDATORY OETF \u2014 closes the seam (the whole pipeline above runs in LINEAR).\n col = linearToSrgb(col);\n\n // 1-LSB triangular IGN dither in DISPLAY space, AFTER the OETF.\n col = col + (1.0 / 255.0) * (ign(fragCoord) - 0.5);\n\n // Premultiply on DISPLAY-space color (matches the WebGL2 path: OETF, then premul).\n return vec4<f32>(col * alpha, alpha);\n}\n";
|
|
@@ -5,7 +5,7 @@ export type { UseAuroraReturn } from "./composables/useAurora";
|
|
|
5
5
|
export { useCursorInteraction } from "./composables/useCursorInteraction";
|
|
6
6
|
export { createAurora } from "./composables/runtime";
|
|
7
7
|
export type { AuroraRuntimeMode, AuroraRuntimeOptions } from "./composables/runtime";
|
|
8
|
-
export { DEFAULT_AURORA_CONFIG, PAPER_WASH_GROUND, MAX_NUCLEI, MAX_STOPS, type AuroraConfig, type AuroraCursorApi, type AuroraFlow, type AuroraInstance, type AuroraInteractivity, type AuroraMedium, type AuroraNucleus, type FlowPattern, type OklchStop, type StrokeMode, type StrokeOrient, type WarpMode, } from "./constants/presets";
|
|
8
|
+
export { DEFAULT_AURORA_CONFIG, PAPER_WASH_GROUND, DEFAULT_VIVIDNESS, VIVID_TARGET, MAX_NUCLEI, MAX_STOPS, type AuroraConfig, type AuroraCursorApi, type AuroraFlow, type AuroraInstance, type AuroraInteractivity, type AuroraMedium, type AuroraNucleus, type FlowPattern, type OklchStop, type StrokeMode, type StrokeOrient, type WarpMode, } from "./constants/presets";
|
|
9
9
|
export { resolveAtoms, configToAtoms, nucleiPrior, DEFAULT_ATOMS, type AuroraAtoms, type AuroraMotionAtom, type AuroraZones, type AuroraZoneArrangement, type AuroraMediumAtom, type AuroraInteractivityAtom, } from "./composables/atoms";
|
|
10
10
|
export { cssToOklch, deriveAurora, flattenPalette, hexToOklchStop, oklchStopToHex, oklchToLinear, paletteToCssGradient, } from "./composables/color";
|
|
11
11
|
export { auroraFallbackGround, sampleAuroraField, nucleiFieldStatic, relativeLuminance, type AuroraFallbackGround, type AuroraFallbackGroundOptions, type AuroraGroundMetrics, } from "./composables/auroraFallbackGround";
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import type { ConcentricConfig } from "./constants";
|
|
2
2
|
/**
|
|
3
|
-
* Concentric — a
|
|
3
|
+
* Concentric — a living LEVEL-SET hypsometric SURVEY (paper-grid kin, BD.W-CONCENTRIC-RELIEF).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
5
|
+
* The iso-contours of a LOW-octave curl-warped height field H(p,t) — the SAME traveling-wave
|
|
6
|
+
* CELL-WARP that twists the paper-grid cells is applied to the SAMPLING coordinate, so the
|
|
7
|
+
* contours twist + flow as a wave passes OVER and THROUGH the topography; the ω=√(g·k) swell
|
|
8
|
+
* breathes the basins; the cursor HEAVES the topography toward the pointer (velocity-scaled
|
|
9
|
+
* gravity). The fragment paints an OPAQUE warm hypsometric FILL, lifts it into 2.5-D relief
|
|
10
|
+
* with one analytic hillshade, and inks it with a two-tier index/minor contour hierarchy via
|
|
11
|
+
* the KEPT IQ gradient-free `contourInk` (perfect GPU AA — density tracks 1/|∇H|). WebGPU-FIRST:
|
|
12
|
+
* a pure fullscreen fragment pass over the shared `waveField` leaf, with a clean WebGL2 GLSL
|
|
13
|
+
* fallback. It composes `useConcentric` → the `createGpuSubstrate` picker over the ONE canvas
|
|
14
|
+
* lifecycle leaf (offscreen-pause, live-PRM freeze, consumer-owned DPR).
|
|
14
15
|
*
|
|
15
|
-
* The DEFAULT
|
|
16
|
-
*
|
|
16
|
+
* The DEFAULT identity is the warm-DIVERGENT hypsometric tint (deep plum-rose basin → ember →
|
|
17
|
+
* amber → wheat crest), resolved per-mode by plain arms (NOT CSS `light-dark()`, NOT an
|
|
18
|
+
* in-shader `uMode` seam): the dark twin glows on a deep-ember ground. A consumer (the demo)
|
|
19
|
+
* themes it through a PRESET (presets-in-consumers — never a library token).
|
|
17
20
|
*/
|
|
18
21
|
type __VLS_Props = {
|
|
19
22
|
/** The full author schema (the studio's `useConfiguratorState` model). */
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { WebGLCanvasFrame } from "../../../../composables/glass/webgl/useWebGLCanvas";
|
|
2
2
|
import type { OklchStop } from "../../../../composables/color";
|
|
3
3
|
import { type ConcentricConfig } from "../constants";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Vec2 } from "./levelField";
|
|
5
5
|
export interface ConcentricGLSetupDeps {
|
|
6
6
|
canvas: HTMLCanvasElement;
|
|
7
7
|
config: ConcentricConfig;
|
|
8
8
|
getPalette: () => OklchStop[];
|
|
9
|
-
|
|
9
|
+
/** The pointer in DOMAIN space (the cursor gravity well) — re-read each frame. */
|
|
10
|
+
getCursor: () => Vec2;
|
|
11
|
+
/** The spring-eased traveling-wave envelope amplitude (0..1; PRM → 0). */
|
|
12
|
+
getAmp: () => number;
|
|
13
|
+
/** The velocity-HEAVE multiplier on the cursor well (1.0 at rest → grows with speed). */
|
|
14
|
+
getWellScale: () => number;
|
|
10
15
|
shouldContinue: () => boolean;
|
|
11
16
|
/**
|
|
12
17
|
* The per-frame pointer hook — useConcentric advances the shared pointer field +
|
|
13
|
-
*
|
|
18
|
+
* derives the cursor in domain space here (the no-own-rAF discipline). ZERO own rAF.
|
|
14
19
|
*/
|
|
15
20
|
onFrame?: (timeSec: number) => void;
|
|
16
21
|
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { WebGPUCanvasFrame } from "../../../../composables/glass/webgpu/useWebGPUCanvas";
|
|
2
2
|
import type { OklchStop } from "../../../../composables/color";
|
|
3
3
|
import type { ConcentricConfig } from "../constants";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Vec2 } from "./levelField";
|
|
5
5
|
export interface ConcentricWGPUSetupDeps {
|
|
6
6
|
canvas: HTMLCanvasElement;
|
|
7
7
|
config: ConcentricConfig;
|
|
8
8
|
/** The resolved (ColorResolver) palette stops as OKLCh — re-read each frame so a live edit reaches the buffer. */
|
|
9
9
|
getPalette: () => OklchStop[];
|
|
10
|
-
/** The
|
|
11
|
-
|
|
10
|
+
/** The pointer in DOMAIN space (the cursor gravity well) — re-read each frame. */
|
|
11
|
+
getCursor: () => Vec2;
|
|
12
|
+
/** The spring-eased traveling-wave envelope amplitude (0..1; PRM → 0). */
|
|
13
|
+
getAmp: () => number;
|
|
14
|
+
/** The velocity-HEAVE multiplier on the cursor well (1.0 at rest → grows with speed). */
|
|
15
|
+
getWellScale: () => number;
|
|
12
16
|
/** Demand-gate (the renderer's quiescence layer — substrate-agnostic). */
|
|
13
17
|
shouldContinue: () => boolean;
|
|
14
18
|
/**
|
|
15
19
|
* The per-frame pointer hook — useConcentric advances the shared `usePointerVelocityField`
|
|
16
20
|
* here (the no-own-rAF discipline: the renderer's frame loop FEEDS `tick(delta)`) and
|
|
17
|
-
*
|
|
21
|
+
* derives the cursor in domain space. ZERO own rAF.
|
|
18
22
|
*/
|
|
19
23
|
onFrame?: (timeSec: number) => void;
|
|
20
24
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Vec2 } from "../../../../composables/glass/wave/waveField";
|
|
2
|
+
export type { Vec2 };
|
|
3
|
+
/** The level-set sample params (the round-trip anchor; mirrors the shader uniforms). */
|
|
4
|
+
export interface LevelFieldParams {
|
|
5
|
+
/** The traveling-wave front direction. */
|
|
6
|
+
waveDir: Vec2;
|
|
7
|
+
waveK: number;
|
|
8
|
+
waveOmega: number;
|
|
9
|
+
waveSigma: number;
|
|
10
|
+
twistMax: number;
|
|
11
|
+
shearMax: number;
|
|
12
|
+
/** The spring-eased envelope amplitude (0..1; PRM → 0). */
|
|
13
|
+
amp: number;
|
|
14
|
+
/** The topography cell pitch (domain units per cell — the contour-warp granularity). */
|
|
15
|
+
cellSize: number;
|
|
16
|
+
/** LOW octaves → clean nested loops. */
|
|
17
|
+
heightOctaves: number;
|
|
18
|
+
heightSeed: number;
|
|
19
|
+
/** The ω=√(g·k) breathing swell depth. */
|
|
20
|
+
swellAmp: number;
|
|
21
|
+
/** Per-contour wobble depth. */
|
|
22
|
+
perturbAmp: number;
|
|
23
|
+
/** The contour-level count. */
|
|
24
|
+
levels: number;
|
|
25
|
+
/** The cursor (domain space). */
|
|
26
|
+
cursor: Vec2;
|
|
27
|
+
/** The cursor Gaussian peak depth (the topography bulges under the pointer). */
|
|
28
|
+
cursorWell: number;
|
|
29
|
+
/** 1 = cursor on. */
|
|
30
|
+
interactive: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The warped level-set height at domain `p` and time `t` — the SINGLE math source. The
|
|
34
|
+
* sampling coordinate is twisted by the SHARED `cellTwist` (the kinship with paper-grid:
|
|
35
|
+
* the same wave flows both); the height is a low-octave fbm topography + the swell; the cursor
|
|
36
|
+
* adds a Gaussian peak. Returns the un-normalized height (the shader contours + tints it).
|
|
37
|
+
*/
|
|
38
|
+
export declare function sampleHeight(p: Vec2, t: number, q: LevelFieldParams): number;
|
|
39
|
+
/** The SHARED hillshade finite-diff epsilon — pinned ONCE, consumed by both shaders + this
|
|
40
|
+
* oracle (challenge R8: a per-backend `e` drift would red L6). */
|
|
41
|
+
export declare const HILLSHADE_EPSILON = 0.012;
|
|
42
|
+
/** The hypsometric tone — expands the compressed height band so basins+ridges hit the ramp
|
|
43
|
+
* ENDS. `tone = 0.5 + 0.5·tanh(H·toneGain)`. Maps un-normalized H → [0,1] palette param. */
|
|
44
|
+
export declare function toneFromHeight(H: number, toneGain: number): number;
|
|
45
|
+
/** The analytic hillshade at domain `p` — one ∇H finite-diff at the SHARED `e`, dotted with
|
|
46
|
+
* the fixed cel light → [0,1] (0.5 = flat). A read-only re-sample of `sampleHeight`. */
|
|
47
|
+
export declare function hillshade(p: Vec2, t: number, q: LevelFieldParams, lightDir: Vec2): number;
|
|
48
|
+
/** The two-tier index test — a PURE `f(level)` (floor + mod + threshold), stateless, no
|
|
49
|
+
* buffer. Returns 1.0 on an index (every `indexEvery`th) level, else 0.0. */
|
|
50
|
+
export declare function isIndexLevel(fN: number, indexEvery: number): number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OklchStop } from "../../../../composables/color";
|
|
2
|
-
import type { RingCenter } from "./ringField";
|
|
3
2
|
import { type ConcentricConfig } from "../constants";
|
|
3
|
+
import type { Vec2 } from "./levelField";
|
|
4
4
|
export declare const CONCENTRIC_UNIFORM_BYTES: number;
|
|
5
|
-
/** The
|
|
5
|
+
/** The height-amplitude normalization scale (height → [0,1] for the topographic ramp). */
|
|
6
6
|
export declare const CONCENTRIC_FIELD_NORM = 0.55;
|
|
7
7
|
export interface ConcentricUniformScratch {
|
|
8
8
|
buffer: ArrayBuffer;
|
|
@@ -10,5 +10,8 @@ export interface ConcentricUniformScratch {
|
|
|
10
10
|
i32: Int32Array;
|
|
11
11
|
}
|
|
12
12
|
export declare function createConcentricScratch(): ConcentricUniformScratch;
|
|
13
|
-
/** Pack the concentric uniforms in place.
|
|
14
|
-
|
|
13
|
+
/** Pack the concentric uniforms in place. `cursor` is the pointer in DOMAIN space; `amp` the
|
|
14
|
+
* spring-eased traveling-wave envelope amplitude (PRM → 0); `wellScale` the velocity-HEAVE
|
|
15
|
+
* multiplier on the cursor well depth+radius (1.0 at rest → grows with pointer speed; JS-side
|
|
16
|
+
* so the heave costs no uniform lane). */
|
|
17
|
+
export declare function packConcentricUniforms(scratch: ConcentricUniformScratch, config: ConcentricConfig, timeSec: number, aspect: number, palette: OklchStop[], cursor: Vec2, amp: number, wellScale: number): ConcentricUniformScratch;
|
|
@@ -28,8 +28,8 @@ export interface ConcentricHandle {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Mount the concentric renderer on `canvasRef`. The WebGPU primary + the WebGL2 fallback are
|
|
31
|
-
* BOTH pure fullscreen fragment passes evaluating the SAME
|
|
32
|
-
*
|
|
33
|
-
* handle.
|
|
31
|
+
* BOTH pure fullscreen fragment passes evaluating the SAME level-set topography (the ONE math
|
|
32
|
+
* source `levelField.ts` `sampleHeight`), so the picker is the only seam. Returns the uniform
|
|
33
|
+
* lifecycle handle.
|
|
34
34
|
*/
|
|
35
35
|
export declare function useConcentric(canvasRef: Ref<HTMLCanvasElement | null>, options: UseConcentricOptions): ConcentricHandle;
|
|
@@ -1,67 +1,88 @@
|
|
|
1
|
-
import type { RingComponent, RingCenter } from "./composables/ringField";
|
|
2
1
|
import type { OklchStop } from "../../../composables/color";
|
|
3
|
-
/** Compile-time ring-component cap — mirrors the WGSL `MAX_RINGS` #define. */
|
|
4
|
-
export declare const MAX_RINGS = 8;
|
|
5
|
-
/** Compile-time center cap — mirrors the WGSL `MAX_CENTERS` #define. */
|
|
6
|
-
export declare const MAX_CENTERS = 4;
|
|
7
2
|
/** Compile-time palette cap — mirrors the WGSL `MAX_RING_STOPS` #define. */
|
|
8
3
|
export declare const MAX_RING_STOPS = 4;
|
|
9
|
-
/** The render mode — traveling crest-lines, static elevation-contour, or both. */
|
|
10
|
-
export type ConcentricRenderMode = "traveling-rings" | "static-contour" | "both";
|
|
11
|
-
/** Map a render mode to the shader int (the uniform `ints.w` lane). */
|
|
12
|
-
export declare function renderModeToInt(mode: ConcentricRenderMode): number;
|
|
13
4
|
/**
|
|
14
5
|
* The full author schema — the studio's `useConfiguratorState` model. Every field is a
|
|
15
6
|
* tunable the demo configurator drives; the SFC resolves it into the uniform table.
|
|
16
7
|
*/
|
|
17
8
|
export interface ConcentricConfig {
|
|
18
|
-
/** The
|
|
19
|
-
centers: RingCenter[];
|
|
20
|
-
/** The clean radial sum-of-sines table (1..2 frequencies — NOT a turbulence ladder). */
|
|
21
|
-
ringComponents: RingComponent[];
|
|
22
|
-
/** The ellipsoidal-norm axis ratio (a, b) — the tilted-disc depth implication. */
|
|
23
|
-
axisRatio: [number, number];
|
|
24
|
-
/** The ring-travel speed (scales ω). */
|
|
9
|
+
/** The level-set flow speed (scales the traveling-wave time). */
|
|
25
10
|
speed: number;
|
|
26
|
-
/** The stroke half-width (
|
|
11
|
+
/** The contour stroke half-width (px units; the IQ line thickness). */
|
|
27
12
|
lineWidth: number;
|
|
28
|
-
/** The stroke AA softness (
|
|
13
|
+
/** The stroke AA softness (px units; the edge feather). */
|
|
29
14
|
lineSoftness: number;
|
|
30
|
-
/** The
|
|
31
|
-
renderMode: ConcentricRenderMode;
|
|
32
|
-
/** The contour-level count for the static-contour mode (4..24). */
|
|
15
|
+
/** The contour-level count (the iso-line density; 4..24). */
|
|
33
16
|
contourLevels: number;
|
|
34
|
-
/** The
|
|
35
|
-
|
|
17
|
+
/** The topography cell pitch (domain units per cell — the contour-warp granularity). */
|
|
18
|
+
cellSize: number;
|
|
19
|
+
/** The height-field octaves (LOW → clean nested loops). */
|
|
20
|
+
heightOctaves: number;
|
|
21
|
+
/** The height-field seed (a different topography per seed). */
|
|
22
|
+
heightSeed: number;
|
|
23
|
+
/** The ω=√(g·k) breathing swell depth — basins inflate/deflate (weight). */
|
|
24
|
+
swellAmp: number;
|
|
25
|
+
/** Per-contour wobble depth — the contours wobble independently as the wave flows. */
|
|
26
|
+
perturbAmp: number;
|
|
27
|
+
/** Max per-cell twist angle at the wave crest (rad — the cell-warp the contours ride). */
|
|
28
|
+
twistMax: number;
|
|
29
|
+
/** Max per-cell shear at the crest. */
|
|
30
|
+
shearMax: number;
|
|
31
|
+
/** The traveling-wave front direction (a gentle diagonal). */
|
|
32
|
+
waveDir: [number, number];
|
|
33
|
+
/** The crest-band spatial frequency (LOW — cells per crest). */
|
|
34
|
+
waveK: number;
|
|
35
|
+
/** The front speed (slow — inertia). */
|
|
36
|
+
waveOmega: number;
|
|
37
|
+
/** The crest-band width (a localized front). */
|
|
38
|
+
waveSigma: number;
|
|
39
|
+
/** The cursor Gaussian peak depth — the topography HEAVES toward the pointer. */
|
|
40
|
+
cursorWell: number;
|
|
41
|
+
/** The hypsometric tone gain — `tone = 0.5 + 0.5·tanh(H·toneGain)` (fills the ramp ends). */
|
|
42
|
+
toneGain: number;
|
|
43
|
+
/** The analytic-hillshade relief depth (`fill *= mix(1-shadeAmp, 1+shadeAmp, shade)`). */
|
|
44
|
+
shadeAmp: number;
|
|
45
|
+
/** The fixed cartoon-sun direction (the raking cel light dotted with ∇H). */
|
|
46
|
+
lightDir: [number, number];
|
|
47
|
+
/** Index-contour stride — every Nth level is a bold index line (two-tier hierarchy). */
|
|
48
|
+
indexEvery: number;
|
|
49
|
+
/** The index-line width multiplier (index ~indexMul× the minor half-width). */
|
|
50
|
+
indexMul: number;
|
|
51
|
+
/** The ink darken factor — the contour is a darker ember of its OWN local fill band. */
|
|
52
|
+
inkDarken: number;
|
|
53
|
+
/** Cursor-HEAVE gain — pointer SPEED scales the well depth/radius (JS-side; free). */
|
|
54
|
+
velocityHeave: number;
|
|
36
55
|
/** The field-value color ramp (the demo themes it); resolved via the ColorResolver. */
|
|
37
56
|
palette: OklchStop[];
|
|
38
|
-
/** The
|
|
57
|
+
/** The opaque warm hypsometric ground (the survey reads standalone; per-mode resolved). */
|
|
39
58
|
background: OklchStop | "transparent";
|
|
40
|
-
/** Pointer
|
|
59
|
+
/** Pointer HEAVES the topography (gravity over the contour map). */
|
|
41
60
|
interactive: boolean;
|
|
42
|
-
/** ONE static frame then park under `prefers-reduced-motion: reduce`. */
|
|
61
|
+
/** ONE static survey frame then park under `prefers-reduced-motion: reduce`. */
|
|
43
62
|
respectReducedMotion: boolean;
|
|
44
63
|
}
|
|
45
64
|
/**
|
|
46
|
-
* The
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
65
|
+
* The WARM-DIVERGENT light identity — a true multi-warm hypsometric tint (NOT a mono-amber
|
|
66
|
+
* wash). Four stops spanning the warm wheel from a deep plum-rose basin through ember and
|
|
67
|
+
* amber to a wheat ridge crest. Every hue wraps through red — none lands in the teal/navy
|
|
68
|
+
* purge band [180,270]. Resolved via the ColorResolver; a consumer (the demo) themes it
|
|
69
|
+
* through a PRESET, never a token edit.
|
|
50
70
|
*/
|
|
51
71
|
export declare const WARM_IDENTITY_PALETTE: OklchStop[];
|
|
52
72
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
73
|
+
* The WARM-DIVERGENT dark identity — the survey-at-night twin (plain per-mode arm, NOT a
|
|
74
|
+
* CSS `light-dark()` branch, NOT an in-shader `uMode` seam). A deep ember basin glowing up
|
|
75
|
+
* to a luminous amber ridge ladder. Hues stay warm [330..90] — never teal/navy.
|
|
56
76
|
*/
|
|
57
|
-
export declare
|
|
58
|
-
/** The
|
|
59
|
-
export declare const
|
|
77
|
+
export declare const WARM_IDENTITY_PALETTE_DARK: OklchStop[];
|
|
78
|
+
/** The per-mode warm hypsometric GROUND (the opaque floor; resolved off `useGlobalDark`). */
|
|
79
|
+
export declare const WARM_GROUND_LIGHT: OklchStop;
|
|
80
|
+
export declare const WARM_GROUND_DARK: OklchStop;
|
|
60
81
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
82
|
+
* The shipped warm-identity default config — a living LEVEL-SET hypsometric SURVEY (paper-grid
|
|
83
|
+
* kin): the iso-contours of a low-octave curl-warped height field, painted as an opaque warm
|
|
84
|
+
* hypsometric fill, hillshaded into 2.5-D relief, inked with a two-tier index/minor contour
|
|
85
|
+
* hierarchy, the cursor HEAVING the sheet with velocity-scaled weight. Reads standalone in
|
|
86
|
+
* BOTH modes — it CONTRIBUTES a colorful field rather than revealing a flat plate.
|
|
64
87
|
*/
|
|
65
|
-
export declare const DEFAULT_CENTERS: RingCenter[];
|
|
66
|
-
/** The shipped warm-identity default config — thin bright LINES that beat into waves. */
|
|
67
88
|
export declare const DEFAULT_CONCENTRIC_CONFIG: ConcentricConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Concentric } from "./Concentric.vue";
|
|
2
2
|
export { useConcentric, type ConcentricHandle, type UseConcentricOptions, } from "./composables/useConcentric";
|
|
3
|
-
export { type ConcentricConfig,
|
|
4
|
-
export { type
|
|
3
|
+
export { type ConcentricConfig, DEFAULT_CONCENTRIC_CONFIG, WARM_IDENTITY_PALETTE, WARM_IDENTITY_PALETTE_DARK, WARM_GROUND_LIGHT, WARM_GROUND_DARK, MAX_RING_STOPS, } from "./constants";
|
|
4
|
+
export { type Vec2, type LevelFieldParams, sampleHeight, toneFromHeight, hillshade, isIndexLevel, HILLSHADE_EPSILON, } from "./composables/levelField";
|
|
5
5
|
export type { OklchStop } from "../../../composables/color";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** The full-screen-triangle vertex shader (the substrate's standard fullscreen pass). */
|
|
2
2
|
export declare const CONCENTRIC_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 concentric fragment source — the
|
|
4
|
-
export declare const CONCENTRIC_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define RING_GRAVITY 9.81\n#define MAX_RINGS 8\n#define MAX_CENTERS 4\n#define MAX_RING_STOPS 4\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uSpeed;\nuniform vec2 uAxis; // (a, b) ellipsoidal-norm axis ratio\nuniform float uFieldNorm; // field \u2192 [0,1] amplitude scale\nuniform float uAspect;\nuniform int uCenterCount;\nuniform int uRingCount;\nuniform int uStopCount;\nuniform int uRenderMode; // 0 traveling-rings \u00B7 1 static-contour \u00B7 2 both\nuniform float uHasBackground;\nuniform vec3 uLine; // (lineHalfWidth, aaSoftness, contourLevels) \u2014 stroke geometry\nuniform vec3 uBg; // themed background (linear-sRGB)\nuniform vec3 uRings[MAX_RINGS]; // (amplitude, wavelength, phase)\nuniform vec4 uCenters[MAX_CENTERS]; // (x, y, weight, rotAlpha)\nuniform vec3 uPalette[MAX_RING_STOPS]; // linear-sRGB stops\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// rotated ellipsoidal radius \u2014 transcribes ringField.ts ellipsoidalRadiusRot.\nfloat ellipsoidalRadiusRot(vec2 p, vec2 center, float rotAlpha, float axisA, float axisB) {\n float ca = cos(rotAlpha);\n float sa = sin(rotAlpha);\n float px = p.x - center.x;\n float py = p.y - center.y;\n float rx = ca * px + sa * py;\n float ry = -sa * px + ca * py;\n float dx = rx / max(axisA, 1e-4);\n float dy = ry / max(axisB, 1e-4);\n return sqrt(dx * dx + dy * dy);\n}\n\n// |\u2207r| of the rotated ellipsoidal radius \u2014 transcribes ringField.ts ellipsoidalGradMag.\nfloat ellipsoidalGradMag(vec2 p, vec2 center, float rotAlpha, float axisA, float axisB) {\n float ca = cos(rotAlpha);\n float sa = sin(rotAlpha);\n float px = p.x - center.x;\n float py = p.y - center.y;\n float rx = ca * px + sa * py;\n float ry = -sa * px + ca * py;\n float a = max(axisA, 1e-4);\n float b = max(axisB, 1e-4);\n float sx = rx / a;\n float sy = ry / b;\n float r = sqrt(sx * sx + sy * sy);\n float gx = sx / a;\n float gy = sy / b;\n return sqrt(gx * gx + gy * gy) / max(r, 1e-4);\n}\n\n// f(p,t) \u2014 the multi-center weighted radial sum (transcribes ringField.ts sampleRingField).\nfloat sampleRingField(vec2 p, float t) {\n float acc = 0.0;\n for (int j = 0; j < MAX_CENTERS; j++) {\n if (j >= uCenterCount) break;\n vec4 cj = uCenters[j];\n float radius = ellipsoidalRadiusRot(p, cj.xy, cj.w, uAxis.x, uAxis.y);\n float centerSum = 0.0;\n for (int i = 0; i < MAX_RINGS; i++) {\n if (i >= uRingCount) break;\n vec3 r = uRings[i];\n float k = TAU / max(r.y, 1e-4);\n float omega = sqrt(RING_GRAVITY * k) * uSpeed;\n float theta = k * radius - omega * t + r.z;\n centerSum += r.x * sin(theta);\n }\n acc += centerSum * cj.z;\n }\n return acc;\n}\n\n// The IQ gradient-normalized isoline ink + the beat envelope (transcribes ringIsolineInk).\n// Returns vec2(ink, env).\nvec2 ringIsolineInk(vec2 p, float t) {\n float ink = 0.0;\n float env = 0.0;\n float lineHalfW = uLine.x;\n float aa = uLine.y;\n for (int j = 0; j < MAX_CENTERS; j++) {\n if (j >= uCenterCount) break;\n vec4 cj = uCenters[j];\n float radius = ellipsoidalRadiusRot(p, cj.xy, cj.w, uAxis.x, uAxis.y);\n float gradR = ellipsoidalGradMag(p, cj.xy, cj.w, uAxis.x, uAxis.y);\n for (int i = 0; i < MAX_RINGS; i++) {\n if (i >= uRingCount) break;\n vec3 r = uRings[i];\n float k = TAU / max(r.y, 1e-4);\n float omega = sqrt(RING_GRAVITY * k) * uSpeed;\n float phase = k * radius - omega * t + r.z;\n float s = sin(phase);\n float cphase = abs(cos(phase));\n float gradPhase = max(k * gradR, 1e-4);\n // The IQ gradient-normalized distance-to-isoline (domain units; round-trips JS).\n float de = abs(s) / max(cphase * gradPhase, 1e-4);\n // Convert to PIXELS via fwidth(phase) so the stroke is a constant pixel width.\n float dPx = max(fwidth(phase), 1e-4);\n float dePx = de * gradPhase / dPx;\n float lineV = 1.0 - smoothstep(lineHalfW, lineHalfW + aa, dePx);\n // Analytic anti-aliasing: fade lines where the rings pack tighter than a pixel can\n // resolve (fwidth(phase) \u2273 \u03C0, near a center / under DPR) so the field stays thin LINES\n // instead of flooding to a bright slab (IQ filterwidth).\n float aliasFade = 1.0 - smoothstep(PI * 0.6, PI * 1.2, dPx);\n lineV *= aliasFade;\n float w = r.x * cj.z;\n ink = max(ink, lineV * w);\n env += s * w;\n }\n }\n return vec2(clamp(ink, 0.0, 1.0), env);\n}\n\n// The topographic-contour operator (transcribes contourInk).\nfloat contourInk(float envValue, float levels) {\n float fN = envValue * levels;\n float band = abs(fract(fN + 0.5) - 0.5);\n float aaW = max(fwidth(fN), 1e-4);\n return 1.0 - smoothstep(uLine.x, uLine.x + uLine.y, band / aaW);\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 vec2 p = vec2(vUv.x * aspect, vUv.y);\n\n vec2 ie = ringIsolineInk(p, uTime);\n float ink = ie.x;\n float env = ie.y;\n\n if (uRenderMode == 1) {\n ink = contourInk(env * uFieldNorm, max(uLine.z, 1.0));\n } else if (uRenderMode == 2) {\n ink = max(ink, contourInk(env * uFieldNorm, max(uLine.z, 1.0)));\n }\n ink = clamp(ink, 0.0, 1.0);\n\n // The beat-envelope drives the warm-family tone across the ramp (cream\u2194amber\u2194ember) so the\n // crossing families read as warm-light interference (the warm-cream identity).\n float v = clamp(0.5 + env * uFieldNorm, 0.0, 1.0);\n vec3 lin = samplePaletteLin(v);\n vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(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, ink), 1.0);\n return;\n }\n float alpha = ink;\n fragColor = vec4(rgb * alpha, alpha);\n}";
|
|
3
|
+
/** The concentric fragment source — the level-set contour-map render (paper-grid kin). */
|
|
4
|
+
export declare const CONCENTRIC_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define MAX_RING_STOPS 4\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uSpeed;\nuniform float uCellSize; // the topography cell pitch (the contour-warp granularity)\nuniform float uFieldNorm; // height \u2192 [0,1] tone scale\nuniform float uAspect;\nuniform int uStopCount;\nuniform float uHasBackground;\nuniform vec4 uLine; // (lineHalfWidth, aaSoftness, contourLevels, indexEvery)\nuniform vec2 uLightDir; // the fixed cel-light direction (folded norm.zw)\nuniform vec3 uBg; // themed background (linear-sRGB)\nuniform vec4 uWave; // (waveDirX, waveDirY, waveK, waveOmega)\nuniform vec4 uWave2; // (waveSigma, twistMax, shearMax, amp)\nuniform vec4 uTopo; // (heightOctaves, heightSeed, swellAmp, perturbAmp)\nuniform vec4 uCursor; // (cursorX, cursorY, cursorWell, interactive)\nuniform vec4 uTune; // (toneGain, shadeAmp, indexMul, inkDarken)\nuniform vec3 uPalette[MAX_RING_STOPS]; // linear-sRGB stops\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// The shared curl operator (flow.glsl.ts \u2014 forward-declares potentialFBM).\n\nconst float CURL_EPS = 0.012;\n\n// Scalar fbm potential psi \u2014 the host's noise basis, wrapped so the curl operator is\n// basis-agnostic. A host carrying its own fbm defines this as: return fbm(p);\nfloat potentialFBM(vec2 p);\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\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 // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n vec2 g = vec2(dx, dy) / (2.0 * CURL_EPS);\n return vec2(g.y, -g.x);\n}\n\n\n// \u2500\u2500 The host noise basis (the SAME quintic-faded value-noise the suite speaks) \u2500\u2500\nfloat hash21(float x, float y) {\n float px = fract(x * 0.1031);\n float py = fract(y * 0.1031);\n float pz = fract(x * 0.1031);\n float d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px += d; py += d; pz += d;\n return fract((px + py) * pz);\n}\nfloat valueNoise(float x, float y) {\n float ix = floor(x); float iy = floor(y);\n float fx = x - ix; float fy = y - iy;\n float ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n float uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n float a = hash21(ix, iy);\n float b = hash21(ix + 1.0, iy);\n float c = hash21(ix, iy + 1.0);\n float d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n// The curl chunk's forward-declared potentialFBM body.\nfloat potentialFBM(vec2 p) {\n float v = 0.0; float amp = 0.5; float freq = 1.0;\n float px = p.x; float py = p.y;\n for (int i = 0; i < 3; i++) {\n v += amp * valueNoise(px * freq, py * freq);\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx; py = ry; freq *= 2.0; amp *= 0.5;\n }\n return v;\n}\n\n// The shared traveling-wave CELL-WARP chunk (spliced AFTER valueNoise + potentialFBM + curl).\n\n#ifndef WAVE_FIELD_TAU\n#define WAVE_FIELD_TAU 6.283185307179586\n#endif\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfloat travelingEnvelope(vec2 pivot, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma) {\n float coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n float crest = fract(coord / WAVE_FIELD_TAU);\n float z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfloat curlScalar(vec2 cc, float t) {\n vec2 f = curlFBM(vec2(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\n#ifndef WAVE_FIELD_TWIST_FLOOR\n#define WAVE_FIELD_TWIST_FLOOR 0.62\n#endif\nfloat directedTwist(float s, float floorMag) {\n float mag = max(floorMag, abs(s));\n float sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// Defined ABOVE cellTwist: cellTwist rides cellHeight via the driver so twist + face read ONE\n// envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfloat cellHeight(vec2 cc, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma, float amp) {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (floor(twisted_g) at the\n// crest lights a NEIGHBOUR cell). cc in .xy, env in .z.\nvec3 cellDriver(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float cs = max(cellSize, 1e-3);\n vec2 cc = (floor(g / cs) + 0.5) * cs;\n float env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nvec2 faceRelief(vec2 cc, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float eps = max(cellSize, 1e-3) * 0.5;\n float hxp = cellHeight(cc + vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hxm = cellHeight(cc - vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hyp = cellHeight(cc + vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hym = cellHeight(cc - vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the distance\n// into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats as it grows\n// (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfloat facePlateau(vec2 g, float inset, vec2 uvDeriv) {\n vec2 tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n float d = min(tri.x, tri.y);\n float aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nvec2 cellTwist(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float twistMax, float shearMax, float amp) {\n vec3 drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n vec2 cc = drv.xy;\n float env = drv.z;\n float floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n float theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n float shear = shearMax * env * directedTwist(curlScalar(cc + vec2(17.3, 9.1), t), floorMag);\n vec2 local = g - cc;\n float ct = cos(theta);\n float st = sin(theta);\n vec2 rot = vec2(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x += shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\nvec2 waveFlow(vec2 g, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma,\n float twistMax, float amp) {\n float env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n vec2 f = curlFBM(vec2(g.x * 0.6 + t * 0.05, g.y * 0.6 - t * 0.04));\n vec2 f2 = curlFBM(vec2(g.x * 1.1 - t * 0.03, g.y * 1.1 + t * 0.035));\n float k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nvec2 cursorSwirl(vec2 g, vec2 cursor, float strength, float radius) {\n vec2 to = g - cursor;\n float d2 = dot(to, to);\n float r = max(radius, 1e-4);\n float theta = strength * exp(-d2 / (2.0 * r * r));\n float ct = cos(theta);\n float st = sin(theta);\n return cursor + vec2(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfloat heightField(vec2 p, float octavesF, float seed) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n float px = p.x + seed;\n float py = p.y - seed;\n int n = int(clamp(octavesF, 1.0, 6.0));\n for (int i = 0; i < 6; i++) {\n if (i >= n) break;\n v += amp * valueNoise(px * freq, py * freq);\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfloat waveSwell(float t, float phase) {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\nfloat smoothstepEdge(float e0, float e1, float x) {\n float t = clamp((x - e0) / max(e1 - e0, 1e-6), 0.0, 1.0);\n return t * t * (3.0 - 2.0 * t);\n}\n\n// The level-set height at domain p (transcribes levelField.ts sampleHeight).\nfloat sampleHeight(vec2 p, float t) {\n // The CONTINUOUS traveling-wave flow warp (no per-cell seam \u2014 the contours flow + twist as\n // the wave passes OVER and THROUGH them, the SAME wave that twists the paper-grid cells).\n vec2 g = waveFlow(p, t, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.y, uWave2.w);\n if (uCursor.w > 0.5) {\n g = cursorSwirl(g, uCursor.xy, uCursor.z * 0.6, uCellSize * 2.5);\n }\n // LOW base frequency \u2192 BROAD nested loops (a readable contour map). Octaves carry detail.\n float H = heightField(g * 0.9, uTopo.x, uTopo.y);\n H += uTopo.z * waveSwell(t, uTopo.y);\n if (uCursor.w > 0.5) {\n vec2 d = p - uCursor.xy;\n float d2 = dot(d, d);\n // The cursor HEAVE \u2014 a SOFT bulge (a Gaussian peak feathered by a smoothstep falloff so\n // the heave is C1-smooth, NOT a hard-edged quad). The well depth/radius carry the\n // velocity-HEAVE scale (packed JS-side into uCursor.z).\n float g0 = exp(-d2 / 0.22);\n float fall = smoothstepEdge(0.0, 0.55, exp(-d2 / 0.6));\n H += uCursor.z * g0 * fall;\n }\n return H;\n}\n\n// The IQ gradient-free level-set contour ink \u2014 KEPT BYTE-FROZEN (the perfect GPU AA). It is\n// FED the per-level half-width 'hw' (a parameter, NOT a re-derivation). 'aaW' floors against a\n// DPR-aware minimum so the index line stays CONTINUOUS where the heave packs contours.\nfloat contourInk(float fN, float hw) {\n float band = abs(fract(fN + 0.5) - 0.5);\n float aaW = max(fwidth(fN), 6e-4);\n return 1.0 - smoothstepEdge(hw, hw + uLine.y, band / aaW);\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\n// The SHARED hillshade finite-diff epsilon \u2014 pinned ONCE (mirrors levelField.HILLSHADE_EPSILON\n// + the WGSL twin; a per-backend drift would red the L6 numeric parity).\nconst float HILLSHADE_E = 0.012;\n\nvoid main() {\n float aspect = max(uAspect, 1e-4);\n vec2 p = vec2(vUv.x * aspect, vUv.y);\n float t = uTime * uSpeed;\n float levels = max(uLine.z, 1.0);\n\n // The level-set topography (the KEPT field \u2014 the PRIMARY path).\n float H = sampleHeight(p, t);\n\n // \u2500\u2500 1. HYPSOMETRIC TONE \u2014 tanh expands the compressed band (basins+ridges hit the ramp ENDS).\n float tone = 0.5 + 0.5 * tanh(H * uTune.x);\n vec3 fill = samplePaletteLin(tone);\n\n // \u2500\u2500 2. ANALYTIC HILLSHADE \u2014 one \u2207H finite-diff at the SHARED e, dotted with the cel light.\n float e = HILLSHADE_E;\n float hx = sampleHeight(p + vec2(e, 0.0), t) - sampleHeight(p - vec2(e, 0.0), t);\n float hy = sampleHeight(p + vec2(0.0, e), t) - sampleHeight(p - vec2(0.0, e), t);\n vec2 grad = vec2(hx, hy) / (2.0 * e);\n vec2 L = normalize(uLightDir + vec2(1e-5));\n float shade = 0.5 + 0.5 * clamp(dot(normalize(grad + vec2(1e-5)), L), -1.0, 1.0);\n fill *= mix(1.0 - uTune.y, 1.0 + uTune.y, shade);\n\n // \u2500\u2500 3. TWO-TIER INDEX/MINOR CONTOUR \u2014 isIndex a pure f(level); hw FED to the frozen contourInk.\n float fN = H * levels + uTopo.w * sin(floor(H * levels) * 2.4 + t * 0.7);\n float indexEvery = max(uLine.w, 1.0);\n float lvl = floor(fN);\n float isIndex = fract(lvl / indexEvery) < (0.5 / indexEvery) ? 1.0 : 0.0;\n float hw = mix(uLine.x, uLine.x * uTune.z, isIndex);\n float ink = clamp(contourInk(fN, hw), 0.0, 1.0);\n\n // \u2500\u2500 4. INK = a darker ember of the LOCAL fill (the edge-of-its-own-band signature).\n vec3 inkCol = mix(fill, fill * uTune.w, 0.85);\n\n // \u2500\u2500 5. ONE color path + OPAQUE OUT \u2014 the viz IS the colorful field.\n vec3 col = mix(fill, inkCol, ink);\n fragColor = vec4(clamp(linearToSrgb(col), vec3(0.0), vec3(1.0)), 1.0);\n}";
|