@mkbabb/glass-ui 6.0.0 → 7.0.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/README.md +36 -34
- package/dist/DropdownMenuTrigger-ClIq8RJE.js +93 -0
- package/dist/FeedbackMark-DZq5001h.js +23 -0
- package/dist/Input-9BlLluik.js +77 -0
- package/dist/{PagerDots-BoTQ7g5l.js → PagerDots-BEq0MgtH.js} +85 -81
- package/dist/Surface-kFQeYrYv.js +82 -0
- package/dist/accent-tone-solve-Cw7WkRD9.js +14 -0
- package/dist/animated-digit.js +5 -5
- package/dist/asElement-CRnm6A2v.js +9 -0
- package/dist/aurora.js +831 -776
- package/dist/axes.js +25 -14
- package/dist/badge-u65NClWn.js +62 -0
- package/dist/badge.js +1 -1
- package/dist/blob-config.js +1 -1
- package/dist/blob.js +442 -395
- package/dist/button-Bu9F4uU6.js +98 -0
- package/dist/button.js +2 -2
- package/dist/canvas.js +1 -1
- package/dist/card-Bk96VI2R.js +234 -0
- package/dist/card.js +2 -2
- package/dist/carousel.js +109 -169
- package/dist/chip-DFZQr6rV.js +129 -0
- package/dist/chip.js +2 -81
- package/dist/{class-names-5jotTFzp.js → class-names-Cpy5eaBk.js} +11 -4
- package/dist/collapsible-BAP95XTt.js +154 -0
- package/dist/collapsible.js +1 -1
- package/dist/color.js +46 -50
- package/dist/{procedural-color.wgsl-B9mLK7v0.js → color.wgsl-Ct5o9dpf.js} +155 -121
- package/dist/command-SFqDQ65h.js +320 -0
- package/dist/command.js +1 -1
- package/dist/completion-seal.js +54 -54
- package/dist/components/_shared/FeedbackMark.vue.d.ts +11 -0
- package/dist/components/_shared/axes.d.ts +9 -3
- package/dist/components/_shared/class-names.d.ts +9 -8
- package/dist/components/_shared/control-size.d.ts +2 -0
- package/dist/components/_shared/disclosure-context.d.ts +7 -0
- package/dist/components/_shared/disclosure.css +1 -0
- package/dist/components/_shared/feedback.d.ts +7 -0
- package/dist/components/_shared/field-control.css +1 -0
- package/dist/components/_shared/field-surfaces.css +1 -1
- package/dist/components/_shared/fieldControl.d.ts +13 -0
- package/dist/components/_shared/floating.d.ts +14 -0
- package/dist/components/_shared/index.d.ts +2 -6
- package/dist/components/_shared/interaction.d.ts +23 -0
- package/dist/components/_shared/menu.css +1 -1
- package/dist/components/_shared/menuRowClass.d.ts +2 -0
- package/dist/components/_shared/primitive.d.ts +19 -0
- package/dist/components/_shared/resolveSurfaceClass.d.ts +3 -0
- package/dist/components/_shared/selection.d.ts +7 -0
- package/dist/components/_shared/useMotionAxis.d.ts +3 -2
- package/dist/components/accordion/Accordion.vue.d.ts +41 -16
- package/dist/components/accordion/AccordionContent.vue.d.ts +11 -9
- package/dist/components/accordion/AccordionItem.vue.d.ts +12 -9
- package/dist/components/accordion/AccordionTrigger.vue.d.ts +8 -11
- package/dist/components/accordion/index.d.ts +4 -4
- package/dist/components/alert/Alert.vue.d.ts +9 -5
- package/dist/components/alert/index.d.ts +17 -8
- package/dist/components/animated-digit/AnimatedDigit.vue.d.ts +2 -3
- package/dist/components/aurora/Aurora.vue.d.ts +37 -42
- package/dist/components/aurora/composables/atoms-fields.d.ts +13 -2
- package/dist/components/aurora/composables/atoms.d.ts +52 -50
- package/dist/components/aurora/composables/auroraFallbackGround.d.ts +13 -13
- package/dist/components/aurora/composables/auroraImageSource.d.ts +4 -5
- package/dist/components/aurora/composables/color.d.ts +15 -20
- package/dist/components/aurora/composables/frameLoop.d.ts +14 -11
- package/dist/components/aurora/composables/glSetup.d.ts +19 -2
- package/dist/components/aurora/composables/runtime.d.ts +56 -60
- package/dist/components/aurora/composables/uniformBridge.d.ts +9 -14
- package/dist/components/aurora/composables/uniformBridgeWGPU.d.ts +21 -22
- package/dist/components/aurora/composables/uniformBridgeWGPUImage.d.ts +13 -13
- package/dist/components/aurora/composables/useAurora.d.ts +19 -30
- package/dist/components/aurora/composables/wgpuSetup.d.ts +10 -8
- package/dist/components/aurora/constants/budget.d.ts +12 -25
- package/dist/components/aurora/constants/presets.d.ts +47 -58
- package/dist/components/aurora/constants/renderMode.d.ts +21 -36
- package/dist/components/aurora/constants/shaders/aurora-image.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/brush.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/composition.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/flow.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/metal-medium.glsl.d.ts +2 -2
- package/dist/components/aurora/constants/shaders/oil-modes.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/vangogh-medium.glsl.d.ts +1 -1
- package/dist/components/aurora/index.d.ts +2 -1
- package/dist/components/avatar/Avatar.vue.d.ts +72 -11
- package/dist/components/avatar/AvatarFallback.vue.d.ts +1 -2
- package/dist/components/avatar/AvatarImage.vue.d.ts +12 -8
- package/dist/components/avatar/index.d.ts +3 -9
- package/dist/components/avatar/styles.css +1 -0
- package/dist/components/badge/Badge.vue.d.ts +2 -9
- package/dist/components/badge/index.d.ts +32 -9
- package/dist/components/blob/Blob.vue.d.ts +5 -12
- package/dist/components/blob/composables/blobSimulation.d.ts +80 -0
- package/dist/components/blob/composables/buildMetaballProgram.d.ts +1 -1
- package/dist/components/blob/composables/resolveBlobSurface.d.ts +6 -0
- package/dist/components/blob/composables/satelliteKinematics.d.ts +3 -3
- package/dist/components/blob/composables/uniformBridgeWGPU.d.ts +1 -1
- package/dist/components/blob/composables/uploadBlobUniforms.d.ts +4 -31
- package/dist/components/blob/composables/useBlobMood.d.ts +5 -5
- package/dist/components/blob/composables/useBlobPointer.d.ts +11 -12
- package/dist/components/blob/composables/useMetaballRenderer.d.ts +27 -24
- package/dist/components/blob/composables/wgpuSetup.d.ts +7 -5
- package/dist/components/blob/config.d.ts +1 -1
- package/dist/components/blob/index.d.ts +2 -2
- package/dist/components/blob/presets.d.ts +2 -2
- package/dist/components/blob/shaders/metaball-palette.wgsl.d.ts +1 -1
- package/dist/components/blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/blob/shaders/sdf-body.glsl.d.ts +1 -1
- package/dist/components/blob/shaders/watercolor-edges.glsl.d.ts +1 -1
- package/dist/components/blob/types.d.ts +28 -60
- package/dist/components/button/Button.vue.d.ts +26 -20
- package/dist/components/button/index.d.ts +1 -9
- package/dist/components/button/styles.css +1 -0
- package/dist/components/card/Card.vue.d.ts +20 -155
- package/dist/components/card/CardAction.vue.d.ts +0 -7
- package/dist/components/card/CardContent.vue.d.ts +2 -2
- package/dist/components/card/CardDescription.vue.d.ts +2 -2
- package/dist/components/card/CardFooter.vue.d.ts +2 -2
- package/dist/components/card/CardHeader.vue.d.ts +3 -42
- package/dist/components/card/CardTitle.vue.d.ts +6 -3
- package/dist/components/card/card-scroll.css +1 -1
- package/dist/components/card/index.d.ts +1 -3
- package/dist/components/card/styles.css +1 -1
- package/dist/components/carousel/index.d.ts +0 -2
- package/dist/components/carousel/interface.d.ts +2 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +17 -9
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/styles.css +1 -0
- package/dist/components/chip/Chip.vue.d.ts +12 -7
- package/dist/components/chip/chipVariants.d.ts +20 -43
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/types.d.ts +45 -30
- package/dist/components/collapsible/Collapsible.vue.d.ts +22 -9
- package/dist/components/collapsible/CollapsibleContent.vue.d.ts +11 -5
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +12 -9
- package/dist/components/collapsible/index.d.ts +3 -3
- package/dist/components/combobox/Combobox.vue.d.ts +10 -20
- package/dist/components/combobox/ComboboxAnchor.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxEmpty.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxGroup.vue.d.ts +2 -7
- package/dist/components/combobox/ComboboxInput.vue.d.ts +7 -12
- package/dist/components/combobox/ComboboxItem.vue.d.ts +7 -11
- package/dist/components/combobox/ComboboxItemIndicator.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxList.vue.d.ts +14 -17
- package/dist/components/combobox/ComboboxTrigger.vue.d.ts +16 -0
- package/dist/components/combobox/index.d.ts +2 -1
- package/dist/components/combobox/types.d.ts +87 -0
- package/dist/components/command/Command.vue.d.ts +9 -23
- package/dist/components/command/CommandDialog.vue.d.ts +4 -9
- package/dist/components/command/CommandEmpty.vue.d.ts +2 -6
- package/dist/components/command/CommandGroup.vue.d.ts +2 -7
- package/dist/components/command/CommandInput.vue.d.ts +6 -7
- package/dist/components/command/CommandItem.vue.d.ts +7 -11
- package/dist/components/command/CommandList.vue.d.ts +12 -19
- package/dist/components/command/CommandSeparator.vue.d.ts +2 -6
- package/dist/components/command/CommandShortcut.vue.d.ts +2 -2
- package/dist/components/command/dialogContext.d.ts +6 -0
- package/dist/components/command/index.d.ts +10 -10
- package/dist/components/command/styles.css +1 -0
- package/dist/components/command/types.d.ts +27 -0
- package/dist/components/completion-seal/CompletionSeal.vue.d.ts +2 -2
- package/dist/components/completion-seal/constants.d.ts +2 -2
- package/dist/components/configurator/Configurator.vue.d.ts +6 -6
- package/dist/components/configurator/ConfiguratorLayer.vue.d.ts +14 -18
- package/dist/components/configurator/ConfiguratorRow.vue.d.ts +14 -17
- package/dist/components/configurator/size.d.ts +5 -7
- package/dist/components/configurator/styles.css +1 -1
- package/dist/components/constellation/Constellation.vue.d.ts +1 -1
- package/dist/components/constellation/composables/createConstellationField.d.ts +2 -2
- package/dist/components/constellation/constants.d.ts +8 -8
- package/dist/components/constellation/constellationField.d.ts +5 -6
- package/dist/components/constellation/constellationInteraction.d.ts +8 -8
- package/dist/components/constellation/constellationTypes.d.ts +53 -54
- package/dist/components/constellation/constellationWell.d.ts +2 -2
- package/dist/components/dark-mode-toggle/DarkModeToggle.vue.d.ts +12 -0
- package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -0
- package/dist/components/dark-mode-toggle/index.d.ts +2 -0
- package/dist/components/data-table/DataTable.vue.d.ts +11 -59
- package/dist/components/data-table/composables/useDataTableRowIdentity.d.ts +5 -23
- package/dist/components/data-table/index.d.ts +1 -1
- package/dist/components/data-table/styles.css +1 -0
- package/dist/components/data-table/types.d.ts +10 -12
- package/dist/components/deck/index.d.ts +0 -1
- package/dist/components/dialog/Dialog.vue.d.ts +8 -3
- package/dist/components/dialog/DialogClose.vue.d.ts +3 -1
- package/dist/components/dialog/DialogContent.vue.d.ts +27 -90
- package/dist/components/dialog/DialogDescription.vue.d.ts +5 -6
- package/dist/components/dialog/DialogTitle.vue.d.ts +5 -6
- package/dist/components/dialog/DialogTrigger.vue.d.ts +3 -1
- package/dist/components/{_shared → dialog}/ModalOverlay.vue.d.ts +18 -16
- package/dist/components/dialog/dialogStageContext.d.ts +7 -0
- package/dist/components/dialog/index.d.ts +8 -8
- package/dist/components/dialog/placement.css +1 -1
- package/dist/components/dialog/sheet-motion.d.ts +17 -0
- package/dist/components/dock/DockControl.vue.d.ts +9 -12
- package/dist/components/dock/DockCrossfade.vue.d.ts +4 -8
- package/dist/components/dock/DockLayer.vue.d.ts +2 -3
- package/dist/components/dock/DockLayerGroup.vue.d.ts +6 -6
- package/dist/components/dock/DockSeparator.vue.d.ts +8 -8
- package/dist/components/dock/composables/dockContext.d.ts +4 -14
- package/dist/components/dock/composables/dockCrossfadeContext.d.ts +6 -7
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +7 -86
- package/dist/components/dock/composables/index.d.ts +1 -1
- package/dist/components/dock/composables/useDockClickIntegrity.d.ts +1 -1
- package/dist/components/dock/composables/useDockHold.d.ts +4 -5
- package/dist/components/dock/composables/useDockMorph.d.ts +26 -0
- package/dist/components/dock/composables/useDockOverflowFit.d.ts +4 -6
- package/dist/components/dock/composables/useDockSearch.d.ts +8 -8
- package/dist/components/dock/composables/useDockShellProps.d.ts +46 -43
- package/dist/components/dock/composables/useDockSpring.d.ts +7 -11
- package/dist/components/dock/composables/useDockState.d.ts +12 -3
- package/dist/components/dock/composables/useDockTouchGate.d.ts +14 -23
- package/dist/components/dock/constants.d.ts +5 -78
- package/dist/components/dock/index.d.ts +2 -7
- package/dist/components/dock/styles/controls.css +1 -1
- package/dist/components/dock/styles/crossfade.css +1 -1
- package/dist/components/dock/styles/density.css +1 -1
- package/dist/components/dock/styles/index.css +1 -1
- package/dist/components/dock/styles/layer-group.css +1 -1
- package/dist/components/dock/styles/layers.css +1 -1
- package/dist/components/dock/styles/morph.css +1 -1
- package/dist/components/dock/styles/shape.css +1 -1
- package/dist/components/dock/styles/shell.css +1 -1
- package/dist/components/drawer/Drawer.vue.d.ts +17 -20
- package/dist/components/drawer/DrawerContent.vue.d.ts +15 -16
- package/dist/components/drawer/DrawerDescription.vue.d.ts +5 -6
- package/dist/components/drawer/DrawerOverlay.vue.d.ts +6 -6
- package/dist/components/drawer/DrawerTitle.vue.d.ts +5 -6
- package/dist/components/drawer/composables/drawerSnapContext.d.ts +7 -1
- package/dist/components/drawer/composables/useDrawerSnap.d.ts +3 -1
- package/dist/components/drawer/constants.d.ts +7 -25
- package/dist/components/drawer/index.d.ts +10 -10
- package/dist/components/drawer/styles.css +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.vue.d.ts +43 -16
- package/dist/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +22 -13
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.d.ts +28 -19
- package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts +6 -4
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +21 -9
- package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts +9 -9
- package/dist/components/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +13 -6
- package/dist/components/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +18 -11
- package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts +5 -6
- package/dist/components/dropdown-menu/DropdownMenuShortcut.vue.d.ts +7 -8
- package/dist/components/dropdown-menu/DropdownMenuSub.vue.d.ts +15 -7
- package/dist/components/dropdown-menu/DropdownMenuSubContent.vue.d.ts +24 -17
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +11 -9
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +15 -8
- package/dist/components/dropdown-menu/index.d.ts +15 -15
- package/dist/components/dropdown-menu/styles.css +1 -0
- package/dist/components/dropdown-menu/useMenuTrigger.d.ts +2 -9
- package/dist/components/easing/composables/useEasingPicker.d.ts +5 -8
- package/dist/components/easing/constants.d.ts +1 -1
- package/dist/components/expandable-container/ExpandableContainer.vue.d.ts +1 -25
- package/dist/components/expandable-container/styles.css +1 -0
- package/dist/components/fading-scroll/FadingScroll.vue.d.ts +4 -0
- package/dist/components/fading-scroll/composables/useFadingScroll.d.ts +4 -0
- package/dist/components/fading-scroll/constants.d.ts +1 -2
- package/dist/components/fourier-field/FourierField.vue.d.ts +3 -5
- package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +1 -1
- package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +1 -1
- package/dist/components/fourier-field/composables/useFourierField.d.ts +4 -4
- package/dist/components/fourier-field/constants.d.ts +10 -10
- package/dist/components/fourier-field/index.d.ts +3 -3
- package/dist/components/fourier-field/presets.d.ts +3 -3
- package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +2 -2
- package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -1
- package/dist/components/handmark/HandMark.vue.d.ts +1 -1
- package/dist/components/handmark/brush.d.ts +1 -1
- package/dist/components/handmark/composables/useHandMark.d.ts +4 -4
- package/dist/components/handmark/constants.d.ts +10 -10
- package/dist/components/handmark/geometry.d.ts +8 -8
- package/dist/components/handmark/index.d.ts +7 -8
- package/dist/components/handmark/noise.d.ts +3 -3
- package/dist/components/handmark/types.d.ts +2 -2
- package/dist/components/header-ribbon/HeaderRibbon.vue.d.ts +3 -21
- package/dist/components/header-ribbon/styles.css +1 -0
- package/dist/components/header-ribbon/types.d.ts +5 -2
- package/dist/components/index.d.ts +0 -3
- package/dist/components/infinite-scroll/composables/types.d.ts +1 -1
- package/dist/components/input/Input.vue.d.ts +10 -35
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/types.d.ts +22 -0
- package/dist/components/instrument-chassis/InstrumentChassis.vue.d.ts +10 -84
- package/dist/components/instrument-chassis/index.d.ts +1 -2
- package/dist/components/instrument-chassis/styles.css +1 -1
- package/dist/components/instrument-chassis/types.d.ts +13 -0
- package/dist/components/label/Label.vue.d.ts +9 -14
- package/dist/components/label/index.d.ts +1 -1
- package/dist/components/labeled-field/LabeledField.vue.d.ts +10 -108
- package/dist/components/labeled-field/LabeledInput.vue.d.ts +3 -23
- package/dist/components/labeled-field/LabeledSelect.vue.d.ts +12 -18
- package/dist/components/labeled-field/LabeledSlider.vue.d.ts +12 -18
- package/dist/components/labeled-field/LabeledSwitch.vue.d.ts +14 -17
- package/dist/components/labeled-field/index.d.ts +1 -0
- package/dist/components/labeled-field/types.d.ts +50 -0
- package/dist/components/liquid-grid/composables/liquidGrid.d.ts +5 -5
- package/dist/components/liquid-grid/constants.d.ts +6 -7
- package/dist/components/liquid-grid/shaders/liquid-grid.glsl.d.ts +1 -1
- package/dist/components/liquid-grid/shaders/liquid-grid.wgsl.d.ts +1 -1
- package/dist/components/metric/Metric.vue.d.ts +24 -0
- package/dist/components/metric/MetricCell.vue.d.ts +26 -0
- package/dist/components/metric/MetricRow.vue.d.ts +22 -0
- package/dist/components/metric/MetricStack.vue.d.ts +16 -0
- package/dist/components/metric/coalesce-metric.d.ts +7 -28
- package/dist/components/metric/index.d.ts +5 -0
- package/dist/components/metric/styles.css +1 -0
- package/dist/components/metric/types.d.ts +32 -0
- package/dist/components/number-field/NumberField.vue.d.ts +21 -9
- package/dist/components/number-field/NumberFieldContent.vue.d.ts +2 -2
- package/dist/components/number-field/NumberFieldDecrement.vue.d.ts +6 -6
- package/dist/components/number-field/NumberFieldIncrement.vue.d.ts +6 -6
- package/dist/components/number-field/NumberFieldInput.vue.d.ts +1 -6
- package/dist/components/number-field/context.d.ts +6 -0
- package/dist/components/number-field/index.d.ts +5 -5
- package/dist/components/number-field/styles.css +1 -0
- package/dist/components/pager-dots/constants.d.ts +1 -2
- package/dist/components/pager-dots/index.d.ts +0 -2
- package/dist/components/paper-backdrop/PaperBackdrop.vue.d.ts +1 -14
- package/dist/components/paper-backdrop/index.d.ts +1 -1
- package/dist/components/popover/Popover.vue.d.ts +24 -36
- package/dist/components/popover/PopoverContent.vue.d.ts +23 -29
- package/dist/components/popover/PopoverTrigger.vue.d.ts +12 -7
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popover/popoverContext.d.ts +3 -4
- package/dist/components/progress/Progress.vue.d.ts +5 -13
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/types.d.ts +19 -0
- package/dist/components/pulse/Pulse.vue.d.ts +8 -47
- package/dist/components/pulse/index.d.ts +1 -0
- package/dist/components/radio-group/RadioGroup.vue.d.ts +27 -15
- package/dist/components/radio-group/RadioGroupItem.vue.d.ts +9 -6
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/styles.css +1 -0
- package/dist/components/scroll-progress-rim/styles.css +1 -1
- package/dist/components/search/FuzzySearch.vue.d.ts +2 -2
- package/dist/components/search/SearchBar.vue.d.ts +2 -2
- package/dist/components/search/searchVariants.d.ts +15 -17
- package/dist/components/select/Select.vue.d.ts +25 -14
- package/dist/components/select/SelectContent.vue.d.ts +26 -29
- package/dist/components/select/SelectGroup.vue.d.ts +7 -11
- package/dist/components/select/SelectItem.vue.d.ts +24 -13
- package/dist/components/select/SelectLabel.vue.d.ts +7 -11
- package/dist/components/select/SelectScrollDownButton.vue.d.ts +3 -4
- package/dist/components/select/SelectScrollUpButton.vue.d.ts +3 -4
- package/dist/components/select/SelectSeparator.vue.d.ts +5 -6
- package/dist/components/select/SelectTrigger.vue.d.ts +15 -41
- package/dist/components/select/SelectValue.vue.d.ts +13 -7
- package/dist/components/select/index.d.ts +16 -8
- package/dist/components/separator/Separator.vue.d.ts +11 -6
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +3 -31
- package/dist/components/slider/Slider.vue.d.ts +10 -37
- package/dist/components/slider/index.d.ts +1 -45
- package/dist/components/slider/types.d.ts +25 -0
- package/dist/components/sortable-list/SortableList.vue.d.ts +1 -1
- package/dist/components/sortable-list/composables/ghostRenderer.d.ts +1 -1
- package/dist/components/sortable-list/composables/touchGate.d.ts +1 -1
- package/dist/components/sortable-list/composables/transitionTiming.d.ts +1 -1
- package/dist/components/status-dot/StatusDot.vue.d.ts +7 -10
- package/dist/components/status-dot/index.d.ts +1 -0
- package/dist/components/surface/Surface.vue.d.ts +13 -21
- package/dist/components/surface/index.d.ts +2 -2
- package/dist/components/switch/Switch.vue.d.ts +20 -11
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/styles.css +1 -0
- package/dist/components/table/Table.vue.d.ts +1 -1
- package/dist/components/tabs/SegmentedTabs.vue.d.ts +21 -13
- package/dist/components/tabs/composables/useTabDragMorph.d.ts +6 -6
- package/dist/components/tabs/composables/useTabResponsive.d.ts +5 -6
- package/dist/components/tabs/composables/useTabRovingFocus.d.ts +16 -16
- package/dist/components/tabs/constants.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/styles/drag.css +1 -1
- package/dist/components/tabs/styles/segmented.css +1 -1
- package/dist/components/tags-input/TagsInput.vue.d.ts +28 -15
- package/dist/components/tags-input/TagsInputInput.vue.d.ts +8 -6
- package/dist/components/tags-input/TagsInputItem.vue.d.ts +9 -8
- package/dist/components/tags-input/TagsInputItemDelete.vue.d.ts +5 -6
- package/dist/components/tags-input/TagsInputItemText.vue.d.ts +5 -6
- package/dist/components/tags-input/context.d.ts +5 -0
- package/dist/components/tags-input/index.d.ts +5 -5
- package/dist/components/tags-input/styles.css +1 -0
- package/dist/components/textarea/Textarea.vue.d.ts +10 -55
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/types.d.ts +22 -0
- package/dist/components/timeline/ContinuousMarkers.vue.d.ts +2 -4
- package/dist/components/timeline/ContinuousRail.vue.d.ts +3 -6
- package/dist/components/timeline/ContinuousTimeline.vue.d.ts +12 -13
- package/dist/components/timeline/GlassTimeline.vue.d.ts +7 -8
- package/dist/components/timeline/ScrubberTimeline.vue.d.ts +4 -4
- package/dist/components/timeline/SegmentedTimeline.vue.d.ts +2 -3
- package/dist/components/timeline/geometry.d.ts +3 -4
- package/dist/components/timeline/types.d.ts +3 -3
- package/dist/components/toast/Toast.vue.d.ts +37 -79
- package/dist/components/toast/ToastAction.vue.d.ts +5 -5
- package/dist/components/toast/ToastClose.vue.d.ts +4 -5
- package/dist/components/toast/ToastDescription.vue.d.ts +4 -5
- package/dist/components/toast/ToastTitle.vue.d.ts +4 -5
- package/dist/components/toast/Toaster.vue.d.ts +1 -1
- package/dist/components/toast/index.d.ts +8 -9
- package/dist/components/toast/use-toast.d.ts +20 -163
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +44 -22
- package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +11 -9
- package/dist/components/toggle-group/index.d.ts +3 -2
- package/dist/components/toggle-group/styles.css +1 -0
- package/dist/components/toggle-group/toggleGroupContext.d.ts +4 -15
- package/dist/components/tooltip/Tooltip.vue.d.ts +20 -7
- package/dist/components/tooltip/TooltipContent.vue.d.ts +20 -12
- package/dist/components/tooltip/TooltipProvider.vue.d.ts +12 -5
- package/dist/components/tooltip/TooltipTrigger.vue.d.ts +12 -5
- package/dist/components/tooltip/index.d.ts +4 -4
- package/dist/components/typewriter/composables/useTypewriter.d.ts +1 -0
- package/dist/components/typewriter/utils/timing.d.ts +0 -2
- package/dist/components/watercolor-dot/WatercolorDot.vue.d.ts +5 -18
- package/dist/components/watercolor-dot/useWatercolorBlob.d.ts +1 -4
- package/dist/composables/color/accent-tone-solve.d.ts +2 -5
- package/dist/composables/color/index.d.ts +31 -38
- package/dist/composables/color/useAccentTone.d.ts +0 -3
- package/dist/composables/color/value.d.ts +21 -0
- package/dist/composables/context/createContext.d.ts +2 -2
- package/dist/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +7 -6
- package/dist/composables/dom/useBreakpoint.d.ts +2 -2
- package/dist/composables/dom/useClipboard.d.ts +28 -52
- package/dist/composables/dom/useDocumentVisibility.d.ts +3 -1
- package/dist/composables/dom/useIdleReady.d.ts +5 -6
- package/dist/composables/dom/useTokenColor.d.ts +2 -2
- package/dist/composables/dom/useUserInvalidAria.d.ts +2 -3
- package/dist/composables/dom/useViewportReady.d.ts +4 -4
- package/dist/composables/glass/backdropLuminanceSample.d.ts +7 -6
- package/dist/composables/glass/canvas2d/useCanvas2D.d.ts +7 -1
- package/dist/composables/glass/textureUpload.d.ts +8 -10
- package/dist/composables/glass/useGlassBackdropLuminance.d.ts +11 -19
- package/dist/composables/glass/useSpecularPointer.d.ts +6 -6
- package/dist/composables/glass/useSpecularTracking.d.ts +12 -15
- package/dist/composables/glass/wave/waveField.d.ts +2 -2
- package/dist/composables/glass/wave/waveField.glsl.d.ts +1 -1
- package/dist/composables/glass/wave/waveField.wgsl.d.ts +1 -1
- package/dist/composables/glass/webgl/backingSize.d.ts +5 -8
- package/dist/composables/glass/webgl/compile.d.ts +1 -1
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +20 -20
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +16 -28
- package/dist/composables/glass/webgl/visibility.d.ts +3 -4
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +10 -10
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -1
- package/dist/composables/glass/webgpu/webgpuCanvasTypes.d.ts +12 -10
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +15 -16
- package/dist/composables/motion/core/asElement.d.ts +2 -0
- package/dist/composables/motion/{constants.d.ts → core/constants.d.ts} +2 -3
- package/dist/composables/motion/core/index.d.ts +20 -23
- package/dist/composables/motion/core/useReducedMotion.d.ts +5 -0
- package/dist/composables/motion/core/useViewTransition.d.ts +44 -0
- package/dist/composables/motion/index.d.ts +14 -16
- package/dist/composables/motion/{useDockCtaReceive.d.ts → morph/useDockCtaReceive.d.ts} +2 -3
- package/dist/composables/motion/{useDragMorph.d.ts → morph/useDragMorph.d.ts} +7 -7
- package/dist/composables/motion/morph/useElementMorph.d.ts +50 -0
- package/dist/composables/motion/{useLeadTrail.d.ts → morph/useLeadTrail.d.ts} +6 -6
- package/dist/composables/motion/{useSelectionGroup.d.ts → morph/useSelectionGroup.d.ts} +7 -5
- package/dist/composables/motion/{useSelectionIndicator.d.ts → morph/useSelectionIndicator.d.ts} +9 -16
- package/dist/composables/motion/{useNumericTransition.d.ts → number/useNumericTransition.d.ts} +2 -2
- package/dist/composables/motion/{pointerFieldMappings.d.ts → pointer/pointerFieldMappings.d.ts} +7 -10
- package/dist/composables/motion/{usePointerVelocityField.d.ts → pointer/usePointerVelocityField.d.ts} +1 -1
- package/dist/composables/motion/{bloomUpField.d.ts → reveal/bloomUpField.d.ts} +1 -1
- package/dist/composables/motion/reveal/useBloomUp.d.ts +33 -0
- package/dist/composables/motion/{useLiquidReveal.d.ts → reveal/useLiquidReveal.d.ts} +5 -5
- package/dist/composables/motion/{useStagger.d.ts → reveal/useStagger.d.ts} +3 -3
- package/dist/composables/motion/reveal/useStaggerReveal.d.ts +28 -0
- package/dist/composables/motion/{useScrollChrome.d.ts → scroll/useScrollChrome.d.ts} +2 -2
- package/dist/composables/motion/{useScrollProgress.d.ts → scroll/useScrollProgress.d.ts} +12 -2
- package/dist/composables/motion/{springPresets.d.ts → spring/springPresets.d.ts} +8 -7
- package/dist/composables/motion/{springProjection.d.ts → spring/springProjection.d.ts} +3 -0
- package/dist/composables/motion/{useLiquidFlex.d.ts → spring/useLiquidFlex.d.ts} +11 -12
- package/dist/composables/motion/{useLiquidPress.d.ts → spring/useLiquidPress.d.ts} +3 -3
- package/dist/composables/motion/{useSpring.d.ts → spring/useSpring.d.ts} +5 -2
- package/dist/composables/motion/{useSpringMount.d.ts → spring/useSpringMount.d.ts} +8 -1
- package/dist/composables/sidebar/types.d.ts +3 -3
- package/dist/{configurator-CSENXXSy.js → configurator-M5OaIlJd.js} +11 -11
- package/dist/configurator.js +1 -1
- package/dist/{constants-DRZmNIY-.js → constants-nBz23tJE.js} +1 -1
- package/dist/constellation.js +125 -124
- package/dist/{createCanvasLifecycle-hsFkQVdl.js → createCanvasLifecycle-DbXRwjU_.js} +87 -82
- package/dist/dark-mode-toggle.d.ts +1 -0
- package/dist/dark-mode-toggle.js +43 -0
- package/dist/dark.js +1 -1
- package/dist/data-table-BygKg6ZA.js +491 -0
- package/dist/data-table.js +1 -1
- package/dist/deck.js +3 -3
- package/dist/dialog-TNRDkcE4.js +385 -0
- package/dist/dialog.js +1 -1
- package/dist/dock.js +523 -940
- package/dist/dockContext-BUTlGRNJ.js +13 -0
- package/dist/dom.js +52 -114
- package/dist/drawer.js +262 -209
- package/dist/dropdown-menu-BlbnvMaZ.js +507 -0
- package/dist/dropdown-menu.js +2 -2
- package/dist/easing.js +294 -278
- package/dist/expandable-container.js +107 -93
- package/dist/fading-scroll-DhxXIhm2.js +96 -0
- package/dist/fading-scroll.js +1 -1
- package/dist/field-control.css_vue_type_style_index_0_src_true_lang-CeLay9Tk.js +21 -0
- package/dist/floating-dB5TD88k.js +7 -0
- package/dist/{flow.glsl-DEGFGE11.js → flow.wgsl-Cd2GUkPx.js} +2 -2
- package/dist/fonts/README.md +14 -18
- package/dist/forms.js +279 -174
- package/dist/fourier-field.js +148 -148
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +512 -373
- package/dist/handmark.js +4 -4
- package/dist/header-ribbon.js +37 -68
- package/dist/index.d.ts +9 -18
- package/dist/infinite-scroll.js +31 -28
- package/dist/instrument-chassis.js +54 -2
- package/dist/label-DnMqH7jr.js +55 -0
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +291 -214
- package/dist/liquid-grid.js +141 -151
- package/dist/menuRowClass-Nh7CtMON.js +12 -0
- package/dist/metric.d.ts +1 -0
- package/dist/metric.js +192 -0
- package/dist/motion-core.js +73 -165
- package/dist/motion.js +104 -161
- package/dist/number-field-Boe09SvX.js +154 -0
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -2
- package/dist/paper-backdrop.js +16 -24
- package/dist/{pointerFieldMappings-CZojkgKj.js → pointerFieldMappings-DP5tla5z.js} +4 -7
- package/dist/popover-BQGYXZyO.js +244 -0
- package/dist/popover.js +1 -1
- package/dist/{presets-CxeNvxuO.js → presets-5myqNv59.js} +1 -1
- package/dist/primitive-B2t2jdqM.js +11 -0
- package/dist/progress-DClbhRAT.js +88 -0
- package/dist/progress.js +1 -1
- package/dist/pulse.js +29 -43
- package/dist/reactive.js +1 -1
- package/dist/resolveCanvasColor-DS_6DBxA.js +82 -0
- package/dist/resolveSurfaceClass-DCZ4PZcy.js +6 -0
- package/dist/{scrollReader-C2oK9Hb8.js → scrollReader-Brf5cQNo.js} +1 -1
- package/dist/search.js +241 -213
- package/dist/select-BcBAyLXA.js +336 -0
- package/dist/select.js +1 -1
- package/dist/selection-DqIULxRG.js +6 -0
- package/dist/separator-CgZInrX-.js +75 -0
- package/dist/separator.js +1 -1
- package/dist/sidebar.js +53 -42
- package/dist/slider-DzqeQmMu.js +162 -0
- package/dist/slider.js +2 -2
- package/dist/sortable-list.js +9 -8
- package/dist/springPresets-rCii5KqX.js +52 -0
- package/dist/status-dot.js +26 -43
- package/dist/styles/accessibility.css +1 -1
- package/dist/styles/animations.css +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/a11y-fallback.css +1 -1
- package/dist/styles/glass/accent-tone.css +1 -1
- package/dist/styles/glass/control-surfaces.css +1 -1
- package/dist/styles/glass/defined.css +1 -1
- package/dist/styles/glass/glass-atom.css +1 -1
- package/dist/styles/glass/glass-capsule.css +1 -1
- package/dist/styles/glass/glass-chip.css +1 -1
- package/dist/styles/glass/ladder.css +1 -1
- package/dist/styles/glass/liquid-fill.css +1 -1
- package/dist/styles/glass/material-roles.css +1 -1
- package/dist/styles/glass/material.css +1 -1
- package/dist/styles/glass/reveal.css +1 -1
- package/dist/styles/glass/squircle.css +1 -1
- package/dist/styles/glass/surface-axis.css +1 -1
- package/dist/styles/glass/surfaces-pager.css +1 -1
- package/dist/styles/glass/surfaces.css +1 -1
- package/dist/styles/glass-refract.css +1 -1
- package/dist/styles/glass.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/paper.css +1 -1
- package/dist/styles/scroll-driven.css +1 -1
- package/dist/styles/theme/bridges.css +1 -1
- package/dist/styles/theme/radius.css +1 -1
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm.css +1 -1
- package/dist/styles/tokens/glass-deep.css +1 -1
- package/dist/styles/tokens/glass-fx.css +1 -1
- package/dist/styles/tokens/glass.css +1 -1
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/manifest.d.ts +14 -0
- package/dist/styles/tokens/manifest.ts +56 -0
- package/dist/styles/tokens/motion-registers.css +1 -1
- package/dist/styles/tokens/offsets.css +1 -1
- package/dist/styles/tokens/property-regs-specular.css +1 -1
- package/dist/styles/tokens/property-regs.css +1 -1
- package/dist/styles/tokens/scale-paper.css +1 -1
- package/dist/styles/tokens/scheme-motion.css +1 -1
- package/dist/styles/tokens/scheme-spring.css +1 -1
- package/dist/styles/tokens/scroll-tokens.css +1 -1
- package/dist/styles/tokens/shadow.css +1 -1
- package/dist/styles/tokens/sizing-config.css +1 -1
- package/dist/styles/tokens/sizing.css +1 -1
- package/dist/styles/tokens.d.ts +4 -9
- package/dist/styles/tokens.ts +5 -9
- package/dist/styles/transitions.css +1 -1
- package/dist/styles/typography/scale.css +1 -1
- package/dist/styles/typography/semantic.css +1 -1
- package/dist/styles/typography/utilities.css +1 -1
- package/dist/styles/utilities/a11y-overrides.css +1 -1
- package/dist/styles/utilities/base-misc.css +1 -1
- package/dist/styles/utilities/base.css +1 -1
- package/dist/styles/utilities/btn.css +1 -1
- package/dist/styles/utilities/components.css +1 -1
- package/dist/styles/utilities/metal.css +1 -1
- package/dist/styles/utilities/responsive.css +1 -0
- package/dist/styles/view-transition.css +1 -1
- package/dist/{supportsCssTimeline-Dz-GVxXM.js → supportsCssTimeline-C2zyWpl8.js} +1 -1
- package/dist/surface.js +2 -3
- package/dist/switch-DZjQuFLa.js +54 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +141 -169
- package/dist/timeline.js +86 -87
- package/dist/toast-CH5mnsYT.js +267 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-O6jBo7AE.js +150 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tokens.js +96 -5
- package/dist/tooltip-Drx5qnw_.js +148 -0
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +222 -193
- package/dist/{useAccentTone-C-p6WdPe.js → useAccentTone-DyInfHXE.js} +2 -2
- package/dist/{useAnimatedNumber-BRVVaFFc.js → useAnimatedNumber-WPtMz0AN.js} +2 -2
- package/dist/useClipboard-D36OTaeT.js +53 -0
- package/dist/useDockCtaReceive-DkrOTM0q.js +146 -0
- package/dist/useDocumentVisibility-Dh_TGXsU.js +21 -0
- package/dist/useDragMorph-BogSV_nv.js +293 -0
- package/dist/{useIntersectionPause-B-dbxl9w.js → useIntersectionPause-B5mAU6XY.js} +15 -15
- package/dist/useLeadTrail-AW1-zZcd.js +74 -0
- package/dist/{useLiquidFlex-Ch4exNvN.js → useLiquidFlex-TJZmRqyY.js} +1 -1
- package/dist/useLiquidPress-BOxuDkKa.js +101 -0
- package/dist/useMotionAxis-D-rtIhca.js +19 -0
- package/dist/usePointerVelocityField-DsIf7yyq.js +121 -0
- package/dist/useRAFLoop-B3YlWK4M.js +98 -0
- package/dist/useReducedMotion-vCXA_vyM.js +27 -0
- package/dist/useRoutePointer-B8itM7Ka.js +53 -0
- package/dist/useScrollProgress-CSFYXIZT.js +43 -0
- package/dist/useScrollTrigger-BDdqptlc.js +87 -0
- package/dist/useSelectionGroup-B5XplBbo.js +132 -0
- package/dist/{useSpring-BBSKFx_0.js → useSpring-9u2_shxV.js} +2 -2
- package/dist/useSpringMount-uQ8QL9Ff.js +74 -0
- package/dist/useTabRovingFocus-YnWh-Ytr.js +169 -0
- package/dist/useTextHighlight-mfwNIC1f.js +112 -0
- package/dist/{useTouchGate-Cj5fOkTv.js → useTouchGate-B4mzQcHJ.js} +1 -1
- package/dist/vSpecular-DMJo8pfD.js +68 -0
- package/dist/value-DMhh2R94.js +33 -0
- package/dist/watercolor-dot.js +77 -103
- package/package.json +163 -232
- package/dist/DropdownMenuTrigger-BzQtd9lt.js +0 -65
- package/dist/FadingScroll-C1ZWEjmG.js +0 -83
- package/dist/Input-B4WQ_CMc.js +0 -57
- package/dist/Surface-BWRfwyn8.js +0 -59
- package/dist/accent-tone-solve-Dii9ePhK.js +0 -20
- package/dist/badge-C0C-rTBu.js +0 -80
- package/dist/button-32mg6xA8.js +0 -194
- package/dist/card-16xmzIr3.js +0 -303
- package/dist/coalesce-metric-znAcLzkB.js +0 -13
- package/dist/collapsible-bPzS1aQk.js +0 -63
- package/dist/color-swatch.d.ts +0 -1
- package/dist/color-swatch.js +0 -48
- package/dist/command-BjPjUU9z.js +0 -307
- package/dist/components/_shared/menuItemVariants.d.ts +0 -51
- package/dist/components/_shared/useControlSize.d.ts +0 -46
- package/dist/components/_shared/useStalePropWarning.d.ts +0 -27
- package/dist/components/_shared/useSurfaceAxis.d.ts +0 -64
- package/dist/components/card/ScrollCard.vue.d.ts +0 -33
- package/dist/components/card/ScrollCardHeader.vue.d.ts +0 -17
- package/dist/components/carousel/CarouselNext.vue.d.ts +0 -21
- package/dist/components/carousel/CarouselPrevious.vue.d.ts +0 -21
- package/dist/components/color-swatch/ColorSwatch.vue.d.ts +0 -22
- package/dist/components/color-swatch/index.d.ts +0 -1
- package/dist/components/controls/DarkModeToggle.vue.d.ts +0 -32
- package/dist/components/controls/dark-mode-toggle.css +0 -1
- package/dist/components/controls/index.d.ts +0 -1
- package/dist/components/data-table/DataTablePagination.vue.d.ts +0 -13
- package/dist/components/dock/DockSection.vue.d.ts +0 -69
- package/dist/components/dock/DockStack.vue.d.ts +0 -73
- package/dist/components/dock/composables/dockMorphContext.d.ts +0 -91
- package/dist/components/dock/composables/useDockFisheye.d.ts +0 -24
- package/dist/components/dock/composables/useDockPopover.d.ts +0 -70
- package/dist/components/dock/styles/fisheye.css +0 -1
- package/dist/components/dock/styles/popover.css +0 -1
- package/dist/components/dock/styles/section.css +0 -1
- package/dist/components/focus-scope/FocusScope.vue.d.ts +0 -20
- package/dist/components/focus-scope/index.d.ts +0 -2
- package/dist/components/goo-filter/GooFilter.vue.d.ts +0 -22
- package/dist/components/goo-filter/index.d.ts +0 -1
- package/dist/components/icon-chip/IconChip.vue.d.ts +0 -4
- package/dist/components/icon-chip/index.d.ts +0 -2
- package/dist/components/icon-chip/styles.css +0 -1
- package/dist/components/icon-chip/types.d.ts +0 -92
- package/dist/components/icon-tooltip/IconTooltip.vue.d.ts +0 -16
- package/dist/components/icon-tooltip/index.d.ts +0 -1
- package/dist/components/instrument-chassis/ChassisDivider.vue.d.ts +0 -30
- package/dist/components/metric-badge/MetricBadge.vue.d.ts +0 -40
- package/dist/components/metric-badge/index.d.ts +0 -2
- package/dist/components/metric-cell/MetricCell.vue.d.ts +0 -108
- package/dist/components/metric-cell/index.d.ts +0 -2
- package/dist/components/metric-stack/MetricRow.vue.d.ts +0 -120
- package/dist/components/metric-stack/MetricStack.vue.d.ts +0 -92
- package/dist/components/metric-stack/index.d.ts +0 -4
- package/dist/components/notification/Notification.vue.d.ts +0 -16
- package/dist/components/notification/index.d.ts +0 -1
- package/dist/components/progress/ProgressDefault.vue.d.ts +0 -9
- package/dist/components/progress/ProgressGradient.vue.d.ts +0 -26
- package/dist/components/progress/ProgressLiquid.vue.d.ts +0 -22
- package/dist/components/progress/valueMarks.css +0 -1
- package/dist/components/spa-view/SpaView.vue.d.ts +0 -50
- package/dist/components/spa-view/index.d.ts +0 -2
- package/dist/components/split-chars/SplitChars.vue.d.ts +0 -53
- package/dist/components/split-chars/index.d.ts +0 -1
- package/dist/components/tabs/composables/useEyeglassLive.d.ts +0 -17
- package/dist/components/toggle/Toggle.vue.d.ts +0 -29
- package/dist/components/toggle/index.d.ts +0 -26
- package/dist/composables/glass/webgl/shaders/glass-refract.glsl.d.ts +0 -36
- package/dist/composables/motion/curves.d.ts +0 -48
- package/dist/composables/motion/gooBarbellGeometry.d.ts +0 -79
- package/dist/composables/motion/morphSignatures.d.ts +0 -88
- package/dist/composables/motion/suite.d.ts +0 -2
- package/dist/composables/motion/useBloomUp.d.ts +0 -97
- package/dist/composables/motion/useCharStagger.d.ts +0 -44
- package/dist/composables/motion/useElementMorph.d.ts +0 -107
- package/dist/composables/motion/useGooMorph.d.ts +0 -72
- package/dist/composables/motion/usePrioritizedTask.d.ts +0 -41
- package/dist/composables/motion/useStaggerReveal.d.ts +0 -52
- package/dist/composables/motion/useViewTransition.d.ts +0 -81
- package/dist/composables/virtual/index.d.ts +0 -4
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +0 -72
- package/dist/composables/virtual/useWindowedStore.d.ts +0 -43
- package/dist/composables/virtual/virtualSectionLayout.d.ts +0 -103
- package/dist/controls.d.ts +0 -1
- package/dist/controls.js +0 -83
- package/dist/data-table-DveMdgBM.js +0 -629
- package/dist/dialog-BzQxKrUr.js +0 -281
- package/dist/dockContext-4S9qP0Z4.js +0 -13
- package/dist/dropdown-menu-DORIA52F.js +0 -378
- package/dist/focus-scope-DUTKveod.js +0 -23
- package/dist/focus-scope.d.ts +0 -1
- package/dist/focus-scope.js +0 -2
- package/dist/icon-chip-BWuxz1-u.js +0 -57
- package/dist/icon-chip.d.ts +0 -1
- package/dist/icon-chip.js +0 -2
- package/dist/icon-tooltip-CO6rw0dZ.js +0 -25
- package/dist/icon-tooltip.d.ts +0 -1
- package/dist/icon-tooltip.js +0 -2
- package/dist/instrument-chassis-Cvstg4_U.js +0 -65
- package/dist/label-Cj38tJKG.js +0 -36
- package/dist/menuItemVariants-D6AOzzND.js +0 -36
- package/dist/metric-badge.d.ts +0 -1
- package/dist/metric-badge.js +0 -79
- package/dist/metric-cell.d.ts +0 -1
- package/dist/metric-cell.js +0 -61
- package/dist/metric-stack.d.ts +0 -1
- package/dist/metric-stack.js +0 -113
- package/dist/motion-curves.d.ts +0 -1
- package/dist/motion-curves.js +0 -146
- package/dist/notification-DVs7ODMg.js +0 -52
- package/dist/notification.d.ts +0 -1
- package/dist/notification.js +0 -2
- package/dist/number-field-PvkGedHk.js +0 -140
- package/dist/popover-WMgyRSyN.js +0 -256
- package/dist/progress-C-HHuFZy.js +0 -192
- package/dist/resolveCanvasColor-yarP5bdk.js +0 -93
- package/dist/select-BIv4R3Ir.js +0 -326
- package/dist/separator-CBU94kTM.js +0 -62
- package/dist/slider-Cc_qw6GA.js +0 -166
- package/dist/spa-view.d.ts +0 -1
- package/dist/spa-view.js +0 -46
- package/dist/springPresets-h5VKJQqG.js +0 -58
- package/dist/styles/glass/progress-rail.css +0 -1
- package/dist/switch-Boj4Ucn5.js +0 -49
- package/dist/toast-kAbchIN2.js +0 -281
- package/dist/toggle-group-BPchFsns.js +0 -178
- package/dist/tooltip-BmOQJzh0.js +0 -111
- package/dist/useControlSize-CFfOk8I-.js +0 -9
- package/dist/useDockCtaReceive-CK-RLASa.js +0 -257
- package/dist/useDocumentVisibility-YeBDGqtI.js +0 -17
- package/dist/useDragMorph-7ygF9O0m.js +0 -93
- package/dist/useGooMorph-D1F6QJlH.js +0 -349
- package/dist/useLeadTrail-BYu8dq4G.js +0 -74
- package/dist/useLiquidPress-BYcwwGQV.js +0 -68
- package/dist/useMotionAxis-DCCXMC-i.js +0 -20
- package/dist/usePointerVelocityField-BdvnO0py.js +0 -122
- package/dist/useRAFLoop-BtwQ9DyY.js +0 -109
- package/dist/useRoutePointer-BDNMFN73.js +0 -52
- package/dist/useScrollProgress-DZI4nf4v.js +0 -35
- package/dist/useSelectionGroup-LDzBdR1Y.js +0 -215
- package/dist/useSpringMount-C6-DBx4e.js +0 -71
- package/dist/useSpringPress-BypV_KO-.js +0 -36
- package/dist/useSurfaceAxis-DudiZVOR.js +0 -10
- package/dist/useTabRovingFocus-DkLYwo4L.js +0 -143
- package/dist/vReveal-DZfWl9XI.js +0 -10
- package/dist/vSpecular-CQFmLNzA.js +0 -68
- package/src/fonts/README.md +0 -124
- package/src/fonts/fira-code/OFL.txt +0 -93
- package/src/fonts/fira-code/fira-code-latin-ext.woff2 +0 -0
- package/src/fonts/fira-code/fira-code-latin.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans/OFL.txt +0 -93
- package/src/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-ext.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans/plus-jakarta-sans-latin.woff2 +0 -0
- package/src/styles/accessibility.css +0 -48
- package/src/styles/animations.css +0 -468
- package/src/styles/draw-in.css +0 -89
- package/src/styles/fonts.css +0 -143
- package/src/styles/glass/a11y-fallback.css +0 -188
- package/src/styles/glass/accent-tone.css +0 -66
- package/src/styles/glass/control-surfaces.css +0 -171
- package/src/styles/glass/deep.css +0 -114
- package/src/styles/glass/defined.css +0 -88
- package/src/styles/glass/glass-atom.css +0 -247
- package/src/styles/glass/glass-capsule.css +0 -175
- package/src/styles/glass/glass-chip.css +0 -211
- package/src/styles/glass/grain-overlay.css +0 -79
- package/src/styles/glass/ladder-undershadow.css +0 -61
- package/src/styles/glass/ladder.css +0 -452
- package/src/styles/glass/liquid-enter.css +0 -240
- package/src/styles/glass/liquid-fill.css +0 -65
- package/src/styles/glass/material-roles.css +0 -18
- package/src/styles/glass/material.css +0 -500
- package/src/styles/glass/progress-rail.css +0 -78
- package/src/styles/glass/reveal.css +0 -333
- package/src/styles/glass/rim.css +0 -122
- package/src/styles/glass/squircle.css +0 -58
- package/src/styles/glass/surface-axis.css +0 -136
- package/src/styles/glass/surfaces-pager.css +0 -79
- package/src/styles/glass/surfaces.css +0 -434
- package/src/styles/glass-refract.css +0 -112
- package/src/styles/glass-specular-track.css +0 -74
- package/src/styles/glass.css +0 -110
- package/src/styles/index.css +0 -288
- package/src/styles/paper.css +0 -187
- package/src/styles/scroll-choreography.css +0 -294
- package/src/styles/scroll-chrome.css +0 -123
- package/src/styles/scroll-driven.css +0 -123
- package/src/styles/theme/bridges.css +0 -380
- package/src/styles/theme/dark.css +0 -7
- package/src/styles/theme/literals.css +0 -104
- package/src/styles/theme/radius.css +0 -148
- package/src/styles/theme.css +0 -33
- package/src/styles/tokens/color-radius.css +0 -308
- package/src/styles/tokens/dark-arm-glass.css +0 -55
- package/src/styles/tokens/dark-arm.css +0 -455
- package/src/styles/tokens/glass-deep.css +0 -126
- package/src/styles/tokens/glass-fx.css +0 -480
- package/src/styles/tokens/glass.css +0 -477
- package/src/styles/tokens/light-dark.css +0 -216
- package/src/styles/tokens/motion-registers.css +0 -93
- package/src/styles/tokens/offsets.css +0 -142
- package/src/styles/tokens/on-glass-fg.css +0 -39
- package/src/styles/tokens/property-regs-specular.css +0 -160
- package/src/styles/tokens/property-regs.css +0 -448
- package/src/styles/tokens/scale-paper.css +0 -495
- package/src/styles/tokens/scheme-motion.css +0 -425
- package/src/styles/tokens/scheme-spring.css +0 -282
- package/src/styles/tokens/scroll-tokens.css +0 -137
- package/src/styles/tokens/shadow.css +0 -206
- package/src/styles/tokens/sizing-config.css +0 -110
- package/src/styles/tokens/sizing.css +0 -505
- package/src/styles/tokens.css +0 -68
- package/src/styles/tokens.ts +0 -58
- package/src/styles/transitions.css +0 -228
- package/src/styles/typography/scale.css +0 -166
- package/src/styles/typography/semantic.css +0 -233
- package/src/styles/typography/utilities.css +0 -197
- package/src/styles/typography.css +0 -46
- package/src/styles/utilities/a11y-overrides.css +0 -184
- package/src/styles/utilities/base-misc.css +0 -307
- package/src/styles/utilities/base.css +0 -337
- package/src/styles/utilities/btn.css +0 -306
- package/src/styles/utilities/components.css +0 -337
- package/src/styles/utilities/metal.css +0 -272
- package/src/styles/utilities.css +0 -24
- package/src/styles/view-transition.css +0 -67
- package/src/styles/viz-reveal.css +0 -63
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-B3ysoDQm.js} +0 -0
- /package/dist/{compile-DK3Fri1B.js → compile-D7VYG3gi.js} +0 -0
- /package/dist/composables/glass/{webgl/shaders/procedural-color.glsl.d.ts → procedural/color.glsl.d.ts} +0 -0
- /package/dist/{components/aurora/constants/shaders/procedural-color.wgsl.d.ts → composables/glass/procedural/color.wgsl.d.ts} +0 -0
- /package/dist/composables/motion/{motionTempo.d.ts → core/motionTempo.d.ts} +0 -0
- /package/dist/composables/motion/{useIntersectionPause.d.ts → core/useIntersectionPause.d.ts} +0 -0
- /package/dist/composables/motion/{useRAFLoop.d.ts → core/useRAFLoop.d.ts} +0 -0
- /package/dist/composables/motion/{useYieldToMain.d.ts → core/useYieldToMain.d.ts} +0 -0
- /package/dist/composables/motion/{useAnimatedNumber.d.ts → number/useAnimatedNumber.d.ts} +0 -0
- /package/dist/composables/motion/{useAnimatedNumberMap.d.ts → number/useAnimatedNumberMap.d.ts} +0 -0
- /package/dist/composables/motion/{useCountup.d.ts → number/useCountup.d.ts} +0 -0
- /package/dist/composables/motion/{useRoutePointer.d.ts → pointer/useRoutePointer.d.ts} +0 -0
- /package/dist/composables/motion/{useTextHighlight.d.ts → reveal/useTextHighlight.d.ts} +0 -0
- /package/dist/composables/motion/{vReveal.d.ts → reveal/vReveal.d.ts} +0 -0
- /package/dist/composables/motion/{scrollReader.d.ts → scroll/scrollReader.d.ts} +0 -0
- /package/dist/composables/motion/{supportsCssTimeline.d.ts → scroll/supportsCssTimeline.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollPin.d.ts → scroll/useScrollPin.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollScene.d.ts → scroll/useScrollScene.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollTrigger.d.ts → scroll/useScrollTrigger.d.ts} +0 -0
- /package/dist/composables/motion/{useSpringPress.d.ts → spring/useSpringPress.d.ts} +0 -0
- /package/dist/{createContext-FU0n5MGK.js → createContext-BhkE9mLH.js} +0 -0
- /package/dist/{dark-DIH-blY1.js → dark-z_P5QwqI.js} +0 -0
- /package/dist/{motionTempo-CMS5b0Vu.js → motionTempo-tscp92Nm.js} +0 -0
- /package/dist/{prng-Dz2_9RJu.js → prng-2uS6J_A1.js} +0 -0
- /package/dist/{rendererStatus-C2-zC2Q-.js → rendererStatus-BxUlBLVy.js} +0 -0
- /package/dist/{useDragVelocity-CbMZEBaC.js → useDragVelocity-6ONX0sr0.js} +0 -0
- /package/dist/{useFuzzySearch-BOgep7RE.js → useFuzzySearch-CUnZknpm.js} +0 -0
- /package/dist/{useResizeObserver-BcUTquV7.js → useResizeObserver-CdUlm2QZ.js} +0 -0
- /package/dist/{useResolveTokenColor-C07e-qaT.js → useResolveTokenColor-B2FfJnd9.js} +0 -0
- /package/dist/{useTimer-D8koDvJS.js → useTimer-C3yfti4C.js} +0 -0
- /package/dist/{useUserInvalidAria-Cr4nR3tu.js → useUserInvalidAria-0GNrddMX.js} +0 -0
- /package/dist/{valueDomain-B8L04u3U.js → valueDomain-SbVzoHMH.js} +0 -0
- /package/dist/{writeVelocityWeight-D_AcvTsE.js → writeVelocityWeight-DoGOCW3e.js} +0 -0
package/dist/aurora.js
CHANGED
|
@@ -1,23 +1,131 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-
|
|
2
|
-
import { t } from "./usePointerVelocityField-
|
|
3
|
-
import { d as n, s as r } from "./pointerFieldMappings-
|
|
4
|
-
import { t as i } from "./useScrollProgress-
|
|
5
|
-
import { t as a } from "./useIntersectionPause-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import { a as
|
|
10
|
-
import { n as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
+
import { t } from "./usePointerVelocityField-DsIf7yyq.js";
|
|
3
|
+
import { d as n, s as r } from "./pointerFieldMappings-DP5tla5z.js";
|
|
4
|
+
import { t as i } from "./useScrollProgress-CSFYXIZT.js";
|
|
5
|
+
import { t as a } from "./useIntersectionPause-B5mAU6XY.js";
|
|
6
|
+
import { t as o } from "./value-DMhh2R94.js";
|
|
7
|
+
import { cssToOklch as s, deriveHue as c, gamutMapStop as l, oklchStopToHex as u, oklchToLinear as d, warmCatchLight as f } from "./color.js";
|
|
8
|
+
import { a as p, c as m, d as h, f as g, i as _, l as v, n as y, o as b, p as x, r as S, s as C, t as w, u as ee } from "./color.wgsl-Ct5o9dpf.js";
|
|
9
|
+
import { a as T, n as E, o as te } from "./rendererStatus-BxUlBLVy.js";
|
|
10
|
+
import { n as ne, t as D } from "./compile-D7VYG3gi.js";
|
|
11
|
+
import { n as re, t as ie } from "./flow.wgsl-Cd2GUkPx.js";
|
|
12
|
+
import { computed as O, createElementBlock as ae, createElementVNode as k, defineComponent as oe, getCurrentInstance as se, normalizeClass as ce, normalizeStyle as le, onBeforeUnmount as ue, onMounted as de, openBlock as fe, readonly as pe, ref as me, shallowRef as he, unref as A, watch as j } from "vue";
|
|
13
|
+
import { interpolateHue as ge } from "@mkbabb/value.js/color";
|
|
14
|
+
//#region src/composables/glass/textureUpload.ts
|
|
15
|
+
var _e = {
|
|
16
|
+
premultiplyAlpha: "none",
|
|
17
|
+
colorSpaceConversion: "none"
|
|
18
|
+
};
|
|
19
|
+
function M(e) {
|
|
20
|
+
return createImageBitmap(e, _e);
|
|
21
|
+
}
|
|
22
|
+
async function ve(e) {
|
|
23
|
+
return typeof e == "string" ? M(await (await fetch(e)).blob()) : e instanceof Blob ? M(e) : e;
|
|
24
|
+
}
|
|
25
|
+
function N() {
|
|
26
|
+
let e = new ImageData(1, 1);
|
|
27
|
+
return e.data.set([
|
|
28
|
+
128,
|
|
29
|
+
128,
|
|
30
|
+
128,
|
|
31
|
+
255
|
|
32
|
+
]), e;
|
|
33
|
+
}
|
|
34
|
+
function ye(e) {
|
|
35
|
+
return e instanceof HTMLImageElement ? {
|
|
36
|
+
width: e.naturalWidth,
|
|
37
|
+
height: e.naturalHeight
|
|
38
|
+
} : {
|
|
39
|
+
width: e.width,
|
|
40
|
+
height: e.height
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function be(e, t, n = {}) {
|
|
44
|
+
let { linearFilter: r = !0, clampToEdge: i = !0 } = n, a = e.createTexture();
|
|
45
|
+
e.bindTexture(e.TEXTURE_2D, a), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.NONE), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t);
|
|
46
|
+
let o = r ? e.LINEAR : e.NEAREST;
|
|
47
|
+
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, o), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, o);
|
|
48
|
+
let s = i ? e.CLAMP_TO_EDGE : e.REPEAT;
|
|
49
|
+
return e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, s), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, s), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), a;
|
|
50
|
+
}
|
|
51
|
+
function P(e, t) {
|
|
52
|
+
let { width: n, height: r } = ye(t), i = e.createTexture({
|
|
53
|
+
label: "[texture-upload] image",
|
|
54
|
+
size: [
|
|
55
|
+
n,
|
|
56
|
+
r,
|
|
57
|
+
1
|
|
58
|
+
],
|
|
59
|
+
format: "rgba8unorm",
|
|
60
|
+
usage: 22
|
|
61
|
+
});
|
|
62
|
+
return e.queue.copyExternalImageToTexture({
|
|
63
|
+
source: t,
|
|
64
|
+
flipY: !1
|
|
65
|
+
}, {
|
|
66
|
+
texture: i,
|
|
67
|
+
premultipliedAlpha: !1
|
|
68
|
+
}, [
|
|
69
|
+
n,
|
|
70
|
+
r,
|
|
71
|
+
1
|
|
72
|
+
]), {
|
|
73
|
+
texture: i,
|
|
74
|
+
width: n,
|
|
75
|
+
height: r
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/components/aurora/composables/auroraImageSource.ts
|
|
80
|
+
function xe(e) {
|
|
81
|
+
let t = null, n = null, r;
|
|
82
|
+
return {
|
|
83
|
+
getDecodedImage: () => t,
|
|
84
|
+
setImageUploader(e) {
|
|
85
|
+
n = e, e && t && e(t);
|
|
86
|
+
},
|
|
87
|
+
ensureDecoded(i) {
|
|
88
|
+
i.source !== "image" || i.src == null || i.src !== r && (r = i.src, ve(i.src).then((r) => {
|
|
89
|
+
t = r, n?.(r), e.wake();
|
|
90
|
+
}).catch((t) => {
|
|
91
|
+
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function Se(e, t, n) {
|
|
97
|
+
let r = null;
|
|
98
|
+
e.activeTexture(e.TEXTURE0);
|
|
99
|
+
let i = (n) => {
|
|
100
|
+
e.useProgram(t), e.activeTexture(e.TEXTURE0), r && e.deleteTexture(r), r = be(e, n);
|
|
101
|
+
};
|
|
102
|
+
return i(n.getDecodedImage() ?? N()), n.setImageUploader(i), () => {
|
|
103
|
+
r && e.deleteTexture(r), n.setImageUploader(null);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/components/aurora/constants/renderMode.ts
|
|
108
|
+
function F() {
|
|
109
|
+
let e;
|
|
110
|
+
try {
|
|
111
|
+
e = h();
|
|
112
|
+
} catch {
|
|
113
|
+
return !1;
|
|
114
|
+
}
|
|
115
|
+
return e === null ? !1 : e.includes("swiftshader") || e.includes("llvmpipe") || e.includes("software") || e.includes("basic render") || e.includes("microsoft basic");
|
|
116
|
+
}
|
|
117
|
+
function I(e, t = {}) {
|
|
118
|
+
return e !== "css" && !t.forceWebGLUnderSoftwareRaster && F() ? "css" : e === "auto" ? "webgl" : e;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
13
121
|
//#region src/components/aurora/constants/shaders/aurora.vert.ts
|
|
14
|
-
var xe = "#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main() {\n vUv = aPos * 0.5 + 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n}", Se = "// ── Palette LUT (W5 — OKLCh/OKLab interpolation) ──────────────────────────────\n// The endpoints stay CPU-baked to LINEAR sRGB (the Aras precompute pattern); only\n// the BETWEEN-endpoint interpolation runs in perceptual space. AX.W11 — the ramp\n// itself (the smoothstep ease + the OKLab-rectangular-vs-OKLCh-hue-arc dispatch on\n// uHuePath) is the shared samplePaletteRamp from procedural-color.glsl, the SAME\n// source the WebGPU twin splices; samplePalette here only selects the bracketing\n// stop pair + the raw inter-stop t and hands them to the shared ramp.\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n return samplePaletteRamp(uPalette[i0], uPalette[i1], t, uHuePath);\n}\n\n// ── Nuclei field ──────────────────────────────────────────────────────────\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift — slow global paletteId breathe between adjacent stops. The\n // rate rides K_PAL (perceptible ~30–60s hue cycle at the default coefficient);\n // the amplitude lifts the authored coefficient into a 0.03..0.06 paletteId band\n // so the palette visibly travels rather than dithering within one stop.\n float palAmp = clamp(uPaletteDrift * 6.0, 0.0, 0.06);\n paletteId += palAmp * sin(t * uPaletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n", Ce = "// ── Flow field ────────────────────────────────────────────────────────────\n// Structure-tensor prototype (body defined post-sampleBase in the mediums block).\n// Returns vec4(dir.x, dir.y, coherence, packedGrad) — the minor-eigenvector tangent + A + the\n// metal-gradient .w lane (BG.W-AUR-METAL-FINISH widened vec3→vec4). The forward decl MUST match\n// the vec4 definition or WebKit's compiler rejects the mismatched signature (L1b).\nvec4 structureTensorField(vec2 p, float t, vec2 fallbackDir);\n\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl — tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi — curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 5) {\n // tensor / ETF — the color field's OWN edge-tangent flow (AW.W4.1). The\n // diagonal angle seeds the smooth fallback the coherence-weighted blend\n // relaxes toward in low-structure zones. Returns directly (no curl/cursor\n // post-mix — the tensor field already carries the structure orientation;\n // the cursor warp still drives the underlying color field in domainWarp).\n float a = radians(uFlowAngle);\n vec2 fallback = vec2(cos(a), sin(a));\n return structureTensorField(p, t, fallback).xy;\n }\n // curl — perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence — swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n // AW.W8.1 — velocity-reactive swirl-BURST: a fast flick (uCursorBurst, decaying\n // over ~1s) injects a transient flow bias along the pointer velocity, distinct from\n // the steady attraction above (the stateless swirl is SUPERSEDED by this form). The\n // burst is gated by the master tempo scalar on the CPU side (it decays to 0 under\n // PRM/pause), so this term cannot leak motion under reduced-motion.\n if (uCursorBurst > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.7));\n // Bias the flow toward the velocity direction, scaled by the decaying burst.\n vec2 velDir = uCursorVelocity / max(length(uCursorVelocity), 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(velDir.y, velDir.x);\n float da = atan(sin(a1 - a0), cos(a1 - a0));\n float a = a0 + da * w * uCursorBurst * 0.8;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n", we = "// Khronos PBR-Neutral tonemap (hue + saturation preserving)\nvec3 aces(vec3 color) {\n const float startCompression = 0.8 - 0.04;\n const float desaturation = 0.15;\n float x = min(color.r, min(color.g, color.b));\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max(color.r, max(color.g, color.b));\n if (peak < startCompression) return clamp(color, 0.0, 1.0);\n float d = 1.0 - startCompression;\n float newPeak = 1.0 - d * d / (peak + d - startCompression);\n color *= newPeak / peak;\n float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);\n return clamp(mix(color, newPeak * vec3(1.0), g), 0.0, 1.0);\n}\n", Te = "// ── Curved swept brushstroke primitive ────────────────────────────────────\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4·K·along0·(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint — so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered — thin-fat-thin (classic brush)\n// 1 load-drag — fat start, tapers to a point\n// 2 dab — ellipse-like, round center\n// 3 even — near-constant, slight end taper\n// 4 comma — van-Gogh atomic dab: ASYMMETRIC taper, fat near one end and\n// drawn to a fine point at the other (the divisionist crescent\n// mark). The width peak sits off-centre (~0.32) so the two ends\n// taper at DIFFERENT rates — a loaded round head + a dragged tail.\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n } else if (type == 4) {\n // comma / crescent — width peaks at ~0.32 then drags to a fine tail. The two\n // sides of the peak fall at different exponents (a fat round head, a long thin\n // tail), so the mark reads as a directional van-Gogh comma, not a symmetric oval.\n float peak = 0.32;\n float head = smoothstep(0.0, peak, t); // rounded loaded head\n float tail = pow(clamp((1.0 - t) / (1.0 - peak), 0.0, 1.0), 1.6); // dragged thin tail\n return clamp(min(head, tail) * 1.04, 0.0, 1.0);\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b — endpoints\n// halfW — base half-width (world units)\n// bulge — signed perpendicular midpoint offset, in world units\n// shapeType — 0..3\n// bristleFreq — spatial frequency of edge raggedness\n// bristleAmp — 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed — uniqueness seed for internal streaks\n// colAtMid — pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // fwidth-derived AA: half-width from the field's screen-space gradient so the\n // edge holds ~1px regardless of zoom/DPR (mirrors metaball.frag.ts:252-255).\n float aaC = max(fwidth(cn), 1e-6);\n cov = 1.0 - smoothstep(1.0 - aaC, 1.0 + aaC, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n // fwidth-derived AA on the clean Euclidean cap distances (mirrors metaball.frag.ts:252-255).\n float aaA = max(fwidth(dA), 1e-6);\n float aaB = max(fwidth(dB), 1e-6);\n capA = 1.0 - smoothstep(rA - aaA, rA + aaA, dA);\n capB = 1.0 - smoothstep(rB - aaB, rB + aaB, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// The painterly STROKE mediums (those that deposit via paintStrokeLayers/paintOver):\n// oil (3), van-Gogh (5), oil-pastel (6). For these the stroke OVER-composite runs in\n// OKLab so overlapping complementaries mix through a chromatic path, not the linear-\n// RGB grey mud; the smooth/atmospheric pole never reaches paintOver so it pays nothing.\nbool isPainterlyStroke() {\n return uMedium == 3 || uMedium == 5 || uMedium == 6;\n}\n\n// OKLab OVER-composite: lerp L,a,b of the over-color toward the under-color (the\n// Ottosson matrices spliced from procedural-color.glsl.ts — no new color math). Two\n// complementary-hued strokes overlapping transition through OKLab, where the midpoint\n// holds chroma, instead of the linear mix() that desaturates toward grey (slice 8 F2).\nvec3 paintOverOklab(vec3 under, vec3 over, float alpha) {\n vec3 labU = linOklab(under);\n vec3 labO = linOklab(over);\n return max(oklabToLinearSrgb(mix(labU, labO, alpha)), vec3(0.0));\n}\n\n// Composite stroke over col with internal streaking + ACCUMULATE paint HEIGHT.\n// streakAmp — 0..0.2 how much internal streaks darken/lighten\n// impastoAmp — 0..1 paint-thickness contribution (the height the relight reads)\n// hardness — 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\n//\n// AW.W4.2 — the fixed-RGB edge rim (the phantom upper-left light) is RETIRED. Each\n// stroke now deposits PAINT HEIGHT into the height accumulator (coverage x per-stroke\n// thickness, perturbed by the bristle/streak fbm for ridges/grooves); mediumOil\n// derives a normal from the accumulated height gradient (dFdx/dFdy) and relights it\n// once with the movable uLightDir source (relightImpasto), in linear before aces().\n//\n// AX.W13 — the internal streak now perturbs HUE + CHROMA in OKLCh (not value-only),\n// so a single stroke carries a small hue gradient (broken color at the ATOM level —\n// adjacent strokes shimmer like real impasto, not flat stamped swatches; slice 8 F5);\n// and the OVER-composite runs in OKLab on the painterly stroke mediums so overlapping\n// complementaries mix as pigment, not the linear-mix grey (slice 8 F2).\n// impastoFloor — the per-stroke height-crown floor: oil's 0.4+0.6*edgeN reads\n// floor=0.4 (the crown tapers to 40% at the stroke edge); the van-Gogh\n// profile passes floor=1.0 so each atomic dab catches a FULL-height\n// glint (scope item 1d). The crown magnitude is floor + (1-floor)*edgeN.\nvoid paintOver(inout vec3 col, inout float height, StrokeHit s,\n float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed,\n float impastoFloor) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks — fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n\n // ── WITHIN-stroke OKLCh broken color (AX.W13, slice 8 F5). The streak fBm perturbs\n // the stroke's HUE + CHROMA along alongT/crossN, seeded per-stroke, so a single\n // stroke reads a small hue gradient (the atom-level broken-color shimmer). Value is\n // carried by the same streak so the loaded-brush light/dark survives. Gated to the\n // painterly stroke mediums + uBrokenColor (the smooth pole keeps the cheap value-only\n // streak). A second decorrelated fBm drives the hue axis so hue ≠ a scaled value.\n float hueStreak = fbm(vec2(s.alongT * streakFreq * 0.45 + streakSeed * 5.3,\n s.crossN * 1.9 + streakSeed * 1.7)) - 0.5;\n if (isPainterlyStroke() && uBrokenColor > 0.001) {\n vec3 lch = oklabToOklch(linOklab(c));\n // ±~10° within-stroke hue swing + ±~9% chroma, scaled by uBrokenColor. Smaller\n // than the per-stroke cell jitter (brokenColorJitter) — this is the intra-stroke\n // gradient layered on top of the per-cell pigment patch.\n lch.z += hueStreak * (20.0 * PI / 180.0) * uBrokenColor;\n lch.y = max(lch.y * (1.0 + (streak) * 0.18 * uBrokenColor), 0.0);\n c = max(oklabToLinearSrgb(oklchToOklab(lch)), vec3(0.0));\n }\n // Value streak (the loaded-brush light/dark across the bristles) — kept for every\n // medium that reaches paintOver (the smooth pole never does). The along-spine value\n // modulation is the loaded-brush light/dark that gives each stroke its OWN directional\n // luminance band — the structure-tensor signal a low-contrast color field (a uniform-hue\n // oil field) has no other source for (the §4.2 anisotropy lift on the flat-palette case).\n c *= 1.0 + streak * streakAmp * 3.2;\n\n // Cross-stroke ridge/valley shading — a catch-light along the spine centre, darkening to\n // the stroke edges. This is the strongest DIRECTIONAL luminance cue: it carves a bright\n // ridge down the stroke's length and dark grooves between adjacent strokes, so a field of\n // parallel strokes reads as parallel light/dark bands (the high-A van-Gogh signature) even\n // where the underlying colour is flat. s.edgeN is 0 at the edge, 1 at the spine.\n float ridgeShade = smoothstep(0.0, 0.55, s.edgeN);\n c *= 1.0 + (ridgeShade - 0.5) * 0.30;\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n // OKLab OVER-composite on the painterly stroke mediums (overlap mixes as pigment,\n // not grey); the smooth pole never reaches paintOver, so it keeps the cheap path.\n col = isPainterlyStroke() ? paintOverOklab(col, c, alpha) : mix(col, c, alpha);\n\n // ── Accumulate paint HEIGHT (AW.W4.2). Thickness peaks at the stroke spine and\n // falls toward the impastoFloor at the edge (edgeN: 0=edge, 1=spine), perturbed by\n // the bristle streak so ridges/grooves form. The relight reads the gradient of this\n // field. The van-Gogh profile's floor=1.0 gives every atomic dab a full-height crown.\n float ridge = 0.7 + 0.3 * (streak + 0.5);\n float crown = impastoFloor + (1.0 - impastoFloor) * s.edgeN;\n height += s.coverage * impastoAmp * crown * ridge * alpha;\n}\n\n// AW.W4.2 — relight the accumulated paint height. Derive a normal from the height\n// gradient (dFdx/dFdy — derivatives are in-pattern; fwidth is already used for AA),\n// then apply diffuse + Blinn specular from the movable uLightDir/uLightColor source.\n// LINEAR-space lighting BEFORE aces() (the tonemap/OETF stay locked); thin strokes\n// inherit a low shininess, thick impasto raises it (high-height ridges catch a sharp\n// glint). canvasBase is the tooth height so the canvas weave also catches the light.\nvec3 relightImpasto(vec3 col, float height, float canvasBase) {\n float h = height + canvasBase;\n // Height-gradient normal. heightScale trades relief depth for surface flatness.\n float heightScale = 6.0;\n vec3 N = normalize(vec3(-dFdx(h) * 40.0, -dFdy(h) * 40.0, 1.0 / heightScale));\n vec3 L = normalize(uLightDir);\n vec3 V = vec3(0.0, 0.0, 1.0); // view straight on\n vec3 H = normalize(L + V);\n float diff = max(dot(N, L), 0.0);\n // Thick impasto → high shininess (sharp glint); thin paint → broad soft sheen.\n float shininess = mix(8.0, 64.0, clamp(height * 2.0, 0.0, 1.0));\n float spec = pow(max(dot(N, H), 0.0), shininess);\n // Modulate the lit terms by how much paint sits here (no relief on bare ground).\n float relief = clamp(h * 1.5, 0.0, 1.0);\n vec3 lit = col * (1.0 + uImpasto * relief * (diff - 0.5) * 0.5 * uLightColor);\n // The specular glint is gated to ACCUMULATED-thick paint (height²) — a per-fine-stroke\n // sharp glint on every thin fill dab read as bright isotropic SPECKLE that buried the\n // directional stroke bands (the §4.2 anisotropy / §4.3 slope sink on the low-contrast\n // oil field). Only where real impasto has built up does the raked glint fire, so the\n // highlight tracks the macro ridges, not the fine speckle.\n float specGate = clamp(height, 0.0, 1.0);\n lit += uImpasto * relief * spec * specGate * 0.5 * uLightColor;\n return lit;\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\n// energyGrade — the SBR energy-grade magnitude (0 = none, the oil/oil-pastel\n// baseline; 1 = the full van-Gogh Starry-Night cascade — long\n// confident strokes in the lights/coherent zones, short dabs in\n// the darks/flat zones). The van-Gogh profile carries 1.0 (the\n// energy grade is a PROFILE field, not a buried uMedium==5 branch).\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed,\n float energyGrade) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate — noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction source — the AW.W4.1 strokeOrient switch:\n // uStrokeOrient==0 (flow) — the layer-provided hand-authored flowField.\n // uStrokeOrient==1 (tensor) — the structure-tensor minor eigenvector at the\n // cell center (the color field's edge-tangent),\n // so strokes hug the color zones (van Gogh).\n // coh carries the per-cell coherence A for the W4.3 energy grading (long\n // confident strokes where structure is coherent, stubby dabs in flat zones).\n vec2 f;\n float coh = 1.0;\n if (uStrokeOrient == 1) {\n // vec4 (the metal-finish widen) — .xy tangent + .z coherence; the .w gradient lane\n // is unused here. A vec3 local would be a type-mismatch WebKit rejects (L1c).\n vec4 tf = structureTensorField(center, t, safeDir(flow));\n f = safeDir(tf.xy);\n coh = tf.z;\n } else {\n f = safeDir(flow);\n }\n // Per-stroke deterministic local perturbation so alternate stroke layers stay\n // live. Tensor strokes get FAR less angular jitter (the field already orients them\n // — over-jittering the tensor strokes scatters their directions and the rendered\n // field reads isotropic, the §4.2 anisotropy floor). The flow-oriented (non-tensor)\n // strokes keep the full jitter (they have no per-cell orientation source).\n float jScale = (uStrokeOrient == 1) ? 0.15 : 1.0;\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9 * jScale; // +/- 0.45/0.07 rad\n float curlScale = (uStrokeOrient == 1) ? 0.30 : 1.0;\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl * curlScale;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n // AX.W13 — the SBR energy grade is a PROFILE field (energyGrade), not a buried\n // uMedium==5 branch. The van-Gogh profile passes energyGrade=1.0 (the full\n // Starry-Night cascade); oil/oil-pastel pass 0.0 (uniform length). The grade\n // modulates stroke length by local luminance (bright → long confident strokes,\n // dark → short dabs, the Kolmogorov/Batchelor congruence) AND by coherence\n // (coherent zones → long, flat → stubby), lerped in by energyGrade so a profile\n // can dial the cascade from off (0) to full (1).\n float energy = 1.0;\n if (energyGrade > 0.001) {\n float luma = clamp(dot(sampleBase(center, t), W_LUMA), 0.0, 1.0);\n float graded = mix(0.5, 1.5, luma) * mix(0.6, 1.0, coh);\n energy = mix(1.0, graded, energyGrade);\n }\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0)) * energy;\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n", Ee = "// ── Van-Gogh — DEDICATED atomic-dab body (W-AUR-VANGOGH-REBUILD) ─────────────\n// REBUILT FROM FIRST PRINCIPLES. The prior path routed van-Gogh through the shared\n// oil paintStrokeMedium cascade — four DENSE layers of LONG-THIN tensor-oriented\n// strokes (lenMul up to 5.2, widMul 0.22) hugging a continuous coherent field. Packed\n// that tight, thin strokes that follow continuous iso-bands MERGE into smooth flowing\n// filaments — the \"marbled flow-bands\" read (a spirograph/fingerprint, not impasto),\n// AND the per-cell 8-tap structure tensor × 4 layers × 9 cells = ~324 sampleBase/pixel\n// made it run at ~4fps. Van Gogh's sky is NOT continuous flow — it is DISCRETE, SHORT,\n// LOADED comma dabs, separated by visible ground, queued into swirl ROWS.\n//\n// The rebuild is a purpose-built two-layer DAB pass, disjoint from the oil cascade:\n// • orientation from the analytic SWIRL flowField (van-Gogh skies ARE swirl rows) +\n// per-cell angular jitter — NOT the expensive per-cell tensor (the lag source, and\n// the marble source: a jittered discrete dab can NOT merge into a continuous\n// filament the way a tensor-locked thin stroke does).\n// • SHORT comma dabs (len/wid ≈ 2.6 : 1 — a loaded crescent mark, not a 10:1\n// filament), so each reads as a SEPARABLE atom.\n// • SPARSE placement with visible inter-dab ground (density ≈ 0.42), over a darkened\n// swirl underpainting (the Starry-Night visible ground the bright dabs read over).\n// • a single sampleBase per cell + OKLCh broken-color jitter (pigment shimmer);\n// full-height impasto crown per dab (each catches its own raked glint).\n// This is ~2 layers × 9 cells × ~1 sampleBase ≈ 20/pixel (a ~16× cost cut, ~60fps), and\n// jittered short dabs CANNOT marble.\n\n// One atomic comma dab — a CLEAN analytic crescent SDF (NOT the oil curvedStroke).\n// The oil curvedStroke's spine-projection + rounded end-caps + fwidth-AA + bristle\n// edge each leave a thin sub-pixel skirt, and a field of those skirts over open ground\n// abuts into a faint network of SEAM LINES. A van-Gogh dab needs none of that\n// machinery — it is a short oriented capsule (rounded line segment) whose half-width\n// tapers along its length (the loaded-head → dragged-tail comma). The capsule SDF is\n// derivative-free (smoothstep AA against the analytic distance), so no fwidth skirt, no\n// best-of-9 seam. Returns a StrokeHit (coverage/color/alongT/edgeN) for paintOver.\n// cellSize — dab cell pitch (UV units); lenMul/widMul — dab aspect off the cell;\n// density — placement gate (sparse → visible gaps); seed — layer decorrelation.\nStrokeHit vangoghDab(vec2 p, float cellSize, float lenMul, float widMul,\n float density, float jitterAmt, float angJitter,\n vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n StrokeHit best = noHit();\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n // Sparse density gate — leaves visible canvas ground between dabs (atomicity).\n if (hash21(cc * 1.7 + seed * 0.3) > density) continue;\n vec2 jit = (hash22(cc + seed) - 0.5) * jitterAmt;\n vec2 center = (cc + 0.5 + jit) * cellSize;\n\n // Orientation: the analytic swirl flow at the cell center + per-cell angular\n // jitter (so adjacent dabs FAN — the divisionist scatter that keeps the dabs from\n // locking into perfectly-concentric rows) + a flow-noise curl wobble.\n float ang = (hash21(cc + seed + 11.0) - 0.5) * angJitter;\n float curl = (fbm(center * 3.1 + seed * 1.9) - 0.5) * (0.18 + 0.3 * uFlowCurl);\n vec2 dir = rotateDir(safeDir(flow), ang + curl);\n\n // SHORT comma — len ≈ the cell pitch (a contained dab, not a tiling filament).\n float len = cellSize * lenMul * (0.82 + 0.30 * hash21(cc + seed + 23.0));\n float halfW = max(cellSize * widMul * (0.86 + 0.28 * hash21(cc + seed + 41.0)), 0.010);\n\n // Local dab frame: along = projection onto the dab axis (centred 0), perp = cross.\n vec2 rel = p - center;\n float along = dot(rel, dir);\n float perp = dot(rel, vec2(-dir.y, dir.x));\n // The comma TAPER: half-width peaks ~1/3 from the loaded head and drags to a fine\n // tail (the asymmetric crescent). u in [0,1] along the dab from head to tail.\n float halfLen = len * 0.5;\n float u = clamp((along + halfLen) / max(len, 1e-5), 0.0, 1.0);\n float head = smoothstep(0.0, 0.30, u); // rounded loaded head\n float tail = pow(clamp((1.0 - u) / 0.70, 0.0, 1.0), 1.3); // dragged thin tail\n float prof = clamp(min(head, tail) * 1.05, 0.0, 1.0);\n float wNow = halfW * prof;\n // A gentle comma CURVE — bow the spine sideways so the mark reads as a crescent.\n float bowAmt = (hash21(cc + seed + 53.0) - 0.5) * halfW * 1.4;\n float spine = bowAmt * sin(u * PI); // 0 at ends, max mid\n float d = abs(perp - spine);\n // Derivative-free AA: a fixed fraction of the dab width (no fwidth skirt). Coverage\n // is 1 in the dab body, smoothly 0 at the edge; outside the [head,tail] span wNow→0\n // so the dab self-terminates with no end-cap blob.\n float aa = max(halfW * 0.45, 0.002);\n float cov = (wNow > 1e-5) ? (1.0 - smoothstep(wNow - aa, wNow + aa, d)) : 0.0;\n if (cov < 0.004) continue;\n\n // One sampleBase per cell + OKLCh broken-color jitter (pigment patch shimmer). The\n // dab pigment is chroma-boosted (saturate3 1.22) AND value-lifted (×1.14) at the\n // SOURCE — the loaded brush mark deposits BRIGHTER + more saturated pigment than the\n // base field, so the loaded-mark pixels lift BOTH the §4.1 colourfulness AND the field\n // mean-luma. The higher mean raises the gap-fraction threshold (meanLum·0.6) so the\n // moderate-depth inter-dab ground falls below it (the gap-fraction atomicity read is\n // DECOUPLED from the ground floor depth — the ground can stay only moderately dark, so\n // the §4.3 slope is NOT over-steepened, while the bright dabs manufacture the gap). The\n // dark ground is untouched, so this lifts C + gap WITHOUT a band-conflicting deep ground.\n vec3 colMid = brokenColorJitter(\n saturate3(sampleBase(center, t), 1.22),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n // edgeN: 1 at the spine, 0 at the edge (the impasto crown reads it).\n float edgeN = (wNow > 1e-5) ? clamp(1.0 - d / wNow, 0.0, 1.0) : 0.0;\n if (cov > best.coverage) {\n best = StrokeHit(cov, colMid, u, (wNow > 1e-5 ? (perp - spine) / wNow : 0.0), edgeN);\n }\n }\n }\n return best;\n}\n\nvec3 mediumVangogh(vec3 col, vec2 p, float t) {\n vec3 result = col;\n float height = 0.0;\n\n // The swirl flow basis (van-Gogh sky = swirl rows). Computed ONCE per pixel.\n vec2 flow = flowField(p, t);\n\n // Dab cell pitch in UV [0,1]. CHUNKY, SEPARABLE marks — the big layer is ~1/14 of\n // the frame so it reads as a distinct loaded brush dab (not a fine speckle, not a\n // screen-spanning filament). uStrokeScale (authored ~110) modulates the pitch\n // INVERSELY (higher = finer dabs) around the ~0.07 chunky default; clamped so the\n // dab never collapses to noise or balloons past one screen. uStrokeAnisotropy\n // stretches the comma aspect (longer, more directional marks).\n float pitch = clamp(7.0 / max(uStrokeScale, 20.0), 0.044, 0.12);\n // The dab LENGTH ≈ the cell pitch (lenAniso ~1.2-1.7) so a dab sits WITHIN its cell\n // and leaves visible ground around it — a longer dab (lenMul > 2) spans neighbour\n // cells and tiles the field into continuous coverage (no gaps, the gap-fraction floor\n // miss + the marble). Narrow width keeps it a directional crescent, not a wide shard.\n // lenAniso/widAniso — the comma aspect. The W-AUR-VANGOGH-CONFIG reconcile lengthened\n // the comma (1.25-1.75 → 1.5-2.0) and THINNED it (0.40-0.30 → 0.32-0.24): the rebuilt\n // dabs measured §4.2 structure-tensor anisotropy A=0.699, BELOW the reference band\n // floor 0.732 (the dabs read slightly too short-fat → locally isotropic, dragging mean\n // A down). A LONGER, THINNER comma hugs the swirl-flow tangent more strongly so the\n // rendered field reads coherent the way the tensor metric measures it (A lift), while\n // the thinner width LEAVES MORE inter-dab ground (the gap-fraction atomicity read is\n // preserved, not closed). The length stays ≈ the cell pitch so each dab remains a\n // CONTAINED separable mark, not a tiling filament.\n float lenAniso = mix(2.1, 2.7, uStrokeAnisotropy); // comma length / cell pitch (a contained dab)\n float widAniso = mix(0.23, 0.16, uStrokeAnisotropy); // comma width / cell pitch (a thin loaded crescent)\n\n // Layer 1 — the big swirl-row dabs: the loaded gestural marks, SPARSE so the dark\n // underpainting shows BETWEEN them (the atomicity read — visible inter-dab ground).\n // hardness 0.74 — the loaded brush deposits with a SOFT shoulder, so adjacent dabs\n // feather instead of razor-clipping into hard polygon shards. jitterAmt 0.85 fully\n // scatters the cell centres so the placement GRID never reads as a periodic seam.\n // angJitter EASED 0.55 → 0.38 (the reconcile A lift): a tighter angular spread keeps\n // adjacent dabs more flow-aligned (coherent) while the per-cell curl wobble still\n // breaks the perfectly-concentric-rows read (the dabs FAN gently, not lock to a grid).\n // angJitter eased 0.38 → 0.26 + hardness 0.74 → 0.84 (the §4.2 A lift): a tighter angular\n // spread keeps adjacent dabs strongly flow-aligned (the structure-tensor coherence) and a\n // sharper edge gives each dab a STRONGER directional gradient (a soft dab's faint edge\n // reads weakly anisotropic). The per-cell curl wobble still breaks the perfectly-\n // concentric-rows read, so the dabs FAN gently rather than locking to a grid.\n StrokeHit dBig = vangoghDab(p, pitch, lenAniso, widAniso,\n 0.30, 0.50, 0.08, flow, t, 1.3);\n // streakFreq raised 14 → 34 (the §4.3 slope fix): a high-frequency streak runs ALONG the\n // dab spine, injecting fine-scale luma energy that flattens the too-steep β WITHOUT\n // adding new isotropic marks (the along-spine streak stays directional, so the §4.2\n // anisotropy the long-thin dab carries is preserved — the band-conflict resolution).\n paintOver(result, height, dBig, 48.0, 0.34,\n uImpasto * 0.75 * uStrokeAmount, 0.84, 1.3, 1.0 /* full crown */);\n\n // Layer 2 — two-thirds-pitch accent dabs (the divisionist sparkle between the big\n // marks — denser placement but still contained dabs, so dark canvas survives between).\n // angJitter eased 0.5 → 0.34 (same A-lift reasoning — the accent dabs queue along the\n // flow rather than scattering isotropically); hardness 0.78 → 0.86 sharpens the gradient.\n StrokeHit dSml = vangoghDab(p + vec2(-5.1, 8.4), pitch * 0.62, lenAniso * 0.95,\n widAniso * 0.95, 0.36, 0.60, 0.20, flow, t, 4.1);\n paintOver(result, height, dSml, 42.0, 0.22,\n uImpasto * 0.55 * uStrokeAmount, 0.86, 4.1, 1.0);\n\n // Layer 3 — the FINE divisionist flecks (W-AUR-VANGOGH-CONFIG reconcile). The two-layer\n // field read as a few BIG cobalt dabs over a smooth empty teal ground (the side-by-side\n // against starry-night-crop.png: the painting is DENSE small varied flecks, not sparse\n // large marks). The flecks are LONG·THIN directional commas hugging the swirl tangent\n // (the A-preserving fleck — short fat flecks read isotropic and drag §4.2 down). Sparse\n // density 0.30 keeps the inter-fleck ground open (the gap-fraction atomicity read).\n // The flecks are FINE (≈0.42× pitch) directional commas, tightly flow-aligned (angJitter\n // 0.22) and SPARSE (0.30) — the divisionist sparkle between the loaded marks that keeps\n // the inter-dab ground open (atomicity) while adding the small-mark mid-band energy. Thin\n // + flow-aligned so the §4.2 anisotropy the long dabs carry survives the added small marks.\n StrokeHit dFleck = vangoghDab(p + vec2(8.7, -3.2), pitch * 0.42, lenAniso * 1.0,\n widAniso * 0.68, 0.30, 0.85, 0.22, flow, t, 7.7);\n paintOver(result, height, dFleck, 30.0, 0.16,\n uImpasto * 0.40 * uStrokeAmount, 0.80, 7.7, 1.0);\n\n // ── Flow-aligned GROUND swirl-GROOVING (W-AUR-VANGOGH-CONFIG reconcile) ──\n // The bare ground between the dabs was a SMOOTH low-frequency teal gradient — the §4.3\n // power-spectrum slope ran too STEEP (β≈−2.0: too much low-frequency nuclei-field energy\n // vs the high band). Van Gogh's actual sky has the swirl BRUSHWORK everywhere, so groove\n // the OPEN GROUND with a flow-aligned ripple. It is SUBTRACTIVE-biased (it only darkens,\n // never brightens the ground), so it DEEPENS the inter-dab valleys (MORE gap-fraction —\n // atomicity preserved/strengthened) while injecting the across-flow mid-band luma energy\n // that flattens β. Gated to the open ground (low height) via the (1-height) gate so it\n // never lifts/erodes the loaded dab bodies (the dab read is untouched). Across the swirl\n // FLOW axis so the grooves run WITH the sky's brushwork direction.\n // The ground swirl-combing — a FIXED-global-angle directional grain on the open ground.\n // A flow-FOLLOWING comb varies its direction with the swirl across the readback window,\n // so its blurred structure tensor averages toward isotropic (no §4.2 lift). A comb at one\n // GLOBAL angle (van-Gogh's dominant diagonal stroke grain) is COHERENT over the whole\n // window ⇒ every open-ground pixel reads the SAME direction (the §4.2 mean-anisotropy lift\n // the swirl comb could not reach). Two resolved bands (≈22 + ≈44 across the global axis ⇒\n // ~21px + ~11px at 464px, both in the §4.3 fit window) also feed the β flatten. Gated to\n // the open ground (low height) so the loaded dabs are untouched; SUBTRACTIVE-biased so the\n // inter-dab valleys deepen (gap-fraction preserved, not filled).\n vec2 gdir = normalize(vec2(0.82, 0.57)); // the dominant global stroke grain axis\n float gacross = dot(p, vec2(-gdir.y, gdir.x));\n float groundGate = 1.0 - smoothstep(0.05, 0.28, height);\n float groove = sin(gacross * 22.0) + 0.5 * sin(gacross * 44.0 + 1.3);\n result *= 1.0 - 0.16 * groundGate * (0.5 - 0.5 * groove);\n\n // Canvas tooth (fine linen weave — base relief the raking light catches).\n float tooth1 = vnoise(p * 220.0);\n float tooth2 = vnoise(p * 220.0 * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * 0.06 * uCanvasGrain;\n\n // Relight the accumulated impasto height (raking light catches each dab's crown —\n // the visible impasto ridge that makes a dab read as a RAISED loaded mark).\n float canvasBase = tooth * 0.06 * 0.5;\n result = relightImpasto(result, height, canvasBase);\n\n // The visible Starry-Night GROUND — the open canvas between dabs (low accumulated\n // height) darkens toward the deep underpainting, so the bright impasto dabs read as\n // SEPARABLE atomic marks over a darker field (the dab↔ground contrast the user's\n // \"reads as strokes\" bar needs, AND the painterly-statistics gap-fraction floor — the\n // dark inter-dab ground must register as a measurable fraction of the field). 0.30\n // floor over a WIDER smoothstep (0..0.40): deep enough that the open gaps read as the\n // dark Starry-Night sky between marks (clearing the 4% gap floor) while the gradual\n // ramp keeps the gaps reading as flowing underpainting, not the hard black ink LINES a\n // narrow near-black step (0.26 / 0.0..0.32) produced.\n // The smoothstep FLOOR starts at 0.10 (not 0): a dab's faint AA coverage TAIL deposits\n // a sliver of height, and where many tails align along the swirl flow those slivers\n // accumulate into a faint continuous height ridge that read as thin curved LINES in the\n // ground. Holding the ground full-dark until a real dab CORE (height > 0.10) lifts out\n // keeps the open field clean — only the loaded dab bodies emerge, the tails stay ground.\n result *= mix(0.115, 1.0, smoothstep(0.085, 0.31, height));\n\n // The van-Gogh chroma — a light OKLCh punch. EASED to 0.92 (off 1.04) in the\n // W-AUR-VANGOGH-CONFIG reconcile: the rebuilt discrete-dab register's per-dab OKLCh\n // broken-color jitter (the ±16° hue + ±chroma swing per cell) lifts the field's\n // colourfulness on its own, so the prior 1.04 punch on TOP overshot the §4.1\n // reference band (rendered C=100.5 vs the painting's measured 70.67 ± 15/+25 →\n // ceiling 95.67 — neon, not Starry Night's rich-but-not-garish blue/gold). The 0.92\n // demote pulls the rendered colourfulness back IN-band while the broken-color jitter\n // keeps the per-dab pigment variation (the discrete-stroke read is untouched — this\n // is a chroma scale, not a dab-geometry change). Band-anchored on the real painting\n // (proof:aurora-arresting), NOT a widened band.\n result = saturate3(result, 1.0);\n return result;\n}\n\n", De = "StrokeProfile profileFor(int medium, int mode) {\n // The oil baseline (mode 0) — balanced modern-abstract/palette-knife hybrid.\n StrokeProfile prof = StrokeProfile(\n 0, // shapeType — tapered\n 0.25, // bristleAmp\n 9.0, // streakFreq\n 0.09, // streakAmp\n 0.9, // impastoAmp\n 0.80, // hardness\n 340.0, // toothScale — W-AUR-VANGOGH-CONFIG reconcile: FINER 240 → 340. Oil's §4.3 β sat\n // right AT the −1.45 band ceiling (±0.02 frame variance straddling\n // it, surfaced once the vangogh bands went green and the spec reached\n // the oil β assert). MEASURED on the live GPU: ADDING fine high-\n // frequency tooth energy steepens oil's power-spectrum slope (more\n // negative — coarsening it the other way pushed β SHALLOWER to\n // −1.33). A finer, stronger tooth moves β to a safe distance inside\n // the −5/3 band [−1.85, −1.45]. Oil-only (oil-pastel sets 280).\n 0.14, // toothAmp — raised 0.09 → 0.14 (same oil-β steepen: more fine-grain high band).\n 1.03, // pigmentSat\n 0.65, // densityBig\n 0.78, // densityMed\n 0.90, // densitySml\n 0.0, // energyGrade — oil is uniform-length (no Starry-Night cascade)\n 0.4, // impastoFloor — oil's 0.4+0.6·edgeN crown falloff\n 0.92, // densityFill — oil fills DENSELY with the directional low-relief fill so the\n // flat-colour regions between the macro strokes are TEXTURED with\n // flow-aligned fine strokes (the §4.2 anisotropy needs every pixel\n // to carry directional gradient; a flat untextured region reads as\n // an isotropic/degenerate tensor and drags mean A down). The fill\n // is now directional + low-streak, so dense coverage textures\n // WITHOUT the prior round-dab speckle.\n 1.0 // groundFloor — oil keeps the full base (no ground darken; fills everywhere)\n );\n\n // W-AUR-VANGOGH-REBUILD — the van-Gogh medium NO LONGER routes through this oil\n // StrokeProfile cascade. It is a DEDICATED atomic-dab body (mediumVangogh / vangoghDab\n // below) — the prior profile-driven cascade (four dense layers of long-thin\n // tensor-oriented strokes) merged into the \"marbled flow-bands\" read and ran at ~4fps.\n // profileFor now serves ONLY the oil + oil-pastel stroke mediums; the MEDIUM_VANGOGH\n // case is removed (no caller). MEDIUM_VANGOGH stays #define'd (the main() dispatch +\n // isPainterlyStroke still key off uMedium==5).\n\n // ── Oil-pastel — broad smeared directional strokes deposited via the brush engine\n // (slice 8 F1). Creamy soft edges (low hardness), heavy build-up, and a chroma punch.\n // Distinct from the dry-crayon tooth-multiply (mediumCrayon): oil-pastel LAYS strokes.\n if (medium == MEDIUM_OILPASTEL) {\n prof.shapeType = 0; // tapered directional smear — a round dab reads locally\n // isotropic (steep β / low A); the creamy oil-pastel mark\n // is a broad DIRECTIONAL smear, which carries the §4.2\n // coherence + adds the directional mid-band the §4.3 slope\n // needs (the round-dab profile rolled β off to −2.8)\n prof.bristleAmp = 0.10; // smooth creamy edges (waxy pastel, not bristle)\n prof.streakFreq = 18.0; // finer internal smear — adds the mid/high-band the smooth\n // round-dab profile lacked (the β-too-steep fix); the\n // directional along-spine streak flattens the §4.3 slope\n // without crossing the strokes\n prof.streakAmp = 0.20;\n prof.impastoAmp = 0.7; // build-up, but flatter than oil impasto\n prof.hardness = 0.42; // CREAMY — soft compositing, strokes blend on overlap\n prof.toothScale = 280.0;\n prof.toothAmp = 0.12; // the pastel tooth reads stronger\n prof.pigmentSat = 0.80; // the waxy chroma — eased off 1.16 so the rendered C clears\n // the §4.1 band ceiling with margin while the K-M subtractive\n // overlap path (paintOverOklab) keeps the chroma OFF the grey floor\n prof.hardness = 0.58; // creamy but the strokes still REGISTER — a too-soft blend\n // (0.42) smeared the marks into the smooth colour zones and\n // the field rolled off too steep (β≈−2.9, a near-gradient);\n // a crisper deposit keeps the mid/high-band the −5/3 slope needs\n prof.densityBig = 0.62; // broad directional coverage — but NOT over-dense: too many\n // overlapping creamy strokes point in slightly-varied\n // directions and the local §4.2 coherence DROPS (over-dense\n // measured A=0.57 < the 0.62-density A=0.63). The mid-density\n // flow-aligned deposit is the coherence sweet spot.\n prof.densityMed = 0.78;\n prof.densitySml = 0.90;\n prof.energyGrade = 0.80; // a strong Starry-Night length cascade — varies stroke length\n // by luma/coherence so the dab-size energy spreads across\n // scales (the −5/3 cascade the uniform-length 0.0 grade lacked,\n // the §4.3 β-too-steep fix). Not the full van-Gogh 1.0 (oil-\n // pastel keeps its creamy broad character).\n prof.impastoFloor = 0.55; // a softer crown than van-Gogh's full-height glint\n return prof;\n }\n\n // ── Oil sub-modes (mode dispatch on the oil medium).\n if (mode == 1) { // palette knife — razor edges, heavy impasto\n prof.shapeType = 3; // flat, even\n prof.bristleAmp = 0.12;\n prof.streakFreq = 4.0; prof.streakAmp = 0.05;\n prof.impastoAmp = 1.6;\n prof.hardness = 0.95;\n prof.toothAmp = 0.04;\n prof.densityBig = 0.80; prof.densityMed = 0.88; prof.densitySml = 0.70;\n } else if (mode == 3) { // thick brushwork — heavy bristle brush\n prof.shapeType = 0; // tapered\n prof.bristleAmp = 0.32;\n prof.streakFreq = 14.0; prof.streakAmp = 0.14;\n prof.impastoAmp = 1.2;\n prof.hardness = 0.85;\n prof.toothAmp = 0.07;\n }\n return prof;\n}\n", Oe = "\n// ── Gradient pack (BG.W-AUR-METAL-FINISH) ──────────────────────────────────\n// structureTensorField re-plumbs its already-computed luma gradient (Gx,Gy) out through\n// the vec4 return's .w lane so the metal medium pays ZERO extra taps (a second Sobel is\n// 8 sampleBase() taps). 12 bits per bounded component ([-4,4]) into one f32, exact under\n// highp; the .xy/.z crayon/kuwahara callers are transparent to the widen.\nfloat packGrad(float gx, float gy) {\n float qx = floor(clamp(gx * 0.125 + 0.5, 0.0, 1.0) * 4095.0);\n float qy = floor(clamp(gy * 0.125 + 0.5, 0.0, 1.0) * 4095.0);\n return qx + qy * 4096.0;\n}\nvec2 unpackGrad(float packed) {\n float qy = floor(packed * (1.0 / 4096.0));\n float qx = packed - qy * 4096.0;\n return (vec2(qx, qy) * (1.0 / 4095.0) - 0.5) * 8.0;\n}\n", ke = "#define MEDIUM_METAL 8\n#define MEDIUM_METALGRAD 9\n\n// ── Metal — the two-term anisotropic BRDF over the field's own relief (uMedium==8/9,\n// BG.W-AUR-METAL-FINISH) ─────────────────────────────────────────────────────────\n// Metal is a MUTUALLY-EXCLUSIVE medium (NOT a finish axis) — the field re-lights as\n// warm folded metal: the luma HEIGHT field (the packed structure-tensor gradient →\n// the surface normal) catches an anisotropic Blinn streak (brushed metal, the streak\n// runs ALONG the coherent edge-tangent) plus a sharp crest, both raked by a cursor-\n// synthesized light that reads on BOTH backends (uCursor is in-struct — a phantom\n// uLightDir read would be flat on the WGSL primary). The catch is the ACHROMATIC-WARM\n// anchor (AURORA_CATCH_LIGHT_ANCHOR ≈ [1.0,0.97,0.90], never a cold chrome-blue). The\n// body keeps the field HUE (technicolor valley base); the height rides the relief.\n// ZERO new taps — structureTensorField ALREADY computed the gradient (unpacked from .w).\nconst vec3 METAL_CATCH_WARM = vec3(1.0, 0.97, 0.90); // AURORA_CATCH_LIGHT_ANCHOR\nconst float METAL_HEIGHT_SCALE = 2.2; // gradient → normal tilt (× uMetalHeightScale)\nconst float METAL_LIGHT_Z = 0.55; // synth-light z (toward viewer)\nconst vec2 METAL_IDLE_RAKE = vec2(0.32, 0.34); // upper-right idle rake bias\nconst float METAL_SHININESS_ANISO = 6.0; // anisotropic streak exponent (brushed)\nconst float METAL_SHININESS_CREST = 40.0; // crest specular exponent (sharp)\nconst float METAL_COHERENCE_FLOOR = 0.22; // streak gates on edge coherence A\nconst float METAL_BODY_FLOOR = 0.42; // diffuse valley floor (dark side reads)\nconst float METAL_GRADIENT_FLATTEN = 0.55; // metal-gradient pre-flatten toward luma\nconst float METAL_SPARKLE_DENSITY = 240.0; // metal-gradient per-cell flake grid\nconst float METAL_SPARKLE_THRESH = 0.72; // only some cells flake\nconst float METAL_SPARKLE_AMP = 0.6; // flake glint amplitude\n\n// The shared metal BRDF core — takes the ALREADY-computed structureTensorField vec4 so\n// the caller pays ZERO extra taps (metal-gradient reuses the same stf). WebKit-fenced:\n// every pow base is clamped to [0,1], the exponents are compile-time constants.\nvec3 metalShade(vec3 baseCol, vec2 p, vec4 stf) {\n vec2 tangent = stf.xy;\n float A = stf.z;\n vec2 grad = unpackGrad(stf.w);\n // Height-field normal: N = normalize(vec3(grad * scale, 1)). The luma relief tilts\n // the surface; the flat field reads near vec3(0,0,1) (facing the viewer).\n vec3 N = normalize(vec3(grad * (METAL_HEIGHT_SCALE * uMetalHeightScale), 1.0));\n vec3 V = vec3(0.0, 0.0, 1.0);\n // Cursor-synthesized rake light (in-struct on BOTH backends — never uLightDir). The\n // idle bias keeps a still field lit from the upper-right; a moving cursor rakes it.\n vec3 L = normalize(vec3((uCursor - p) + METAL_IDLE_RAKE, METAL_LIGHT_Z));\n vec3 H = normalize(L + V);\n // Anisotropic streak — brushed metal: the highlight runs ALONG the edge-tangent, so\n // it is a function of the H-component PERPENDICULAR to the tangent (sinTH).\n float tH = dot(normalize(tangent), H.xy);\n float sinTH = sqrt(clamp(1.0 - tH * tH, 0.0, 1.0));\n float streak = pow(clamp(sinTH, 0.0, 1.0), METAL_SHININESS_ANISO);\n float crest = pow(clamp(dot(N, H), 0.0, 1.0), METAL_SHININESS_CREST);\n float spec = streak * crest;\n // Coherence gate — the anisotropic streak reads only where the field has a real edge\n // (a flat zone has no brush direction; A≈0 → no streak).\n spec *= smoothstep(0.0, METAL_COHERENCE_FLOOR, A);\n // Technicolor valley base — the body keeps the FIELD hue; the diffuse term rides the\n // height relief so the ridges brighten and the pits fall toward the floor.\n float diff = clamp(dot(N, L), 0.0, 1.0);\n vec3 body = baseCol * (METAL_BODY_FLOOR + (1.0 - METAL_BODY_FLOOR) * diff);\n // The catch is the achromatic-warm anchor, scaled by the polish knob.\n return body + METAL_CATCH_WARM * (spec * clamp(uMetalPolish, 0.0, 4.0));\n}\n\nvec3 mediumMetal(vec3 col, vec2 p, float t) {\n vec4 stf = structureTensorField(p, t, flowField(p, t));\n return metalShade(col, p, stf);\n}\n\n// metal-gradient (uMedium==9) — the SAME BRDF over a pre-flattened/gradient base + a\n// twinkle-in-place flake sparkle (position FIXED per cell, PHASE-animated, gated on\n// facing — flake glint, never a boil).\nvec3 mediumMetalGradient(vec3 col, vec2 p, float t) {\n vec4 stf = structureTensorField(p, t, flowField(p, t));\n // Pre-flatten toward luma (the smoother gradient-metallic base) — same BRDF, calmer body.\n // NB: flat is a GLSL reserved interpolation qualifier — WebKit's compiler REJECTS it as an\n // identifier (ANGLE tolerates it); named flatCol so the WebKit aurora shader compiles (L1a).\n vec3 flatCol = mix(col, vec3(dot(col, W_LUMA)), METAL_GRADIENT_FLATTEN);\n vec3 metal = metalShade(flatCol, p, stf);\n // The height-field normal facing (recomputed from the same packed gradient — ZERO taps).\n vec2 grad = unpackGrad(stf.w);\n float facing = normalize(vec3(grad * (METAL_HEIGHT_SCALE * uMetalHeightScale), 1.0)).z;\n // Twinkle-in-place: a fixed per-cell flake seed, phase-animated glint gated on facing.\n vec2 cell = floor(p * METAL_SPARKLE_DENSITY);\n float seed = hash21(cell);\n float tw = pow(clamp(sin(t + seed * 6.2831853), 0.0, 1.0), 40.0);\n float flakeGate = step(METAL_SPARKLE_THRESH, seed);\n metal += METAL_CATCH_WARM * (tw * flakeGate * clamp(facing, 0.0, 1.0) * METAL_SPARKLE_AMP);\n return metal;\n}\n", Ae = "// ── Medium overlays ───────────────────────────────────────────────────────\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n" + Oe + "\n// ── Structure-tensor / edge-tangent-flow (AW.W4.1) ─────────────────────────\n// The keystone of the painterly engine: derive stroke orientation from the COLOR\n// FIELD's OWN structure, not a hand-authored flow pattern. A 3x3 Sobel over\n// luma(sampleBase) yields the gradient (Gx,Gy); the 2x2 structure tensor\n// J = [[Gx², GxGy],[GxGy, Gy²]] eigen-decomposes closed-form into the MINOR\n// eigenvector (the edge-TANGENT — least color change, the stroke direction) + the\n// coherence A = (λ1-λ2)/(λ1+λ2); flat zones relax toward fallbackDir by (1-A). The\n// single-pass small-tap WebGL2 form. Returns vec4(tangent.xy, A, packGrad(Gx,Gy)) —\n// the .w lane carries the metal medium's gradient (BG.W-AUR-METAL-FINISH; the .xy/.z\n// callers are byte-unchanged).\nvec4 structureTensorField(vec2 p, float t, vec2 fallbackDir) {\n float e = 0.0035; // small-tap neighborhood (edge-mask scale)\n // 3x3 luma samples.\n float l00 = dot(sampleBase(p + vec2(-e, -e), t), W_LUMA);\n float l10 = dot(sampleBase(p + vec2( 0.0, -e), t), W_LUMA);\n float l20 = dot(sampleBase(p + vec2( e, -e), t), W_LUMA);\n float l01 = dot(sampleBase(p + vec2(-e, 0.0), t), W_LUMA);\n float l21 = dot(sampleBase(p + vec2( e, 0.0), t), W_LUMA);\n float l02 = dot(sampleBase(p + vec2(-e, e), t), W_LUMA);\n float l12 = dot(sampleBase(p + vec2( 0.0, e), t), W_LUMA);\n float l22 = dot(sampleBase(p + vec2( e, e), t), W_LUMA);\n // Sobel derivatives.\n float Gx = (l20 + 2.0 * l21 + l22) - (l00 + 2.0 * l01 + l02);\n float Gy = (l02 + 2.0 * l12 + l22) - (l00 + 2.0 * l10 + l20);\n // Structure tensor components.\n float Jxx = Gx * Gx;\n float Jyy = Gy * Gy;\n float Jxy = Gx * Gy;\n // Closed-form 2x2 eigenvalues: λ = 0.5(tr ± sqrt((Jxx-Jyy)² + 4Jxy²)).\n float tr = Jxx + Jyy;\n float disc = sqrt(max((Jxx - Jyy) * (Jxx - Jyy) + 4.0 * Jxy * Jxy, 0.0));\n float lambdaMaj = 0.5 * (tr + disc);\n float lambdaMin = 0.5 * (tr - disc);\n // The MAJOR eigenvector points along the gradient (the edge NORMAL); the MINOR\n // is its perpendicular — the edge TANGENT (the stroke direction). The principal\n // angle is θ = 0.5·atan2(2·Jxy, Jxx-Jyy); this form is robust at Jxy≈0 (where the\n // (λ-Jyy, Jxy) eigenvector formula collapses to a zero vector). The tangent is at\n // θ + 90°. Guard the fully-isotropic (no-gradient) degenerate case → fallback dir.\n vec2 tangent;\n if (disc < 1e-7) {\n tangent = fallbackDir;\n } else {\n float theta = 0.5 * atan(2.0 * Jxy, Jxx - Jyy); // major (gradient) angle\n tangent = vec2(-sin(theta), cos(theta)); // perpendicular = tangent\n }\n // Coherence A in [0,1] — high where one eigenvalue dominates (a strong edge),\n // ~0 in flat zones. Relax toward the smooth fallback by (1 - A).\n float A = (lambdaMaj - lambdaMin) / (lambdaMaj + lambdaMin + 1e-6);\n A = clamp(A, 0.0, 1.0);\n // Coherence-weighted blend: full tensor in coherent zones, smooth in flat ones.\n // Resolve the 180° sign ambiguity toward the fallback so the blend is continuous.\n if (dot(tangent, fallbackDir) < 0.0) tangent = -tangent;\n // The blend weight is a low-power curve (A^0.35) so even MODERATE-coherence zones queue\n // strongly along the tangent (a flowing van-Gogh band reads coherent the way the\n // structure-tensor metric measures it; a linear A under-orients the mid-band and the\n // rendered field reads too isotropic — the §4.2 anisotropy lift). The flat-zone (A≈0)\n // relax to the fallback survives (0^0.35=0), so tensor noise never reads as jitter.\n float blendW = pow(A, 0.28);\n vec2 dir = normalize(mix(fallbackDir, tangent, blendW) + 1e-6);\n return vec4(dir, A, packGrad(Gx, Gy));\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation — pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding — faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth — tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n", je = "// ── Medium id constants (mirror uniformBridge.ts MEDIUM_ID — the uMedium ladder) ──\n// The StrokeProfile selector (AX.W12 + AX.W13) dispatches on the medium id: oil,\n// van-Gogh, and oil-pastel each AUTHOR a first-class profile in profileFor.\n#define MEDIUM_OIL 3\n#define MEDIUM_CRAYON 4\n#define MEDIUM_VANGOGH 5\n#define MEDIUM_OILPASTEL 6\n\n// ── Crayon — DRY wax pigment on paper tooth (first-class medium, uMedium==4) ──\n// Crayon is not strokes. It's dry pigment crumbs dragged across paper tooth — the\n// DRY tooth-multiply model: anisotropic tooth noise multiplied into the base, a hard\n// SCUMBLE that lets the lower color show through the broken upper layer, and stable\n// OKLCh broken-color pigment patches. NO sheen, NO burnish film — that waxy gloss is\n// the OIL-PASTEL deposition's signature (mediumOilPastel), distinct from dry crayon\n// (AX.W13 slice 8 F1 — the split). Crayon shares the SUBSTRATE (the structure-tensor\n// orientation, the tooth noise, OKLCh brokenColorJitter), not the dispatch body.\nvec3 mediumCrayon(vec3 col, vec2 p, float t) {\n // Orient the deposition along the structure-tensor edge-tangent (the bridge forces\n // tensor for crayon, so read the tensor field directly).\n vec2 flow = structureTensorField(p, t, flowField(p, t)).xy;\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n // ── Paper TOOTH height field — the relief the dry pigment rides. Anisotropic\n // (squished along flow, coarse cross-flow). Peaks = ridges, valleys = paper pits.\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n\n // ── DRY TOOTH-MULTIPLY — the crayon multiplies the tooth relief into the base\n // color (dark in the pits, bright on the ridges). The pressure (uStrokeAmount) sets\n // how hard the multiply bites. This is the DRY model — no pigment build-up, no sheen.\n float pressure = clamp(uStrokeAmount, 0.0, 1.0);\n float bite = mix(0.18, 0.46, pressure); // multiply strength\n vec3 result = col * (1.0 - bite * (0.5 - tooth));\n\n // ── HARD SCUMBLE — a broken upper layer that lets the lower color show through the\n // gaps. A coarse mask gates a HARD (high-contrast) dragged pass so the dry crayon\n // reads as broken pigment crumbs, not a smooth wash. Drag follows the tensor flow.\n float scumbleMask = smoothstep(0.42, 0.78, vnoise(vec2(pr.x * scale * 0.55, pr.y * scale * 0.22) + 7.0));\n float scumbleCoverage = scumbleMask * pressure * 0.7; // hard broken upper layer\n vec3 paper = col * mix(0.80, 0.94, pressure); // the paper showing through\n result = mix(paper, result, scumbleCoverage);\n\n // ── Broken-color pigment: stable wax/pigment patches in OKLCh (W5), not flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified (the wax chroma punch — but DRY, no sheen).\n result = saturate3(result, 1.08);\n\n return result;\n}\n\n// ── StrokeProfile — the oil-stroke parameter vector (AX.W12, slice 8 F6) ──────\n// The SBR \"stroke = parameter vector\" canon (facet 11): the per-mode if-ladder knobs\n// become struct FIELDS — logic-as-DATA, not an imperative branch. profileFor(medium,\n// mode) populates the profile for a (medium, mode) pair; paintStrokeLayers(profile) runs\n// the four-layer bestOil/paintOver cascade off it. A new medium (the W13 van-Gogh /\n// oil-pastel profiles) AUTHORS a profile entry — it never edits a monolith.\nstruct StrokeProfile {\n int shapeType; // 0 tapered, 1 load-drag, 2 dab, 3 even, 4 comma/crescent\n float bristleAmp; // edge raggedness 0..0.5\n float streakFreq; // internal-streak spatial frequency\n float streakAmp; // internal-streak amplitude\n float impastoAmp; // paint-thickness contribution (the relight reads the height)\n float hardness; // edge-compositing crispness 0..1\n float toothScale; // canvas-tooth (linen weave) spatial frequency\n float toothAmp; // canvas-tooth amplitude\n float pigmentSat; // pigment saturation boost (OKLCh chroma scale)\n float densityBig; // layer-1 (big gestural) placement density gate\n float densityMed; // layer-2 (medium body) placement density gate\n float densitySml; // layer-3 (small dabs) placement density gate\n float energyGrade; // AX.W13 — SBR energy-grade magnitude (0 off; 1 the van-Gogh\n // Starry-Night length cascade). The energy grade is a PROFILE\n // field, NOT a buried uMedium==5 bestOil branch (slice 8 F0).\n float impastoFloor;// AX.W13 — the per-stroke height-crown floor (0.4 oil falloff;\n // 1.0 van-Gogh FULL-height crown so each dab catches its glint).\n float densityFill; // AX.W13 — layer-4 fill-dab density. Oil/oil-pastel fill the\n // bald spots (0.95, full coverage); van-Gogh sets it LOW so the\n // sparse atomic dabs keep their visible inter-stroke ground gaps\n // (the atomicity read — a 0.95 fill would close every gap to a smear).\n float groundFloor; // AX.W13 — the bare-ground darken floor. The gaps between strokes\n // (low accumulated height) multiply toward this floor, so van-Gogh's\n // sparse atomic dabs read over a visibly darker underpainting (the\n // Starry-Night visible ground). Oil/oil-pastel keep 1.0 (no darken).\n};\n\n// The (medium, mode) -> StrokeProfile selector. The if-ladder's knobs are the profile's\n// fields; a new medium adds a CASE here (never an edit to a dispatch body). mode is the\n// uStrokeMode oil-stroke sub-mode (0 oil, 1 palette-knife, 3 brushwork). crayon\n// (uMedium==4) is a PEER tooth-multiply medium that never reaches the stroke cascade.\n// The painterly STROKE mediums are oil (MEDIUM_OIL), van-Gogh (MEDIUM_VANGOGH) and\n// oil-pastel (MEDIUM_OILPASTEL) — each AUTHORS its own profile entry below.\n" + De + "\n// The single parameterized four-layer stroke cascade (AX.W12). The four hand-unrolled\n// bestOil/paintOver invocations collapse into ONE body driven by the profile + the\n// uniform-derived per-layer scale/anisotropy multipliers (which are mode-INVARIANT — the\n// per-layer offsets, seeds, and len/wid muls are fixed across modes, so they stay here as\n// the cascade's structure; only the profile's knobs differentiate the medium). The\n// mode passes through for the two mode-special-cased shapes (knife layer-3 dabs +\n// layer-4 fill shape), which are placement details of the cascade, not profile knobs.\nvoid paintStrokeLayers(inout vec3 col, inout float height, StrokeProfile prof,\n int mode, vec2 p, float t) {\n // Scales & multipliers from uniforms (mode-invariant cascade structure).\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three primary layers: big gestural, medium body, small dabs.\n // W-AUR-STUDIO D5 — the −5/3 radii respacing was MEASURED + REVERTED (recorded, not\n // silently struck). The φ-adjacent geometric candidate (2.4 / 1.45 / 0.87, a fixed\n // ≈1.66× step) moved oil-pastel β −2.534 → −2.413 — TOWARD the −5/3 band but NOT into\n // it (floor −1.85), so the keep-iff-into-band gate failed. The single-pass WebGL2 path\n // is the true limiter (HC-aurora §5): the oil-pastel β + the oil/oil-pastel anisotropy\n // residual stays the oil/oil-pastel stroke-cascade ceiling. BB.W-AUR-KUWAHARA DECIDED the\n // booking: the SOFT anisotropic-Kuwahara finish ships as the OPT-IN mediumKuwahara() body\n // (uMedium==7) the consumer selects — NOT a re-tune of these oil/oil-pastel knobs. The\n // hand-set 2.4 / 1.1 / 0.45 stays — it is van-Gogh's landed-band spacing.\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n // Strokes are elongated HARD (long·thin) so the rendered field reads strongly\n // directional — the §4.2 structure-tensor anisotropy lift. A short fat dab is locally\n // isotropic and drags the measured A down; a long thin stroke that hugs the tensor\n // tangent is what gives Starry Night its A≈0.83. The width muls are pulled tighter to\n // keep the long·thin aspect.\n float lenMulBig = mix(3.0, 5.2, uStrokeAnisotropy);\n float widMulBig = mix(0.42, 0.22, uStrokeAnisotropy);\n float lenMulMed = mix(2.8, 4.8, uStrokeAnisotropy);\n float widMulMed = mix(0.40, 0.21, uStrokeAnisotropy);\n float lenMulSml = mix(2.2, 3.6, uStrokeAnisotropy);\n float widMulSml = mix(0.36, 0.23, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter — no grid\n vec2 flow = flowField(p, t);\n\n // Layer 1 — big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n prof.densityBig, prof.shapeType, prof.bristleAmp, flow, t, 1.3,\n prof.energyGrade);\n paintOver(col, height, hBig, prof.streakFreq * 0.7, prof.streakAmp,\n uImpasto * prof.impastoAmp * uStrokeAmount, prof.hardness, 1.3, prof.impastoFloor);\n\n // Layer 2 — medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, prof.densityMed, prof.shapeType, prof.bristleAmp, flow, t, 2.7,\n prof.energyGrade);\n paintOver(col, height, hMed, prof.streakFreq, prof.streakAmp,\n uImpasto * prof.impastoAmp * uStrokeAmount, prof.hardness, 2.7, prof.impastoFloor);\n\n // Layer 3 — small strokes (more frequent, smaller). Even the knife layer-3 stays the\n // medium's DIRECTIONAL shape, not a round dab — the round-dab sparkle was a fine-scale\n // isotropic speckle that dragged the §4.2 anisotropy down + rolled the §4.3 slope shallow.\n int smlShape = prof.shapeType;\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 0.9, prof.densitySml, smlShape,\n prof.bristleAmp * 0.85, flow, t, 4.1, prof.energyGrade);\n paintOver(col, height, hSml, prof.streakFreq * 1.4, prof.streakAmp * 0.6,\n uImpasto * prof.impastoAmp * 0.45 * uStrokeAmount, prof.hardness, 4.1, prof.impastoFloor);\n\n // Layer 4 — fill strokes (dense, fine) — cover bald spots. The density is\n // PROFILE-driven (prof.densityFill): oil/oil-pastel fill to full coverage; van-Gogh\n // keeps it sparse so the bare-ground gaps between its atomic dabs survive. The fill is\n // ELONGATED + flow-oriented (NOT a round dab) — a dense round-dab fill is locally\n // isotropic and was the dominant §4.2 anisotropy sink; an oriented fine stroke keeps the\n // fill directional so the whole field reads coherent.\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(2.0, 3.2, uStrokeAnisotropy);\n float widMulFill = mix(0.34, 0.24, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : prof.shapeType; // knife=even; others inherit the medium's directional shape\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 0.8, prof.densityFill, fillShape,\n prof.bristleAmp * 0.6, flow, t, 8.9, prof.energyGrade);\n // The fill is a low-relief, low-streak base coat — it covers bald spots WITHOUT adding\n // fine bright speckle (a high-impasto/high-streak fill caught a per-dab glint that read\n // as isotropic noise over the directional macro strokes — the §4.2/§4.3 sink). Its\n // positional jitter is tamed too so the fill strokes stay flow-aligned, not scattered.\n paintOver(col, height, hFill, prof.streakFreq * 1.2, prof.streakAmp * 0.35,\n uImpasto * prof.impastoAmp * 0.18 * uStrokeAmount, prof.hardness * 0.9, 8.9, prof.impastoFloor);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, prof.densityMed * 0.7, prof.shapeType, prof.bristleAmp, flow2, t, 6.5,\n prof.energyGrade);\n paintOver(col, height, hX, prof.streakFreq, prof.streakAmp * 0.85,\n uImpasto * prof.impastoAmp * 0.55 * uStrokeAmount, prof.hardness, 6.5, prof.impastoFloor);\n }\n}\n\n// The shared stroke-medium SUBSTRATE finish (AX.W12 + AX.W13): paint the four-layer\n// cascade off the profile, then canvas-tooth + relight + saturation. The three painterly\n// STROKE mediums (oil / van-Gogh / oil-pastel) each AUTHOR their own profile and call\n// this — the substrate is shared, the PROFILE (not a dispatch-body fork) differentiates\n// the medium (slice 8 F6). mode passes through for the cascade's mode-special-cased shapes.\nvec3 paintStrokeMedium(vec3 col, vec2 p, float t, StrokeProfile prof, int mode) {\n vec3 result = col;\n // AW.W4.2 — accumulated paint HEIGHT across the stroke layers. The relight reads\n // its gradient for the normal; the canvas tooth seeds the base relief.\n float height = 0.0;\n paintStrokeLayers(result, height, prof, mode, p, t);\n\n // Canvas tooth — linen weave\n float tooth1 = vnoise(p * prof.toothScale);\n float tooth2 = vnoise(p * prof.toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * prof.toothAmp * uCanvasGrain;\n\n // AW.W4.2 — relight the accumulated paint height with the movable uLightDir\n // source (diffuse + Blinn specular, in LINEAR before aces()). The canvas tooth\n // is the base relief term so the weave also catches the raking light.\n float canvasBase = tooth * prof.toothAmp * 0.5;\n result = relightImpasto(result, height, canvasBase);\n\n // AX.W13 — the visible ground. The bare-ground gaps (low accumulated stroke height)\n // multiply toward prof.groundFloor, so van-Gogh's sparse atomic dabs read as separable\n // marks over a darker underpainting (oil/oil-pastel keep groundFloor=1.0 → no-op). The\n // smoothstep keeps the impasto dabs (high height) at full value; only the open ground\n // between them darkens.\n result *= mix(prof.groundFloor, 1.0, smoothstep(0.0, 0.38, height));\n\n // Pigment saturation boost\n result = saturate3(result, prof.pigmentSat);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // The oil medium is a thin body: fetch the oil profile (mode-dispatched), paint via\n // the shared stroke substrate. uStrokeMode: 0 oil (gestural), 1 knife, 3 brushwork.\n int mode = uStrokeMode;\n StrokeProfile prof = profileFor(MEDIUM_OIL, mode);\n return paintStrokeMedium(col, p, t, prof, mode);\n}\n\n#define MEDIUM_KUWAHARA 7\n\n// ── Kuwahara — the anisotropic generalized Kuwahara painterly finish (uMedium==7,\n// BB.W-AUR-KUWAHARA) ───────────────────────────────────────────────────────────────\n// The SOTA edge-preserving painterly smoothing: the generalized/anisotropic Kuwahara of\n// Kyprianidis 2010, the SOFT polynomial-weighted variant (NOT the pre-2010 hard argmin,\n// which BANDS the flat field into an 8-spoke pinwheel — the §4.2 anti-regression). Aurora\n// is a PROCEDURAL field (no input texture), so the operator runs over sampleBase() directly:\n// an elliptical kernel oriented along the structure tensor (elongated along the edge-tangent,\n// narrowed by the anisotropy), divided into 8 overlapping sectors via smooth weights; the\n// output is the variance-weighted blend of the sector means (1/(1+var^q) — low-variance\n// sectors dominate, the SOFT criterion → flat oil-paint patches with crisp zone boundaries).\n// Single-pass small-radius WebGL2 form: 4 rings × 8 angular taps = 32 procedural samples\n// (cost-bounded; the offscreen-park / PRM freeze the substrate owns is untouched).\nvec3 mediumKuwahara(vec3 col, vec2 p, float t) {\n // Orient the kernel along the structure-tensor edge-tangent + read the coherence A\n // (the field widened vec3→vec4 for metal's gradient; kuwahara reads only .xy/.z).\n vec4 stf = structureTensorField(p, t, flowField(p, t));\n vec2 tangent = stf.xy;\n float A = stf.z;\n // The ellipse axes: major along the tangent, minor across. Anisotropy squeezes the\n // minor axis (coherent zones → long-thin patch along the colour band; flat zones →\n // near-circular so the operator degrades gracefully to the isotropic Kuwahara). The\n // base radius rides uStrokeScale so the painterly patch size tracks the studio knob.\n float radius = clamp(0.010 + uStrokeScale * 0.00018, 0.006, 0.024);\n float aniso = mix(1.0, 0.34, clamp(A, 0.0, 1.0)); // minor/major axis ratio\n vec2 ax = tangent; // major-axis unit vector (edge-tangent)\n vec2 ay = vec2(-tangent.y, tangent.x); // minor-axis unit vector (edge-normal)\n\n // 8 sectors, soft polynomial weights. Each sector i centers on angle i·45°; a sample's\n // sector weight is a smooth gaussian-of-angular-distance so sectors OVERLAP (no hard\n // argmin → no pinwheel banding). The center sample seeds all sectors equally.\n const int SECTORS = 8;\n vec3 m[8]; // per-sector weighted colour sum\n vec3 s[8]; // per-sector weighted colour² sum (for variance)\n float w[8]; // per-sector weight sum\n for (int i = 0; i < SECTORS; i++) { m[i] = vec3(0.0); s[i] = vec3(0.0); w[i] = 0.0; }\n\n // 4 rings × 8 angular taps over the elliptical disc. Each tap: sample the procedural\n // field, then deposit into the sectors by the soft angular weight × the radial falloff.\n const int RINGS = 4;\n const int TAPS = 8;\n for (int r = 1; r <= RINGS; r++) {\n float rr = float(r) / float(RINGS); // 0.25 .. 1.0\n float radial = 1.0 - 0.6 * rr; // inner taps weigh more (gaussian-ish)\n for (int a = 0; a < TAPS; a++) {\n float ang = 6.2831853 * float(a) / float(TAPS);\n // Elliptical offset: major axis full radius, minor axis squeezed by aniso.\n vec2 dirE = ax * cos(ang) + ay * (sin(ang) * aniso);\n vec2 off = dirE * (radius * rr);\n vec3 c = sampleBase(p + off, t);\n // The sample's angular bin (its sector) — soft, so it spills into neighbours.\n for (int k = 0; k < SECTORS; k++) {\n float sectorAng = 6.2831853 * float(k) / float(SECTORS);\n // Smallest signed angular distance to the sector center.\n float d = ang - sectorAng;\n d = atan(sin(d), cos(d)); // wrap to [-π, π]\n float sw = exp(-d * d * 2.2) * radial; // gaussian angular weight × radial\n m[k] += c * sw;\n s[k] += c * c * sw;\n w[k] += sw;\n }\n }\n }\n\n // Per-sector mean + scalar luma-variance, then the SOFT variance-weighted blend.\n vec3 accum = vec3(0.0);\n float accumW = 0.0;\n for (int k = 0; k < SECTORS; k++) {\n float wk = max(w[k], 1e-4);\n vec3 mean = m[k] / wk;\n vec3 var3 = max(s[k] / wk - mean * mean, vec3(0.0));\n float variance = dot(var3, W_LUMA); // perceptual scalar variance\n // SOFT criterion: low-variance sectors (flat, inside a colour zone) dominate; a\n // high-variance sector (straddling an edge) is suppressed. q controls the sharpness;\n // a finite q (not argmin) keeps the blend continuous → no pinwheel spoke.\n float sectorW = 1.0 / (1.0 + pow(variance * 320.0, 4.0));\n accum += mean * sectorW;\n accumW += sectorW;\n }\n vec3 result = accum / max(accumW, 1e-4);\n\n // The center sample anchors the result in near-flat zones (where every sector reads the\n // same colour) so the operator is a no-op there — the smoothing only BITES at edges.\n vec3 center = sampleBase(p, t);\n result = mix(center, result, clamp(0.35 + 0.65 * A, 0.0, 1.0));\n\n // A faint canvas tooth + pigment-saturation lift so the flattened patches read as\n // oil-paint, not a posterized blur (the painterly identity the smoothing alone lacks).\n float tooth = vnoise(p * 300.0) - 0.5;\n result *= 1.0 + tooth * 0.06 * uCanvasGrain;\n result = saturate3(result, 1.04);\n\n // Blend toward the incoming col by uStrokeAmount so the studio amount knob controls\n // the finish strength (uStrokeAmount=0 → the raw field passes through; default → full).\n return mix(col, result, clamp(uStrokeAmount, 0.0, 1.0));\n}\n\n" + ke + Ee + "// AX.W13 — the oil-pastel medium (uMedium==6) is a DISTINCT stroke-deposition body,\n// split out of the dry-crayon tooth-multiply (mediumCrayon) (slice 8 F1). It DEPOSITS\n// broad smeared directional strokes via the same brush engine with a creamy soft\n// hardness, heavy pigment build-up where strokes overlap, and a chroma punch — the\n// stroke-deposition model that gives oil-pastel its depth and less-uniform read.\n// Shares the SUBSTRATE (the stroke cascade + tooth + relight) with oil/van-Gogh, NOT\n// the dispatch body of dry crayon. The bridge forces tensor orientation.\nvec3 mediumOilPastel(vec3 col, vec2 p, float t) {\n StrokeProfile prof = profileFor(MEDIUM_OILPASTEL, 0);\n return paintStrokeMedium(col, p, t, prof, 0);\n}", A = "\n", Me = `#version 300 es
|
|
122
|
+
var Ce = "#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main() {\n vUv = aPos * 0.5 + 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n}", we = "// ── Palette LUT (OKLCh/OKLab interpolation) ──────────────────────────────\n// The endpoints stay CPU-baked to LINEAR sRGB (the Aras precompute pattern); only\n// the between-endpoint interpolation runs in perceptual space. The ramp\n// itself (the smoothstep ease + the OKLab-rectangular-vs-OKLCh-hue-arc dispatch on\n// uHuePath) is the shared samplePaletteRamp from procedural-color.glsl, the SAME\n// source the WebGPU twin splices; samplePalette here only selects the bracketing\n// stop pair + the raw inter-stop t and hands them to the shared ramp.\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n return samplePaletteRamp(uPalette[i0], uPalette[i1], t, uHuePath);\n}\n\n// ── Nuclei field ──────────────────────────────────────────────────────────\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift — slow global paletteId breathe between adjacent stops. The\n // rate rides K_PAL (perceptible ~30–60s hue cycle at the default coefficient);\n // the amplitude lifts the authored coefficient into a 0.03..0.06 paletteId band\n // so the palette visibly travels rather than dithering within one stop.\n float palAmp = clamp(uPaletteDrift * 6.0, 0.0, 0.06);\n paletteId += palAmp * sin(t * uPaletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n", Te = "// ── Flow field ────────────────────────────────────────────────────────────\n// Structure-tensor prototype (body defined post-sampleBase in the mediums block).\n// Returns vec4(dir.x, dir.y, coherence, packedGrad) — the minor-eigenvector tangent + A + the\n// metal-gradient .w lane in the widened vec3→vec4 return. The forward declaration must match\n// the vec4 definition or WebKit's compiler rejects the mismatched signature (L1b).\nvec4 structureTensorField(vec2 p, float t, vec2 fallbackDir);\n\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl — tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi — curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 5) {\n // Tensor / ETF: the color field's own edge-tangent flow. The\n // diagonal angle seeds the smooth fallback the coherence-weighted blend\n // relaxes toward in low-structure zones. Returns directly (no curl/cursor\n // post-mix — the tensor field already carries the structure orientation;\n // the cursor warp still drives the underlying color field in domainWarp).\n float a = radians(uFlowAngle);\n vec2 fallback = vec2(cos(a), sin(a));\n return structureTensorField(p, t, fallback).xy;\n }\n // curl — perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence — swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n", Ee = "// Khronos PBR-Neutral tonemap (hue + saturation preserving)\nvec3 aces(vec3 color) {\n const float startCompression = 0.8 - 0.04;\n const float desaturation = 0.15;\n float x = min(color.r, min(color.g, color.b));\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max(color.r, max(color.g, color.b));\n if (peak < startCompression) return clamp(color, 0.0, 1.0);\n float d = 1.0 - startCompression;\n float newPeak = 1.0 - d * d / (peak + d - startCompression);\n color *= newPeak / peak;\n float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);\n return clamp(mix(color, newPeak * vec3(1.0), g), 0.0, 1.0);\n}\n", De = "// ── Curved swept brushstroke primitive ────────────────────────────────────\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4·K·along0·(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint — so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered — thin-fat-thin (classic brush)\n// 1 load-drag — fat start, tapers to a point\n// 2 dab — ellipse-like, round center\n// 3 even — near-constant, slight end taper\n// 4 comma — van-Gogh atomic dab: ASYMMETRIC taper, fat near one end and\n// drawn to a fine point at the other (the divisionist crescent\n// mark). The width peak sits off-centre (~0.32) so the two ends\n// taper at DIFFERENT rates — a loaded round head + a dragged tail.\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n } else if (type == 4) {\n // comma / crescent — width peaks at ~0.32 then drags to a fine tail. The two\n // sides of the peak fall at different exponents (a fat round head, a long thin\n // tail), so the mark reads as a directional van-Gogh comma, not a symmetric oval.\n float peak = 0.32;\n float head = smoothstep(0.0, peak, t); // rounded loaded head\n float tail = pow(clamp((1.0 - t) / (1.0 - peak), 0.0, 1.0), 1.6); // dragged thin tail\n return clamp(min(head, tail) * 1.04, 0.0, 1.0);\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b — endpoints\n// halfW — base half-width (world units)\n// bulge — signed perpendicular midpoint offset, in world units\n// shapeType — 0..3\n// bristleFreq — spatial frequency of edge raggedness\n// bristleAmp — 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed — uniqueness seed for internal streaks\n// colAtMid — pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // fwidth-derived AA: half-width from the field's screen-space gradient so the\n // edge holds ~1px regardless of zoom/DPR (mirrors metaball.frag.ts:252-255).\n float aaC = max(fwidth(cn), 1e-6);\n cov = 1.0 - smoothstep(1.0 - aaC, 1.0 + aaC, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n // fwidth-derived AA on the clean Euclidean cap distances (mirrors metaball.frag.ts:252-255).\n float aaA = max(fwidth(dA), 1e-6);\n float aaB = max(fwidth(dB), 1e-6);\n capA = 1.0 - smoothstep(rA - aaA, rA + aaA, dA);\n capB = 1.0 - smoothstep(rB - aaB, rB + aaB, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// The painterly STROKE mediums (those that deposit via paintStrokeLayers/paintOver):\n// oil (3), van-Gogh (5), oil-pastel (6). For these the stroke OVER-composite runs in\n// OKLab so overlapping complementaries mix through a chromatic path, not the linear-\n// RGB grey mud; the smooth/atmospheric pole never reaches paintOver so it pays nothing.\nbool isPainterlyStroke() {\n return uMedium == 3 || uMedium == 5 || uMedium == 6;\n}\n\n// OKLab OVER-composite: lerp L,a,b of the over-color toward the under-color (the\n// Ottosson matrices spliced from procedural-color.glsl.ts — no new color math). Two\n// complementary-hued strokes overlapping transition through OKLab, where the midpoint\n// holds chroma, instead of the linear mix() that desaturates toward grey.\nvec3 paintOverOklab(vec3 under, vec3 over, float alpha) {\n vec3 labU = linOklab(under);\n vec3 labO = linOklab(over);\n return max(oklabToLinearSrgb(mix(labU, labO, alpha)), vec3(0.0));\n}\n\n// Composite stroke over col with internal streaking + ACCUMULATE paint HEIGHT.\n// streakAmp — 0..0.2 how much internal streaks darken/lighten\n// impastoAmp — 0..1 paint-thickness contribution (the height the relight reads)\n// hardness — 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\n//\n// The fixed-RGB edge rim (the phantom upper-left light) is retired. Each\n// stroke now deposits PAINT HEIGHT into the height accumulator (coverage x per-stroke\n// thickness, perturbed by the bristle/streak fbm for ridges/grooves); mediumOil\n// derives a normal from the accumulated height gradient (dFdx/dFdy) and relights it\n// once with the movable uLightDir source (relightImpasto), in linear before aces().\n//\n// The internal streak perturbs hue and chroma in OKLCh, not value only,\n// so a single stroke carries a small hue gradient (broken color at the ATOM level —\n// adjacent strokes shimmer like real impasto, not flat stamped swatches);\n// and the OVER-composite runs in OKLab on the painterly stroke mediums so overlapping\n// complementaries mix as pigment, not the linear-mix grey.\n// impastoFloor — the per-stroke height-crown floor: oil's 0.4+0.6*edgeN reads\n// floor=0.4 (the crown tapers to 40% at the stroke edge); the van-Gogh\n// profile passes floor=1.0 so each atomic dab catches a FULL-height\n// glint (scope item 1d). The crown magnitude is floor + (1-floor)*edgeN.\nvoid paintOver(inout vec3 col, inout float height, StrokeHit s,\n float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed,\n float impastoFloor) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks — fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n\n // ── Within-stroke OKLCh broken color. The streak fBm perturbs\n // the stroke's HUE + CHROMA along alongT/crossN, seeded per-stroke, so a single\n // stroke reads a small hue gradient (the atom-level broken-color shimmer). Value is\n // carried by the same streak so the loaded-brush light/dark survives. Gated to the\n // painterly stroke mediums + uBrokenColor (the smooth pole keeps the cheap value-only\n // streak). A second decorrelated fBm drives the hue axis so hue ≠ a scaled value.\n float hueStreak = fbm(vec2(s.alongT * streakFreq * 0.45 + streakSeed * 5.3,\n s.crossN * 1.9 + streakSeed * 1.7)) - 0.5;\n if (isPainterlyStroke() && uBrokenColor > 0.001) {\n vec3 lch = oklabToOklch(linOklab(c));\n // ±~10° within-stroke hue swing + ±~9% chroma, scaled by uBrokenColor. Smaller\n // than the per-stroke cell jitter (brokenColorJitter) — this is the intra-stroke\n // gradient layered on top of the per-cell pigment patch.\n lch.z += hueStreak * (20.0 * PI / 180.0) * uBrokenColor;\n lch.y = max(lch.y * (1.0 + (streak) * 0.18 * uBrokenColor), 0.0);\n c = max(oklabToLinearSrgb(oklchToOklab(lch)), vec3(0.0));\n }\n // Value streak (the loaded-brush light/dark across the bristles) — kept for every\n // medium that reaches paintOver (the smooth pole never does). The along-spine value\n // modulation is the loaded-brush light/dark that gives each stroke its OWN directional\n // luminance band — the structure-tensor signal a low-contrast color field (a uniform-hue\n // oil field) has no other source for (the §4.2 anisotropy lift on the flat-palette case).\n c *= 1.0 + streak * streakAmp * 3.2;\n\n // Cross-stroke ridge/valley shading — a catch-light along the spine centre, darkening to\n // the stroke edges. This is the strongest DIRECTIONAL luminance cue: it carves a bright\n // ridge down the stroke's length and dark grooves between adjacent strokes, so a field of\n // parallel strokes reads as parallel light/dark bands (the high-A van-Gogh signature) even\n // where the underlying colour is flat. s.edgeN is 0 at the edge, 1 at the spine.\n float ridgeShade = smoothstep(0.0, 0.55, s.edgeN);\n c *= 1.0 + (ridgeShade - 0.5) * 0.30;\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n // OKLab OVER-composite on the painterly stroke mediums (overlap mixes as pigment,\n // not grey); the smooth pole never reaches paintOver, so it keeps the cheap path.\n col = isPainterlyStroke() ? paintOverOklab(col, c, alpha) : mix(col, c, alpha);\n\n // ── Accumulate paint height. Thickness peaks at the stroke spine and\n // falls toward the impastoFloor at the edge (edgeN: 0=edge, 1=spine), perturbed by\n // the bristle streak so ridges/grooves form. The relight reads the gradient of this\n // field. The van-Gogh profile's floor=1.0 gives every atomic dab a full-height crown.\n float ridge = 0.7 + 0.3 * (streak + 0.5);\n float crown = impastoFloor + (1.0 - impastoFloor) * s.edgeN;\n height += s.coverage * impastoAmp * crown * ridge * alpha;\n}\n\n// Relight the accumulated paint height. Derive a normal from the height\n// gradient (dFdx/dFdy — derivatives are in-pattern; fwidth is already used for AA),\n// then apply diffuse + Blinn specular from the movable uLightDir/uLightColor source.\n// LINEAR-space lighting BEFORE aces() (the tonemap/OETF stay locked); thin strokes\n// inherit a low shininess, thick impasto raises it (high-height ridges catch a sharp\n// glint). canvasBase is the tooth height so the canvas weave also catches the light.\nvec3 relightImpasto(vec3 col, float height, float canvasBase) {\n float h = height + canvasBase;\n // Height-gradient normal. heightScale trades relief depth for surface flatness.\n float heightScale = 6.0;\n vec3 N = normalize(vec3(-dFdx(h) * 40.0, -dFdy(h) * 40.0, 1.0 / heightScale));\n vec3 L = normalize(uLightDir);\n vec3 V = vec3(0.0, 0.0, 1.0); // view straight on\n vec3 H = normalize(L + V);\n float diff = max(dot(N, L), 0.0);\n // Thick impasto → high shininess (sharp glint); thin paint → broad soft sheen.\n float shininess = mix(8.0, 64.0, clamp(height * 2.0, 0.0, 1.0));\n float spec = pow(max(dot(N, H), 0.0), shininess);\n // Modulate the lit terms by how much paint sits here (no relief on bare ground).\n float relief = clamp(h * 1.5, 0.0, 1.0);\n vec3 lit = col * (1.0 + uImpasto * relief * (diff - 0.5) * 0.5 * uLightColor);\n // The specular glint is gated to ACCUMULATED-thick paint (height²) — a per-fine-stroke\n // sharp glint on every thin fill dab read as bright isotropic SPECKLE that buried the\n // directional stroke bands (the §4.2 anisotropy / §4.3 slope sink on the low-contrast\n // oil field). Only where real impasto has built up does the raked glint fire, so the\n // highlight tracks the macro ridges, not the fine speckle.\n float specGate = clamp(height, 0.0, 1.0);\n lit += uImpasto * relief * spec * specGate * 0.5 * uLightColor;\n return lit;\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\n// energyGrade — the SBR energy-grade magnitude (0 = none, the oil/oil-pastel\n// baseline; 1 = the full van-Gogh Starry-Night cascade — long\n// confident strokes in the lights/coherent zones, short dabs in\n// the darks/flat zones). The van-Gogh profile carries 1.0 (the\n// energy grade is a PROFILE field, not a buried uMedium==5 branch).\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed,\n float energyGrade) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate — noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction source from the strokeOrient switch:\n // uStrokeOrient==0 (flow) — the layer-provided hand-authored flowField.\n // uStrokeOrient==1 (tensor) — the structure-tensor minor eigenvector at the\n // cell center (the color field's edge-tangent),\n // so strokes hug the color zones (van Gogh).\n // coh carries the per-cell coherence A for the energy grading (long\n // confident strokes where structure is coherent, stubby dabs in flat zones).\n vec2 f;\n float coh = 1.0;\n if (uStrokeOrient == 1) {\n // vec4 (the metal-finish widen) — .xy tangent + .z coherence; the .w gradient lane\n // is unused here. A vec3 local would be a type-mismatch WebKit rejects (L1c).\n vec4 tf = structureTensorField(center, t, safeDir(flow));\n f = safeDir(tf.xy);\n coh = tf.z;\n } else {\n f = safeDir(flow);\n }\n // Per-stroke deterministic local perturbation so alternate stroke layers stay\n // live. Tensor strokes get FAR less angular jitter (the field already orients them\n // — over-jittering the tensor strokes scatters their directions and the rendered\n // field reads isotropic, the §4.2 anisotropy floor). The flow-oriented (non-tensor)\n // strokes keep the full jitter (they have no per-cell orientation source).\n float jScale = (uStrokeOrient == 1) ? 0.15 : 1.0;\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9 * jScale; // +/- 0.45/0.07 rad\n float curlScale = (uStrokeOrient == 1) ? 0.30 : 1.0;\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl * curlScale;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n // The SBR energy grade is a profile field (energyGrade), not a buried\n // uMedium==5 branch. The van-Gogh profile passes energyGrade=1.0 (the full\n // Starry-Night cascade); oil/oil-pastel pass 0.0 (uniform length). The grade\n // modulates stroke length by local luminance (bright → long confident strokes,\n // dark → short dabs, the Kolmogorov/Batchelor congruence) AND by coherence\n // (coherent zones → long, flat → stubby), lerped in by energyGrade so a profile\n // can dial the cascade from off (0) to full (1).\n float energy = 1.0;\n if (energyGrade > 0.001) {\n float luma = clamp(dot(sampleBase(center, t), W_LUMA), 0.0, 1.0);\n float graded = mix(0.5, 1.5, luma) * mix(0.6, 1.0, coh);\n energy = mix(1.0, graded, energyGrade);\n }\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0)) * energy;\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n", Oe = "// ── Van Gogh atomic-dab body ─────────────────────────────────────────────\n// Van-Gogh does NOT route through the shared\n// oil paintStrokeMedium cascade — four DENSE layers of LONG-THIN tensor-oriented\n// strokes (lenMul up to 5.2, widMul 0.22) hugging a continuous coherent field. Packed\n// that tight, thin strokes that follow continuous iso-bands MERGE into smooth flowing\n// filaments — the \"marbled flow-bands\" read (a spirograph/fingerprint, not impasto),\n// AND the per-cell 8-tap structure tensor × 4 layers × 9 cells = ~324 sampleBase/pixel\n// runs at ~4fps. Van Gogh's sky is NOT continuous flow — it is DISCRETE, SHORT,\n// LOADED comma dabs, separated by visible ground, queued into swirl ROWS.\n//\n// This is a purpose-built two-layer DAB pass, disjoint from the oil cascade:\n// • orientation from the analytic SWIRL flowField (van-Gogh skies ARE swirl rows) +\n// per-cell angular jitter — NOT the expensive per-cell tensor (the lag source, and\n// the marble source: a jittered discrete dab can NOT merge into a continuous\n// filament the way a tensor-locked thin stroke does).\n// • SHORT comma dabs (len/wid ≈ 2.6 : 1 — a loaded crescent mark, not a 10:1\n// filament), so each reads as a SEPARABLE atom.\n// • SPARSE placement with visible inter-dab ground (density ≈ 0.42), over a darkened\n// swirl underpainting (the Starry-Night visible ground the bright dabs read over).\n// • a single sampleBase per cell + OKLCh broken-color jitter (pigment shimmer);\n// full-height impasto crown per dab (each catches its own raked glint).\n// This is ~2 layers × 9 cells × ~1 sampleBase ≈ 20/pixel (a ~16× cost cut, ~60fps), and\n// jittered short dabs CANNOT marble.\n\n// One atomic comma dab — a CLEAN analytic crescent SDF (NOT the oil curvedStroke).\n// The oil curvedStroke's spine-projection + rounded end-caps + fwidth-AA + bristle\n// edge each leave a thin sub-pixel skirt, and a field of those skirts over open ground\n// abuts into a faint network of SEAM LINES. A van-Gogh dab needs none of that\n// machinery — it is a short oriented capsule (rounded line segment) whose half-width\n// tapers along its length (the loaded-head → dragged-tail comma). The capsule SDF is\n// derivative-free (smoothstep AA against the analytic distance), so no fwidth skirt, no\n// best-of-9 seam. Returns a StrokeHit (coverage/color/alongT/edgeN) for paintOver.\n// cellSize — dab cell pitch (UV units); lenMul/widMul — dab aspect off the cell;\n// density — placement gate (sparse → visible gaps); seed — layer decorrelation.\nStrokeHit vangoghDab(vec2 p, float cellSize, float lenMul, float widMul,\n float density, float jitterAmt, float angJitter,\n vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n StrokeHit best = noHit();\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n // Sparse density gate — leaves visible canvas ground between dabs (atomicity).\n if (hash21(cc * 1.7 + seed * 0.3) > density) continue;\n vec2 jit = (hash22(cc + seed) - 0.5) * jitterAmt;\n vec2 center = (cc + 0.5 + jit) * cellSize;\n\n // Orientation: the analytic swirl flow at the cell center + per-cell angular\n // jitter (so adjacent dabs FAN — the divisionist scatter that keeps the dabs from\n // locking into perfectly-concentric rows) + a flow-noise curl wobble.\n float ang = (hash21(cc + seed + 11.0) - 0.5) * angJitter;\n float curl = (fbm(center * 3.1 + seed * 1.9) - 0.5) * (0.18 + 0.3 * uFlowCurl);\n vec2 dir = rotateDir(safeDir(flow), ang + curl);\n\n // SHORT comma — len ≈ the cell pitch (a contained dab, not a tiling filament).\n float len = cellSize * lenMul * (0.82 + 0.30 * hash21(cc + seed + 23.0));\n float halfW = max(cellSize * widMul * (0.86 + 0.28 * hash21(cc + seed + 41.0)), 0.010);\n\n // Local dab frame: along = projection onto the dab axis (centred 0), perp = cross.\n vec2 rel = p - center;\n float along = dot(rel, dir);\n float perp = dot(rel, vec2(-dir.y, dir.x));\n // The comma TAPER: half-width peaks ~1/3 from the loaded head and drags to a fine\n // tail (the asymmetric crescent). u in [0,1] along the dab from head to tail.\n float halfLen = len * 0.5;\n float u = clamp((along + halfLen) / max(len, 1e-5), 0.0, 1.0);\n float head = smoothstep(0.0, 0.30, u); // rounded loaded head\n float tail = pow(clamp((1.0 - u) / 0.70, 0.0, 1.0), 1.3); // dragged thin tail\n float prof = clamp(min(head, tail) * 1.05, 0.0, 1.0);\n float wNow = halfW * prof;\n // A gentle comma CURVE — bow the spine sideways so the mark reads as a crescent.\n float bowAmt = (hash21(cc + seed + 53.0) - 0.5) * halfW * 1.4;\n float spine = bowAmt * sin(u * PI); // 0 at ends, max mid\n float d = abs(perp - spine);\n // Derivative-free AA: a fixed fraction of the dab width (no fwidth skirt). Coverage\n // is 1 in the dab body, smoothly 0 at the edge; outside the [head,tail] span wNow→0\n // so the dab self-terminates with no end-cap blob.\n float aa = max(halfW * 0.45, 0.002);\n float cov = (wNow > 1e-5) ? (1.0 - smoothstep(wNow - aa, wNow + aa, d)) : 0.0;\n if (cov < 0.004) continue;\n\n // One sampleBase per cell + OKLCh broken-color jitter (pigment patch shimmer). The\n // dab pigment is chroma-boosted (saturate3 1.22) AND value-lifted (×1.14) at the\n // SOURCE — the loaded brush mark deposits BRIGHTER + more saturated pigment than the\n // base field, so the loaded-mark pixels lift BOTH the §4.1 colourfulness AND the field\n // mean-luma. The higher mean raises the gap-fraction threshold (meanLum·0.6) so the\n // moderate-depth inter-dab ground falls below it (the gap-fraction atomicity read is\n // DECOUPLED from the ground floor depth — the ground can stay only moderately dark, so\n // the §4.3 slope is NOT over-steepened, while the bright dabs manufacture the gap). The\n // dark ground is untouched, so this lifts C + gap WITHOUT a band-conflicting deep ground.\n vec3 colMid = brokenColorJitter(\n saturate3(sampleBase(center, t), 1.22),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n // edgeN: 1 at the spine, 0 at the edge (the impasto crown reads it).\n float edgeN = (wNow > 1e-5) ? clamp(1.0 - d / wNow, 0.0, 1.0) : 0.0;\n if (cov > best.coverage) {\n best = StrokeHit(cov, colMid, u, (wNow > 1e-5 ? (perp - spine) / wNow : 0.0), edgeN);\n }\n }\n }\n return best;\n}\n\nvec3 mediumVangogh(vec3 col, vec2 p, float t) {\n vec3 result = col;\n float height = 0.0;\n\n // The swirl flow basis (van-Gogh sky = swirl rows). Computed ONCE per pixel.\n vec2 flow = flowField(p, t);\n\n // Dab cell pitch in UV [0,1]. CHUNKY, SEPARABLE marks — the big layer is ~1/14 of\n // the frame so it reads as a distinct loaded brush dab (not a fine speckle, not a\n // screen-spanning filament). uStrokeScale (authored ~110) modulates the pitch\n // INVERSELY (higher = finer dabs) around the ~0.07 chunky default; clamped so the\n // dab never collapses to noise or balloons past one screen. uStrokeAnisotropy\n // stretches the comma aspect (longer, more directional marks).\n float pitch = clamp(7.0 / max(uStrokeScale, 20.0), 0.044, 0.12);\n // The dab LENGTH ≈ the cell pitch (lenAniso ~1.2-1.7) so a dab sits WITHIN its cell\n // and leaves visible ground around it — a longer dab (lenMul > 2) spans neighbour\n // cells and tiles the field into continuous coverage (no gaps, the gap-fraction floor\n // miss + the marble). Narrow width keeps it a directional crescent, not a wide shard.\n // lenAniso/widAniso — the comma aspect. The current profile lengthens\n // the comma (1.25-1.75 → 1.5-2.0) and THINNED it (0.40-0.30 → 0.32-0.24): the rebuilt\n // dabs measured §4.2 structure-tensor anisotropy A=0.699, BELOW the reference band\n // floor 0.732 (the dabs read slightly too short-fat → locally isotropic, dragging mean\n // A down). A LONGER, THINNER comma hugs the swirl-flow tangent more strongly so the\n // rendered field reads coherent the way the tensor metric measures it (A lift), while\n // the thinner width LEAVES MORE inter-dab ground (the gap-fraction atomicity read is\n // preserved, not closed). The length stays ≈ the cell pitch so each dab remains a\n // CONTAINED separable mark, not a tiling filament.\n float lenAniso = mix(2.1, 2.7, uStrokeAnisotropy); // comma length / cell pitch (a contained dab)\n float widAniso = mix(0.23, 0.16, uStrokeAnisotropy); // comma width / cell pitch (a thin loaded crescent)\n\n // Layer 1 — the big swirl-row dabs: the loaded gestural marks, SPARSE so the dark\n // underpainting shows BETWEEN them (the atomicity read — visible inter-dab ground).\n // hardness 0.74 — the loaded brush deposits with a SOFT shoulder, so adjacent dabs\n // feather instead of razor-clipping into hard polygon shards. jitterAmt 0.85 fully\n // scatters the cell centres so the placement GRID never reads as a periodic seam.\n // angJitter EASED 0.55 → 0.38 (the reconcile A lift): a tighter angular spread keeps\n // adjacent dabs more flow-aligned (coherent) while the per-cell curl wobble still\n // breaks the perfectly-concentric-rows read (the dabs FAN gently, not lock to a grid).\n // angJitter eased 0.38 → 0.26 + hardness 0.74 → 0.84 (the §4.2 A lift): a tighter angular\n // spread keeps adjacent dabs strongly flow-aligned (the structure-tensor coherence) and a\n // sharper edge gives each dab a STRONGER directional gradient (a soft dab's faint edge\n // reads weakly anisotropic). The per-cell curl wobble still breaks the perfectly-\n // concentric-rows read, so the dabs FAN gently rather than locking to a grid.\n StrokeHit dBig = vangoghDab(p, pitch, lenAniso, widAniso,\n 0.30, 0.50, 0.08, flow, t, 1.3);\n // streakFreq raised 14 → 34 (the §4.3 slope fix): a high-frequency streak runs ALONG the\n // dab spine, injecting fine-scale luma energy that flattens the too-steep β WITHOUT\n // adding new isotropic marks (the along-spine streak stays directional, so the §4.2\n // anisotropy the long-thin dab carries is preserved — the band-conflict resolution).\n paintOver(result, height, dBig, 48.0, 0.34,\n uImpasto * 0.75 * uStrokeAmount, 0.84, 1.3, 1.0 /* full crown */);\n\n // Layer 2 — two-thirds-pitch accent dabs (the divisionist sparkle between the big\n // marks — denser placement but still contained dabs, so dark canvas survives between).\n // angJitter eased 0.5 → 0.34 (same A-lift reasoning — the accent dabs queue along the\n // flow rather than scattering isotropically); hardness 0.78 → 0.86 sharpens the gradient.\n StrokeHit dSml = vangoghDab(p + vec2(-5.1, 8.4), pitch * 0.62, lenAniso * 0.95,\n widAniso * 0.95, 0.36, 0.60, 0.20, flow, t, 4.1);\n paintOver(result, height, dSml, 42.0, 0.22,\n uImpasto * 0.55 * uStrokeAmount, 0.86, 4.1, 1.0);\n\n // Layer 3 — fine divisionist flecks. The two-layer\n // field read as a few BIG cobalt dabs over a smooth empty teal ground (the side-by-side\n // against starry-night-crop.png: the painting is DENSE small varied flecks, not sparse\n // large marks). The flecks are LONG·THIN directional commas hugging the swirl tangent\n // (the A-preserving fleck — short fat flecks read isotropic and drag §4.2 down). Sparse\n // density 0.30 keeps the inter-fleck ground open (the gap-fraction atomicity read).\n // The flecks are FINE (≈0.42× pitch) directional commas, tightly flow-aligned (angJitter\n // 0.22) and SPARSE (0.30) — the divisionist sparkle between the loaded marks that keeps\n // the inter-dab ground open (atomicity) while adding the small-mark mid-band energy. Thin\n // + flow-aligned so the §4.2 anisotropy the long dabs carry survives the added small marks.\n StrokeHit dFleck = vangoghDab(p + vec2(8.7, -3.2), pitch * 0.42, lenAniso * 1.0,\n widAniso * 0.68, 0.30, 0.85, 0.22, flow, t, 7.7);\n paintOver(result, height, dFleck, 30.0, 0.16,\n uImpasto * 0.40 * uStrokeAmount, 0.80, 7.7, 1.0);\n\n // ── Flow-aligned ground swirl grooving ─────────────────────────\n // The bare ground between the dabs was a SMOOTH low-frequency teal gradient — the §4.3\n // power-spectrum slope ran too STEEP (β≈−2.0: too much low-frequency nuclei-field energy\n // vs the high band). Van Gogh's actual sky has the swirl BRUSHWORK everywhere, so groove\n // the OPEN GROUND with a flow-aligned ripple. It is SUBTRACTIVE-biased (it only darkens,\n // never brightens the ground), so it DEEPENS the inter-dab valleys (MORE gap-fraction —\n // atomicity preserved/strengthened) while injecting the across-flow mid-band luma energy\n // that flattens β. Gated to the open ground (low height) via the (1-height) gate so it\n // never lifts/erodes the loaded dab bodies (the dab read is untouched). Across the swirl\n // FLOW axis so the grooves run WITH the sky's brushwork direction.\n // The ground swirl-combing — a FIXED-global-angle directional grain on the open ground.\n // A flow-FOLLOWING comb varies its direction with the swirl across the readback window,\n // so its blurred structure tensor averages toward isotropic (no §4.2 lift). A comb at one\n // GLOBAL angle (van-Gogh's dominant diagonal stroke grain) is COHERENT over the whole\n // window ⇒ every open-ground pixel reads the SAME direction (the §4.2 mean-anisotropy lift\n // the swirl comb could not reach). Two resolved bands (≈22 + ≈44 across the global axis ⇒\n // ~21px + ~11px at 464px, both in the §4.3 fit window) also feed the β flatten. Gated to\n // the open ground (low height) so the loaded dabs are untouched; SUBTRACTIVE-biased so the\n // inter-dab valleys deepen (gap-fraction preserved, not filled).\n vec2 gdir = normalize(vec2(0.82, 0.57)); // the dominant global stroke grain axis\n float gacross = dot(p, vec2(-gdir.y, gdir.x));\n float groundGate = 1.0 - smoothstep(0.05, 0.28, height);\n float groove = sin(gacross * 22.0) + 0.5 * sin(gacross * 44.0 + 1.3);\n result *= 1.0 - 0.16 * groundGate * (0.5 - 0.5 * groove);\n\n // Canvas tooth (fine linen weave — base relief the raking light catches).\n float tooth1 = vnoise(p * 220.0);\n float tooth2 = vnoise(p * 220.0 * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * 0.06 * uCanvasGrain;\n\n // Relight the accumulated impasto height (raking light catches each dab's crown —\n // the visible impasto ridge that makes a dab read as a RAISED loaded mark).\n float canvasBase = tooth * 0.06 * 0.5;\n result = relightImpasto(result, height, canvasBase);\n\n // The visible Starry-Night GROUND — the open canvas between dabs (low accumulated\n // height) darkens toward the deep underpainting, so the bright impasto dabs read as\n // SEPARABLE atomic marks over a darker field (the dab↔ground contrast the user's\n // \"reads as strokes\" bar needs, AND the painterly-statistics gap-fraction floor — the\n // dark inter-dab ground must register as a measurable fraction of the field). 0.30\n // floor over a WIDER smoothstep (0..0.40): deep enough that the open gaps read as the\n // dark Starry-Night sky between marks (clearing the 4% gap floor) while the gradual\n // ramp keeps the gaps reading as flowing underpainting, not the hard black ink LINES a\n // narrow near-black step (0.26 / 0.0..0.32) produced.\n // The smoothstep FLOOR starts at 0.10 (not 0): a dab's faint AA coverage TAIL deposits\n // a sliver of height, and where many tails align along the swirl flow those slivers\n // accumulate into a faint continuous height ridge that read as thin curved LINES in the\n // ground. Holding the ground full-dark until a real dab CORE (height > 0.10) lifts out\n // keeps the open field clean — only the loaded dab bodies emerge, the tails stay ground.\n result *= mix(0.115, 1.0, smoothstep(0.085, 0.31, height));\n\n // The van-Gogh chroma — a light OKLCh punch at 0.92 in the\n // The discrete-dab profile's per-dab OKLCh\n // broken-color jitter (the ±16° hue + ±chroma swing per cell) lifts the field's\n // colourfulness on its own, so a 1.04 punch on TOP overshoots the\n // reference band (rendered C=100.5 vs the painting's measured 70.67 ± 15/+25 →\n // ceiling 95.67 — neon, not Starry Night's rich-but-not-garish blue/gold). The 0.92\n // demote pulls the rendered colourfulness back IN-band while the broken-color jitter\n // keeps the per-dab pigment variation (the discrete-stroke read is untouched — this\n // is a chroma scale, not a dab-geometry change). Band-anchored on the real painting\n // not a widened band.\n result = saturate3(result, 1.0);\n return result;\n}\n\n", ke = "StrokeProfile profileFor(int medium, int mode) {\n // The oil baseline (mode 0) — balanced modern-abstract/palette-knife hybrid.\n StrokeProfile prof = StrokeProfile(\n 0, // shapeType — tapered\n 0.25, // bristleAmp\n 9.0, // streakFreq\n 0.09, // streakAmp\n 0.9, // impastoAmp\n 0.80, // hardness\n 340.0, // toothScale — finer 240 → 340. Oil's β sat\n // right AT the −1.45 band ceiling (±0.02 frame variance straddling\n // it, surfaced once the vangogh bands went green and the spec reached\n // the oil β assert). MEASURED on the live GPU: ADDING fine high-\n // frequency tooth energy steepens oil's power-spectrum slope (more\n // negative — coarsening it the other way pushed β SHALLOWER to\n // −1.33). A finer, stronger tooth moves β to a safe distance inside\n // the −5/3 band [−1.85, −1.45]. Oil-only (oil-pastel sets 280).\n 0.14, // toothAmp — raised 0.09 → 0.14 (same oil-β steepen: more fine-grain high band).\n 1.03, // pigmentSat\n 0.65, // densityBig\n 0.78, // densityMed\n 0.90, // densitySml\n 0.0, // energyGrade — oil is uniform-length (no Starry-Night cascade)\n 0.4, // impastoFloor — oil's 0.4+0.6·edgeN crown falloff\n 0.92, // densityFill — oil fills DENSELY with the directional low-relief fill so the\n // flat-colour regions between the macro strokes are TEXTURED with\n // flow-aligned fine strokes (the §4.2 anisotropy needs every pixel\n // to carry directional gradient; a flat untextured region reads as\n // an isotropic/degenerate tensor and drags mean A down). The fill\n // is now directional + low-streak, so dense coverage textures\n // WITHOUT the round-dab speckle.\n 1.0 // groundFloor — oil keeps the full base (no ground darken; fills everywhere)\n );\n\n // The Van Gogh medium does NOT route through this oil\n // StrokeProfile cascade. It is a DEDICATED atomic-dab body (mediumVangogh / vangoghDab\n // below) — a profile-driven cascade (four dense layers of long-thin\n // tensor-oriented strokes) merges into the \"marbled flow-bands\" read and runs at ~4fps.\n // profileFor now serves ONLY the oil + oil-pastel stroke mediums; the MEDIUM_VANGOGH\n // case is removed (no caller). MEDIUM_VANGOGH stays #define'd (the main() dispatch +\n // isPainterlyStroke still key off uMedium==5).\n\n // ── Oil-pastel — broad smeared directional strokes deposited via the brush engine\n // Creamy soft edges (low hardness), heavy build-up, and a chroma punch.\n // Distinct from the dry-crayon tooth-multiply (mediumCrayon): oil-pastel LAYS strokes.\n if (medium == MEDIUM_OILPASTEL) {\n prof.shapeType = 0; // tapered directional smear — a round dab reads locally\n // isotropic (steep β / low A); the creamy oil-pastel mark\n // is a broad DIRECTIONAL smear, which carries the §4.2\n // coherence + adds the directional mid-band the §4.3 slope\n // needs (the round-dab profile rolled β off to −2.8)\n prof.bristleAmp = 0.10; // smooth creamy edges (waxy pastel, not bristle)\n prof.streakFreq = 18.0; // finer internal smear — adds the mid/high-band the smooth\n // round-dab profile lacked (the β-too-steep fix); the\n // directional along-spine streak flattens the §4.3 slope\n // without crossing the strokes\n prof.streakAmp = 0.20;\n prof.impastoAmp = 0.7; // build-up, but flatter than oil impasto\n prof.hardness = 0.42; // CREAMY — soft compositing, strokes blend on overlap\n prof.toothScale = 280.0;\n prof.toothAmp = 0.12; // the pastel tooth reads stronger\n prof.pigmentSat = 0.80; // the waxy chroma — kept low so the rendered C clears\n // the §4.1 band ceiling with margin while the K-M subtractive\n // overlap path (paintOverOklab) keeps the chroma OFF the grey floor\n prof.hardness = 0.58; // creamy but the strokes still REGISTER — a too-soft blend\n // (0.42) smeared the marks into the smooth colour zones and\n // the field rolled off too steep (β≈−2.9, a near-gradient);\n // a crisper deposit keeps the mid/high-band the −5/3 slope needs\n prof.densityBig = 0.62; // broad directional coverage — but NOT over-dense: too many\n // overlapping creamy strokes point in slightly-varied\n // directions and the local §4.2 coherence DROPS (over-dense\n // measured A=0.57 < the 0.62-density A=0.63). The mid-density\n // flow-aligned deposit is the coherence sweet spot.\n prof.densityMed = 0.78;\n prof.densitySml = 0.90;\n prof.energyGrade = 0.80; // a strong Starry-Night length cascade — varies stroke length\n // by luma/coherence so the dab-size energy spreads across\n // scales (the −5/3 cascade the uniform-length 0.0 grade lacked,\n // the §4.3 β-too-steep fix). Not the full van-Gogh 1.0 (oil-\n // pastel keeps its creamy broad character).\n prof.impastoFloor = 0.55; // a softer crown than van-Gogh's full-height glint\n return prof;\n }\n\n // ── Oil sub-modes (mode dispatch on the oil medium).\n if (mode == 1) { // palette knife — razor edges, heavy impasto\n prof.shapeType = 3; // flat, even\n prof.bristleAmp = 0.12;\n prof.streakFreq = 4.0; prof.streakAmp = 0.05;\n prof.impastoAmp = 1.6;\n prof.hardness = 0.95;\n prof.toothAmp = 0.04;\n prof.densityBig = 0.80; prof.densityMed = 0.88; prof.densitySml = 0.70;\n } else if (mode == 3) { // thick brushwork — heavy bristle brush\n prof.shapeType = 0; // tapered\n prof.bristleAmp = 0.32;\n prof.streakFreq = 14.0; prof.streakAmp = 0.14;\n prof.impastoAmp = 1.2;\n prof.hardness = 0.85;\n prof.toothAmp = 0.07;\n }\n return prof;\n}\n", Ae = "\n// ── Gradient pack ──────────────────────────────────\n// structureTensorField re-plumbs its already-computed luma gradient (Gx,Gy) out through\n// the vec4 return value's .w lane so the metal medium pays ZERO extra taps (a second Sobel is\n// 8 sampleBase() taps). 12 bits per bounded component ([-4,4]) into one f32, exact under\n// highp; the .xy/.z crayon/kuwahara callers are transparent to the widen.\nfloat packGrad(float gx, float gy) {\n float qx = floor(clamp(gx * 0.125 + 0.5, 0.0, 1.0) * 4095.0);\n float qy = floor(clamp(gy * 0.125 + 0.5, 0.0, 1.0) * 4095.0);\n return qx + qy * 4096.0;\n}\nvec2 unpackGrad(float packed) {\n float qy = floor(packed * (1.0 / 4096.0));\n float qx = packed - qy * 4096.0;\n return (vec2(qx, qy) * (1.0 / 4095.0) - 0.5) * 8.0;\n}\n", je = "#define MEDIUM_METAL 8\n#define MEDIUM_METALGRAD 9\n\n// ── Metal — two-term anisotropic BRDF over the field relief (uMedium==8/9) ──\n// Metal is a MUTUALLY-EXCLUSIVE medium (NOT a finish axis) — the field re-lights as\n// warm folded metal: the luma HEIGHT field (the packed structure-tensor gradient →\n// the surface normal) catches an anisotropic Blinn streak (brushed metal, the streak\n// runs ALONG the coherent edge-tangent) plus a sharp crest, both raked by a cursor-\n// synthesized light that reads on BOTH backends (uCursor is in-struct — a phantom\n// uLightDir read would be flat on the WGSL primary). The catch is the ACHROMATIC-WARM\n// anchor (AURORA_CATCH_LIGHT_ANCHOR ≈ [1.0,0.97,0.90], never a cold chrome-blue). The\n// body keeps the field HUE (technicolor valley base); the height rides the relief.\n// ZERO new taps — structureTensorField already computed the gradient (unpacked from .w).\nconst vec3 METAL_CATCH_WARM = vec3(1.0, 0.97, 0.90); // AURORA_CATCH_LIGHT_ANCHOR\nconst float METAL_HEIGHT_SCALE = 2.2; // gradient → normal tilt (× uMetalHeightScale)\nconst float METAL_LIGHT_Z = 0.55; // synth-light z (toward viewer)\nconst vec2 METAL_IDLE_RAKE = vec2(0.32, 0.34); // upper-right idle rake bias\nconst float METAL_SHININESS_ANISO = 6.0; // anisotropic streak exponent (brushed)\nconst float METAL_SHININESS_CREST = 40.0; // crest specular exponent (sharp)\nconst float METAL_COHERENCE_FLOOR = 0.22; // streak gates on edge coherence A\nconst float METAL_BODY_FLOOR = 0.42; // diffuse valley floor (dark side reads)\nconst float METAL_GRADIENT_FLATTEN = 0.55; // metal-gradient pre-flatten toward luma\nconst float METAL_SPARKLE_DENSITY = 240.0; // metal-gradient per-cell flake grid\nconst float METAL_SPARKLE_THRESH = 0.72; // only some cells flake\nconst float METAL_SPARKLE_AMP = 0.6; // flake glint amplitude\n\n// The shared metal BRDF core — takes the ALREADY-computed structureTensorField vec4 so\n// the caller pays ZERO extra taps (metal-gradient reuses the same stf). WebKit-fenced:\n// every pow base is clamped to [0,1], the exponents are compile-time constants.\nvec3 metalShade(vec3 baseCol, vec2 p, vec4 stf) {\n vec2 tangent = stf.xy;\n float A = stf.z;\n vec2 grad = unpackGrad(stf.w);\n // Height-field normal: N = normalize(vec3(grad * scale, 1)). The luma relief tilts\n // the surface; the flat field reads near vec3(0,0,1) (facing the viewer).\n vec3 N = normalize(vec3(grad * (METAL_HEIGHT_SCALE * uMetalHeightScale), 1.0));\n vec3 V = vec3(0.0, 0.0, 1.0);\n // Cursor-synthesized rake light (in-struct on BOTH backends — never uLightDir). The\n // idle bias keeps a still field lit from the upper-right; a moving cursor rakes it.\n vec3 L = normalize(vec3((uCursor - p) + METAL_IDLE_RAKE, METAL_LIGHT_Z));\n vec3 H = normalize(L + V);\n // Anisotropic streak — brushed metal: the highlight runs ALONG the edge-tangent, so\n // it is a function of the H-component PERPENDICULAR to the tangent (sinTH).\n float tH = dot(normalize(tangent), H.xy);\n float sinTH = sqrt(clamp(1.0 - tH * tH, 0.0, 1.0));\n float streak = pow(clamp(sinTH, 0.0, 1.0), METAL_SHININESS_ANISO);\n float crest = pow(clamp(dot(N, H), 0.0, 1.0), METAL_SHININESS_CREST);\n float spec = streak * crest;\n // Coherence gate — the anisotropic streak reads only where the field has a real edge\n // (a flat zone has no brush direction; A≈0 → no streak).\n spec *= smoothstep(0.0, METAL_COHERENCE_FLOOR, A);\n // Technicolor valley base — the body keeps the FIELD hue; the diffuse term rides the\n // height relief so the ridges brighten and the pits fall toward the floor.\n float diff = clamp(dot(N, L), 0.0, 1.0);\n vec3 body = baseCol * (METAL_BODY_FLOOR + (1.0 - METAL_BODY_FLOOR) * diff);\n // The catch is the achromatic-warm anchor, scaled by the polish knob.\n return body + METAL_CATCH_WARM * (spec * clamp(uMetalPolish, 0.0, 4.0));\n}\n\nvec3 mediumMetal(vec3 col, vec2 p, float t) {\n vec4 stf = structureTensorField(p, t, flowField(p, t));\n return metalShade(col, p, stf);\n}\n\n// metal-gradient (uMedium==9) — the SAME BRDF over a pre-flattened/gradient base + a\n// twinkle-in-place flake sparkle (position FIXED per cell, PHASE-animated, gated on\n// facing — flake glint, never a boil).\nvec3 mediumMetalGradient(vec3 col, vec2 p, float t) {\n vec4 stf = structureTensorField(p, t, flowField(p, t));\n // Pre-flatten toward luma (the smoother gradient-metallic base) — same BRDF, calmer body.\n // NB: flat is a GLSL reserved interpolation qualifier — WebKit's compiler REJECTS it as an\n // identifier (ANGLE tolerates it); named flatCol so the WebKit aurora shader compiles (L1a).\n vec3 flatCol = mix(col, vec3(dot(col, W_LUMA)), METAL_GRADIENT_FLATTEN);\n vec3 metal = metalShade(flatCol, p, stf);\n // The height-field normal facing (recomputed from the same packed gradient — ZERO taps).\n vec2 grad = unpackGrad(stf.w);\n float facing = normalize(vec3(grad * (METAL_HEIGHT_SCALE * uMetalHeightScale), 1.0)).z;\n // Twinkle-in-place: a fixed per-cell flake seed, phase-animated glint gated on facing.\n vec2 cell = floor(p * METAL_SPARKLE_DENSITY);\n float seed = hash21(cell);\n float tw = pow(clamp(sin(t + seed * 6.2831853), 0.0, 1.0), 40.0);\n float flakeGate = step(METAL_SPARKLE_THRESH, seed);\n metal += METAL_CATCH_WARM * (tw * flakeGate * clamp(facing, 0.0, 1.0) * METAL_SPARKLE_AMP);\n return metal;\n}\n", Me = "// ── Medium overlays ───────────────────────────────────────────────────────\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n" + Ae + "\n// ── Structure tensor / edge-tangent flow ───────────────────────────────────\n// The keystone of the painterly engine: derive stroke orientation from the COLOR\n// FIELD's OWN structure, not a hand-authored flow pattern. A 3x3 Sobel over\n// luma(sampleBase) yields the gradient (Gx,Gy); the 2x2 structure tensor\n// J = [[Gx², GxGy],[GxGy, Gy²]] eigen-decomposes closed-form into the MINOR\n// eigenvector (the edge-TANGENT — least color change, the stroke direction) + the\n// coherence A = (λ1-λ2)/(λ1+λ2); flat zones relax toward fallbackDir by (1-A). The\n// single-pass small-tap WebGL2 form. Returns vec4(tangent.xy, A, packGrad(Gx,Gy)) —\n// The .w lane carries the metal medium's gradient; the .xy/.z callers are unchanged.\nvec4 structureTensorField(vec2 p, float t, vec2 fallbackDir) {\n float e = 0.0035; // small-tap neighborhood (edge-mask scale)\n // 3x3 luma samples.\n float l00 = dot(sampleBase(p + vec2(-e, -e), t), W_LUMA);\n float l10 = dot(sampleBase(p + vec2( 0.0, -e), t), W_LUMA);\n float l20 = dot(sampleBase(p + vec2( e, -e), t), W_LUMA);\n float l01 = dot(sampleBase(p + vec2(-e, 0.0), t), W_LUMA);\n float l21 = dot(sampleBase(p + vec2( e, 0.0), t), W_LUMA);\n float l02 = dot(sampleBase(p + vec2(-e, e), t), W_LUMA);\n float l12 = dot(sampleBase(p + vec2( 0.0, e), t), W_LUMA);\n float l22 = dot(sampleBase(p + vec2( e, e), t), W_LUMA);\n // Sobel derivatives.\n float Gx = (l20 + 2.0 * l21 + l22) - (l00 + 2.0 * l01 + l02);\n float Gy = (l02 + 2.0 * l12 + l22) - (l00 + 2.0 * l10 + l20);\n // Structure tensor components.\n float Jxx = Gx * Gx;\n float Jyy = Gy * Gy;\n float Jxy = Gx * Gy;\n // Closed-form 2x2 eigenvalues: λ = 0.5(tr ± sqrt((Jxx-Jyy)² + 4Jxy²)).\n float tr = Jxx + Jyy;\n float disc = sqrt(max((Jxx - Jyy) * (Jxx - Jyy) + 4.0 * Jxy * Jxy, 0.0));\n float lambdaMaj = 0.5 * (tr + disc);\n float lambdaMin = 0.5 * (tr - disc);\n // The MAJOR eigenvector points along the gradient (the edge NORMAL); the MINOR\n // is its perpendicular — the edge TANGENT (the stroke direction). The principal\n // angle is θ = 0.5·atan2(2·Jxy, Jxx-Jyy); this form is robust at Jxy≈0 (where the\n // (λ-Jyy, Jxy) eigenvector formula collapses to a zero vector). The tangent is at\n // θ + 90°. Guard the fully-isotropic (no-gradient) degenerate case → fallback dir.\n vec2 tangent;\n if (disc < 1e-7) {\n tangent = fallbackDir;\n } else {\n float theta = 0.5 * atan(2.0 * Jxy, Jxx - Jyy); // major (gradient) angle\n tangent = vec2(-sin(theta), cos(theta)); // perpendicular = tangent\n }\n // Coherence A in [0,1] — high where one eigenvalue dominates (a strong edge),\n // ~0 in flat zones. Relax toward the smooth fallback by (1 - A).\n float A = (lambdaMaj - lambdaMin) / (lambdaMaj + lambdaMin + 1e-6);\n A = clamp(A, 0.0, 1.0);\n // Coherence-weighted blend: full tensor in coherent zones, smooth in flat ones.\n // Resolve the 180° sign ambiguity toward the fallback so the blend is continuous.\n if (dot(tangent, fallbackDir) < 0.0) tangent = -tangent;\n // The blend weight is a low-power curve (A^0.35) so even MODERATE-coherence zones queue\n // strongly along the tangent (a flowing van-Gogh band reads coherent the way the\n // structure-tensor metric measures it; a linear A under-orients the mid-band and the\n // rendered field reads too isotropic — the §4.2 anisotropy lift). The flat-zone (A≈0)\n // relax to the fallback survives (0^0.35=0), so tensor noise never reads as jitter.\n float blendW = pow(A, 0.28);\n vec2 dir = normalize(mix(fallbackDir, tangent, blendW) + 1e-6);\n return vec4(dir, A, packGrad(Gx, Gy));\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation — pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding — faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth — tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n", Ne = "// ── Medium id constants (mirror uniformBridge.ts MEDIUM_ID — the uMedium ladder) ──\n// The StrokeProfile selector dispatches on the medium id: oil,\n// van-Gogh, and oil-pastel each AUTHOR a first-class profile in profileFor.\n#define MEDIUM_OIL 3\n#define MEDIUM_CRAYON 4\n#define MEDIUM_VANGOGH 5\n#define MEDIUM_OILPASTEL 6\n\n// ── Crayon — DRY wax pigment on paper tooth (first-class medium, uMedium==4) ──\n// Crayon is not strokes. It's dry pigment crumbs dragged across paper tooth — the\n// DRY tooth-multiply model: anisotropic tooth noise multiplied into the base, a hard\n// SCUMBLE that lets the lower color show through the broken upper layer, and stable\n// OKLCh broken-color pigment patches. NO sheen, NO burnish film — that waxy gloss is\n// the OIL-PASTEL deposition's signature (mediumOilPastel), distinct from dry crayon\n// split. Crayon shares the substrate (the structure-tensor\n// orientation, the tooth noise, OKLCh brokenColorJitter), not the dispatch body.\nvec3 mediumCrayon(vec3 col, vec2 p, float t) {\n // Orient the deposition along the structure-tensor edge-tangent (the bridge forces\n // tensor for crayon, so read the tensor field directly).\n vec2 flow = structureTensorField(p, t, flowField(p, t)).xy;\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n // ── Paper TOOTH height field — the relief the dry pigment rides. Anisotropic\n // (squished along flow, coarse cross-flow). Peaks = ridges, valleys = paper pits.\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n\n // ── DRY TOOTH-MULTIPLY — the crayon multiplies the tooth relief into the base\n // color (dark in the pits, bright on the ridges). The pressure (uStrokeAmount) sets\n // how hard the multiply bites. This is the DRY model — no pigment build-up, no sheen.\n float pressure = clamp(uStrokeAmount, 0.0, 1.0);\n float bite = mix(0.18, 0.46, pressure); // multiply strength\n vec3 result = col * (1.0 - bite * (0.5 - tooth));\n\n // ── HARD SCUMBLE — a broken upper layer that lets the lower color show through the\n // gaps. A coarse mask gates a HARD (high-contrast) dragged pass so the dry crayon\n // reads as broken pigment crumbs, not a smooth wash. Drag follows the tensor flow.\n float scumbleMask = smoothstep(0.42, 0.78, vnoise(vec2(pr.x * scale * 0.55, pr.y * scale * 0.22) + 7.0));\n float scumbleCoverage = scumbleMask * pressure * 0.7; // hard broken upper layer\n vec3 paper = col * mix(0.80, 0.94, pressure); // the paper showing through\n result = mix(paper, result, scumbleCoverage);\n\n // ── Broken-color pigment: stable wax/pigment patches in OKLCh, not flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified (the wax chroma punch — but DRY, no sheen).\n result = saturate3(result, 1.08);\n\n return result;\n}\n\n// ── StrokeProfile — the oil-stroke parameter vector ────────────────────────\n// The SBR \"stroke = parameter vector\" canon (facet 11): the per-mode if-ladder knobs\n// become struct FIELDS — logic-as-DATA, not an imperative branch. profileFor(medium,\n// mode) populates the profile for a (medium, mode) pair; paintStrokeLayers(profile) runs\n// the four-layer bestOil/paintOver cascade off it. A new medium, such as van-Gogh or\n// oil-pastel, authors a profile entry; it never edits a monolith.\nstruct StrokeProfile {\n int shapeType; // 0 tapered, 1 load-drag, 2 dab, 3 even, 4 comma/crescent\n float bristleAmp; // edge raggedness 0..0.5\n float streakFreq; // internal-streak spatial frequency\n float streakAmp; // internal-streak amplitude\n float impastoAmp; // paint-thickness contribution (the relight reads the height)\n float hardness; // edge-compositing crispness 0..1\n float toothScale; // canvas-tooth (linen weave) spatial frequency\n float toothAmp; // canvas-tooth amplitude\n float pigmentSat; // pigment saturation boost (OKLCh chroma scale)\n float densityBig; // layer-1 (big gestural) placement density gate\n float densityMed; // layer-2 (medium body) placement density gate\n float densitySml; // layer-3 (small dabs) placement density gate\n float energyGrade; // SBR energy-grade magnitude (0 off; 1 the van-Gogh\n // Starry-Night length cascade). The energy grade is a PROFILE\n // field, NOT a buried uMedium==5 bestOil branch.\n float impastoFloor;// Per-stroke height-crown floor (0.4 oil falloff;\n // 1.0 van-Gogh FULL-height crown so each dab catches its glint).\n float densityFill; // Layer-4 fill-dab density. Oil/oil-pastel fill the\n // bald spots (0.95, full coverage); van-Gogh sets it LOW so the\n // sparse atomic dabs keep their visible inter-stroke ground gaps\n // (the atomicity read — a 0.95 fill would close every gap to a smear).\n float groundFloor; // Bare-ground darken floor. The gaps between strokes\n // (low accumulated height) multiply toward this floor, so van-Gogh's\n // sparse atomic dabs read over a visibly darker underpainting (the\n // Starry-Night visible ground). Oil/oil-pastel keep 1.0 (no darken).\n};\n\n// The (medium, mode) -> StrokeProfile selector. The if-ladder's knobs are the profile's\n// fields; a new medium adds a CASE here (never an edit to a dispatch body). mode is the\n// uStrokeMode oil-stroke sub-mode (0 oil, 1 palette-knife, 3 brushwork). crayon\n// (uMedium==4) is a PEER tooth-multiply medium that never reaches the stroke cascade.\n// The painterly STROKE mediums are oil (MEDIUM_OIL), van-Gogh (MEDIUM_VANGOGH) and\n// oil-pastel (MEDIUM_OILPASTEL) — each AUTHORS its own profile entry below.\n" + ke + "\n// The single parameterized four-layer stroke cascade. The four hand-unrolled\n// bestOil/paintOver invocations collapse into ONE body driven by the profile + the\n// uniform-derived per-layer scale/anisotropy multipliers (which are mode-INVARIANT — the\n// per-layer offsets, seeds, and len/wid muls are fixed across modes, so they stay here as\n// the cascade's structure; only the profile's knobs differentiate the medium). The\n// mode passes through for the two mode-special-cased shapes (knife layer-3 dabs +\n// layer-4 fill shape), which are placement details of the cascade, not profile knobs.\nvoid paintStrokeLayers(inout vec3 col, inout float height, StrokeProfile prof,\n int mode, vec2 p, float t) {\n // Scales & multipliers from uniforms (mode-invariant cascade structure).\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three primary layers: big gestural, medium body, small dabs.\n // The −5/3 radii respacing was measured and reverted, not\n // silently struck). The φ-adjacent geometric candidate (2.4, 1.45, 0.87, a fixed\n // ≈1.66× step) moved oil-pastel β −2.534 → −2.413 — TOWARD the −5/3 band but NOT into\n // it (floor −1.85), so the keep-iff-into-band gate failed. The single-pass WebGL2 path\n // is the true limiter (HC-aurora §5): the oil-pastel β + the oil/oil-pastel anisotropy\n // residual stays the oil/oil-pastel stroke-cascade ceiling. The soft\n // anisotropic-Kuwahara finish therefore remains the opt-in mediumKuwahara() body\n // (uMedium==7) the consumer selects — NOT a re-tune of these oil/oil-pastel knobs. The\n // hand-set 2.4, 1.1, 0.45 stays — it is van-Gogh's landed-band spacing.\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n // Strokes are elongated HARD (long·thin) so the rendered field reads strongly\n // directional — the §4.2 structure-tensor anisotropy lift. A short fat dab is locally\n // isotropic and drags the measured A down; a long thin stroke that hugs the tensor\n // tangent is what gives Starry Night its A≈0.83. The width muls are pulled tighter to\n // keep the long·thin aspect.\n float lenMulBig = mix(3.0, 5.2, uStrokeAnisotropy);\n float widMulBig = mix(0.42, 0.22, uStrokeAnisotropy);\n float lenMulMed = mix(2.8, 4.8, uStrokeAnisotropy);\n float widMulMed = mix(0.40, 0.21, uStrokeAnisotropy);\n float lenMulSml = mix(2.2, 3.6, uStrokeAnisotropy);\n float widMulSml = mix(0.36, 0.23, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter — no grid\n vec2 flow = flowField(p, t);\n\n // Layer 1 — big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n prof.densityBig, prof.shapeType, prof.bristleAmp, flow, t, 1.3,\n prof.energyGrade);\n paintOver(col, height, hBig, prof.streakFreq * 0.7, prof.streakAmp,\n uImpasto * prof.impastoAmp * uStrokeAmount, prof.hardness, 1.3, prof.impastoFloor);\n\n // Layer 2 — medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, prof.densityMed, prof.shapeType, prof.bristleAmp, flow, t, 2.7,\n prof.energyGrade);\n paintOver(col, height, hMed, prof.streakFreq, prof.streakAmp,\n uImpasto * prof.impastoAmp * uStrokeAmount, prof.hardness, 2.7, prof.impastoFloor);\n\n // Layer 3 — small strokes (more frequent, smaller). Even the knife layer-3 stays the\n // medium's DIRECTIONAL shape, not a round dab — the round-dab sparkle was a fine-scale\n // isotropic speckle that dragged the §4.2 anisotropy down + rolled the §4.3 slope shallow.\n int smlShape = prof.shapeType;\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 0.9, prof.densitySml, smlShape,\n prof.bristleAmp * 0.85, flow, t, 4.1, prof.energyGrade);\n paintOver(col, height, hSml, prof.streakFreq * 1.4, prof.streakAmp * 0.6,\n uImpasto * prof.impastoAmp * 0.45 * uStrokeAmount, prof.hardness, 4.1, prof.impastoFloor);\n\n // Layer 4 — fill strokes (dense, fine) — cover bald spots. The density is\n // PROFILE-driven (prof.densityFill): oil/oil-pastel fill to full coverage; van-Gogh\n // keeps it sparse so the bare-ground gaps between its atomic dabs survive. The fill is\n // ELONGATED + flow-oriented (NOT a round dab) — a dense round-dab fill is locally\n // isotropic and was the dominant §4.2 anisotropy sink; an oriented fine stroke keeps the\n // fill directional so the whole field reads coherent.\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(2.0, 3.2, uStrokeAnisotropy);\n float widMulFill = mix(0.34, 0.24, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : prof.shapeType; // knife=even; others inherit the medium's directional shape\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 0.8, prof.densityFill, fillShape,\n prof.bristleAmp * 0.6, flow, t, 8.9, prof.energyGrade);\n // The fill is a low-relief, low-streak base coat — it covers bald spots WITHOUT adding\n // fine bright speckle (a high-impasto/high-streak fill caught a per-dab glint that read\n // as isotropic noise over the directional macro strokes — the §4.2/§4.3 sink). Its\n // positional jitter is tamed too so the fill strokes stay flow-aligned, not scattered.\n paintOver(col, height, hFill, prof.streakFreq * 1.2, prof.streakAmp * 0.35,\n uImpasto * prof.impastoAmp * 0.18 * uStrokeAmount, prof.hardness * 0.9, 8.9, prof.impastoFloor);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, prof.densityMed * 0.7, prof.shapeType, prof.bristleAmp, flow2, t, 6.5,\n prof.energyGrade);\n paintOver(col, height, hX, prof.streakFreq, prof.streakAmp * 0.85,\n uImpasto * prof.impastoAmp * 0.55 * uStrokeAmount, prof.hardness, 6.5, prof.impastoFloor);\n }\n}\n\n// The shared stroke-medium substrate finish paints the four-layer\n// cascade off the profile, then canvas-tooth + relight + saturation. The three painterly\n// STROKE mediums (oil, van-Gogh, oil-pastel) each AUTHOR their own profile and call\n// this — the substrate is shared, the PROFILE (not a dispatch-body fork) differentiates\n// the medium. mode passes through for the cascade's mode-special-cased shapes.\nvec3 paintStrokeMedium(vec3 col, vec2 p, float t, StrokeProfile prof, int mode) {\n vec3 result = col;\n // Accumulated paint height across the stroke layers. The relight reads\n // its gradient for the normal; the canvas tooth seeds the base relief.\n float height = 0.0;\n paintStrokeLayers(result, height, prof, mode, p, t);\n\n // Canvas tooth — linen weave\n float tooth1 = vnoise(p * prof.toothScale);\n float tooth2 = vnoise(p * prof.toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * prof.toothAmp * uCanvasGrain;\n\n // Relight the accumulated paint height with the movable uLightDir\n // source (diffuse + Blinn specular, in LINEAR before aces()). The canvas tooth\n // is the base relief term so the weave also catches the raking light.\n float canvasBase = tooth * prof.toothAmp * 0.5;\n result = relightImpasto(result, height, canvasBase);\n\n // Preserve visible ground. The bare-ground gaps (low accumulated stroke height)\n // multiply toward prof.groundFloor, so van-Gogh's sparse atomic dabs read as separable\n // marks over a darker underpainting (oil/oil-pastel keep groundFloor=1.0 → no-op). The\n // smoothstep keeps the impasto dabs (high height) at full value; only the open ground\n // between them darkens.\n result *= mix(prof.groundFloor, 1.0, smoothstep(0.0, 0.38, height));\n\n // Pigment saturation boost\n result = saturate3(result, prof.pigmentSat);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // The oil medium is a thin body: fetch the oil profile (mode-dispatched), paint via\n // the shared stroke substrate. uStrokeMode: 0 oil (gestural), 1 knife, 3 brushwork.\n int mode = uStrokeMode;\n StrokeProfile prof = profileFor(MEDIUM_OIL, mode);\n return paintStrokeMedium(col, p, t, prof, mode);\n}\n\n#define MEDIUM_KUWAHARA 7\n\n// ── Kuwahara — anisotropic generalized painterly finish (uMedium==7) ───────\n// The SOTA edge-preserving painterly smoothing: the generalized/anisotropic Kuwahara of\n// Kyprianidis 2010, the SOFT polynomial-weighted variant (NOT the pre-2010 hard argmin,\n// which BANDS the flat field into an 8-spoke pinwheel — the §4.2 anti-regression). Aurora\n// is a PROCEDURAL field (no input texture), so the operator runs over sampleBase() directly:\n// an elliptical kernel oriented along the structure tensor (elongated along the edge-tangent,\n// narrowed by the anisotropy), divided into 8 overlapping sectors via smooth weights; the\n// output is the variance-weighted blend of the sector means (1/(1+var^q) — low-variance\n// sectors dominate, the SOFT criterion → flat oil-paint patches with crisp zone boundaries).\n// Single-pass small-radius WebGL2 form: 4 rings × 8 angular taps = 32 procedural samples\n// (cost-bounded; the offscreen-park, PRM freeze the substrate owns is untouched).\nvec3 mediumKuwahara(vec3 col, vec2 p, float t) {\n // Orient the kernel along the structure-tensor edge-tangent + read the coherence A\n // (the field widened vec3→vec4 for metal's gradient; Kuwahara reads only .xy/.z).\n vec4 stf = structureTensorField(p, t, flowField(p, t));\n vec2 tangent = stf.xy;\n float A = stf.z;\n // The ellipse axes: major along the tangent, minor across. Anisotropy squeezes the\n // minor axis (coherent zones → long-thin patch along the colour band; flat zones →\n // near-circular so the operator degrades gracefully to the isotropic Kuwahara). The\n // base radius rides uStrokeScale so the painterly patch size tracks the studio knob.\n float radius = clamp(0.010 + uStrokeScale * 0.00018, 0.006, 0.024);\n float aniso = mix(1.0, 0.34, clamp(A, 0.0, 1.0)); // minor/major axis ratio\n vec2 ax = tangent; // major-axis unit vector (edge-tangent)\n vec2 ay = vec2(-tangent.y, tangent.x); // minor-axis unit vector (edge-normal)\n\n // 8 sectors, soft polynomial weights. Each sector i centers on angle i·45°; a sample's\n // sector weight is a smooth gaussian-of-angular-distance so sectors OVERLAP (no hard\n // argmin → no pinwheel banding). The center sample seeds all sectors equally.\n const int SECTORS = 8;\n vec3 m[8]; // per-sector weighted colour sum\n vec3 s[8]; // per-sector weighted colour² sum (for variance)\n float w[8]; // per-sector weight sum\n for (int i = 0; i < SECTORS; i++) { m[i] = vec3(0.0); s[i] = vec3(0.0); w[i] = 0.0; }\n\n // 4 rings × 8 angular taps over the elliptical disc. Each tap: sample the procedural\n // field, then deposit into the sectors by the soft angular weight × the radial falloff.\n const int RINGS = 4;\n const int TAPS = 8;\n for (int r = 1; r <= RINGS; r++) {\n float rr = float(r) / float(RINGS); // 0.25 .. 1.0\n float radial = 1.0 - 0.6 * rr; // inner taps weigh more (gaussian-ish)\n for (int a = 0; a < TAPS; a++) {\n float ang = 6.2831853 * float(a) / float(TAPS);\n // Elliptical offset: major axis full radius, minor axis squeezed by aniso.\n vec2 dirE = ax * cos(ang) + ay * (sin(ang) * aniso);\n vec2 off = dirE * (radius * rr);\n vec3 c = sampleBase(p + off, t);\n // The sample's angular bin (its sector) — soft, so it spills into neighbours.\n for (int k = 0; k < SECTORS; k++) {\n float sectorAng = 6.2831853 * float(k) / float(SECTORS);\n // Smallest signed angular distance to the sector center.\n float d = ang - sectorAng;\n d = atan(sin(d), cos(d)); // wrap to [-π, π]\n float sw = exp(-d * d * 2.2) * radial; // gaussian angular weight × radial\n m[k] += c * sw;\n s[k] += c * c * sw;\n w[k] += sw;\n }\n }\n }\n\n // Per-sector mean + scalar luma-variance, then the SOFT variance-weighted blend.\n vec3 accum = vec3(0.0);\n float accumW = 0.0;\n for (int k = 0; k < SECTORS; k++) {\n float wk = max(w[k], 1e-4);\n vec3 mean = m[k] / wk;\n vec3 var3 = max(s[k] / wk - mean * mean, vec3(0.0));\n float variance = dot(var3, W_LUMA); // perceptual scalar variance\n // SOFT criterion: low-variance sectors (flat, inside a colour zone) dominate; a\n // high-variance sector (straddling an edge) is suppressed. q controls the sharpness;\n // a finite q (not argmin) keeps the blend continuous → no pinwheel spoke.\n float sectorW = 1.0 / (1.0 + pow(variance * 320.0, 4.0));\n accum += mean * sectorW;\n accumW += sectorW;\n }\n vec3 result = accum / max(accumW, 1e-4);\n\n // The center sample anchors the result in near-flat zones (where every sector reads the\n // same colour) so the operator is a no-op there — the smoothing only BITES at edges.\n vec3 center = sampleBase(p, t);\n result = mix(center, result, clamp(0.35 + 0.65 * A, 0.0, 1.0));\n\n // A faint canvas tooth + pigment-saturation lift so the flattened patches read as\n // oil-paint, not a posterized blur (the painterly identity the smoothing alone lacks).\n float tooth = vnoise(p * 300.0) - 0.5;\n result *= 1.0 + tooth * 0.06 * uCanvasGrain;\n result = saturate3(result, 1.04);\n\n // Blend toward the incoming col by uStrokeAmount so the studio amount knob controls\n // the finish strength (uStrokeAmount=0 → the raw field passes through; default → full).\n return mix(col, result, clamp(uStrokeAmount, 0.0, 1.0));\n}\n\n" + je + Oe + "// The oil-pastel medium (uMedium==6) is a distinct stroke-deposition body,\n// separate from the dry-crayon tooth-multiply (mediumCrayon). It DEPOSITS\n// broad smeared directional strokes via the same brush engine with a creamy soft\n// hardness, heavy pigment build-up where strokes overlap, and a chroma punch — the\n// stroke-deposition model that gives oil-pastel its depth and less-uniform read.\n// Shares the SUBSTRATE (the stroke cascade + tooth + relight) with oil/van-Gogh, NOT\n// the dispatch body of dry crayon. The bridge forces tensor orientation.\nvec3 mediumOilPastel(vec3 col, vec2 p, float t) {\n StrokeProfile prof = profileFor(MEDIUM_OILPASTEL, 0);\n return paintStrokeMedium(col, p, t, prof, 0);\n}", L = "\n", Pe = `#version 300 es
|
|
15
123
|
precision highp float;
|
|
16
124
|
|
|
17
125
|
in vec2 vUv;
|
|
18
126
|
out vec4 fragColor;
|
|
19
127
|
|
|
20
|
-
#define MAX_NUCLEI
|
|
128
|
+
#define MAX_NUCLEI 8
|
|
21
129
|
#define MAX_STOPS 8
|
|
22
130
|
|
|
23
131
|
// ── Uniforms ───────────────────────────────────────────────────────────────
|
|
@@ -36,7 +144,7 @@ uniform float uNucleiValueBias[MAX_NUCLEI];
|
|
|
36
144
|
uniform float uNucleiDriftRadius[MAX_NUCLEI];
|
|
37
145
|
uniform float uNucleiDriftPhase[MAX_NUCLEI];
|
|
38
146
|
// Anisotropy: per-nucleus elongation (1.0 = isotropic) and major-axis angle (radians).
|
|
39
|
-
// Defaults (1.0
|
|
147
|
+
// Defaults (1.0, 0.0) reduce to the original circular Gaussian.
|
|
40
148
|
uniform float uNucleiElong[MAX_NUCLEI];
|
|
41
149
|
uniform float uNucleiAngle[MAX_NUCLEI];
|
|
42
150
|
uniform float uSoftmaxBeta;
|
|
@@ -46,37 +154,31 @@ uniform float uValueVariance;
|
|
|
46
154
|
uniform float uWarpAmount;
|
|
47
155
|
uniform float uWarpScale;
|
|
48
156
|
uniform float uWarpDrift;
|
|
49
|
-
uniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid 3=curl (
|
|
157
|
+
uniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid 3=curl (opt-in Bridson flow warp)
|
|
50
158
|
uniform int uNoiseOctaves;
|
|
51
159
|
|
|
52
160
|
// Medium
|
|
53
161
|
// 0 smooth, 1 pastel, 2 watercolor, 3 oil, 4 crayon (peer medium — wax pigment
|
|
54
162
|
// on paper tooth; NOT an oil-stroke sub-mode, so it dispatches at main() level).
|
|
55
163
|
uniform int uMedium;
|
|
56
|
-
// Hue-arc method for
|
|
164
|
+
// Hue-arc method for OKLCh palette interpolation. Mirrors value.js's
|
|
57
165
|
// HueInterpolationMethod: 0 shorter, 1 longer, 2 increasing, 3 decreasing. Only
|
|
58
166
|
// consulted when the hue-arc path is requested; OKLab-rectangular ramps (the
|
|
59
167
|
// default for adjacent-hue stops) ignore it.
|
|
60
168
|
uniform int uHuePath;
|
|
61
|
-
uniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi, 5 tensor/ETF
|
|
169
|
+
uniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi, 5 tensor/ETF
|
|
62
170
|
uniform vec2 uFlowFocal;
|
|
63
171
|
uniform float uFlowAngle;
|
|
64
172
|
uniform float uFlowCurl;
|
|
65
173
|
uniform vec2 uCursor; // in 0..1 screen space (matches pN)
|
|
66
174
|
uniform float uCursorStrength; // 0..1 attraction amount
|
|
67
175
|
uniform float uCursorRadius; // radius of influence (0.05..0.5)
|
|
68
|
-
// AW.W8.1 — the velocity-reactive flow: a fast flick injects a transient swirl-burst
|
|
69
|
-
// (uCursorBurst, decaying over ~1s) along the pointer velocity (uCursorVelocity),
|
|
70
|
-
// distinct from the steady uCursorStrength attraction. Both are PRM-gated (the cursor
|
|
71
|
-
// write-path early-outs on reduced-motion, and the master tempo scalar zeroes them).
|
|
72
|
-
uniform vec2 uCursorVelocity; // smoothed pointer velocity (normalized-screen/move)
|
|
73
|
-
uniform float uCursorBurst; // 0..1 transient flick burst
|
|
74
176
|
uniform float uStrokeAmount;
|
|
75
177
|
uniform float uStrokeScale;
|
|
76
178
|
uniform float uStrokeAnisotropy;
|
|
77
179
|
uniform int uStrokeLayers; // 1 or 2 (crosshatch)
|
|
78
180
|
uniform int uStrokeMode; // 0 oil (modern gestural), 1 palette-knife, 3 modern-chunky (crayon is uMedium==4, a peer medium)
|
|
79
|
-
//
|
|
181
|
+
// Stroke-orientation source: 0 flow (hand-authored flowField), 1
|
|
80
182
|
// tensor (the structure-tensor minor eigenvector — the color field's edge-tangent).
|
|
81
183
|
uniform int uStrokeOrient;
|
|
82
184
|
uniform float uWetEdge;
|
|
@@ -85,17 +187,16 @@ uniform float uImpasto;
|
|
|
85
187
|
uniform float uBrokenColor;
|
|
86
188
|
uniform float uCanvasGrain;
|
|
87
189
|
|
|
88
|
-
//
|
|
190
|
+
// Metal-medium knobs (uMedium==8/9). uMetalPolish scales
|
|
89
191
|
// the specular catch intensity; uMetalHeightScale scales the luma-relief → normal tilt.
|
|
90
192
|
// On the WGSL primary these ride the free cursor.z/.w pad lanes (uniformBridgeWGPU); the
|
|
91
|
-
//
|
|
193
|
+
// The fragment shader carries them as uniforms. Non-metal configs write 0.
|
|
92
194
|
uniform float uMetalPolish;
|
|
93
195
|
uniform float uMetalHeightScale;
|
|
94
196
|
|
|
95
|
-
//
|
|
197
|
+
// The impasto relight axis is a movable directional source lighting the
|
|
96
198
|
// accumulated paint-height field (diffuse + Blinn specular, in LINEAR before aces()).
|
|
97
|
-
//
|
|
98
|
-
// the still default reads identically to the prior fixed rim.
|
|
199
|
+
// The cursor drives uLightDir; the upper-left default supplies the still pose.
|
|
99
200
|
uniform vec3 uLightDir; // unit direction (x,y in screen space, z toward viewer)
|
|
100
201
|
uniform vec3 uLightColor; // warm-white tint (linear)
|
|
101
202
|
|
|
@@ -110,7 +211,7 @@ uniform float uSaturation;
|
|
|
110
211
|
uniform float uPaperGrain;
|
|
111
212
|
uniform float uAlpha;
|
|
112
213
|
|
|
113
|
-
//
|
|
214
|
+
// Chroma-floor strength (0 = off,
|
|
114
215
|
// 1 = the vivid default). The shader lifts any pale zone's OKLab chroma toward
|
|
115
216
|
// uVividness * VIVID_TARGET, hue-preserving, warm-anchored below the near-gray epsilon.
|
|
116
217
|
uniform float uVividness;
|
|
@@ -120,7 +221,7 @@ uniform float uVividness;
|
|
|
120
221
|
// human-friendly 0..~0.05 band — that scale is what the config schema and every
|
|
121
222
|
// demo preset are tuned against. But that band, multiplied straight into uTime
|
|
122
223
|
// (seconds), yields rad/sec rates so small the field reads visually static (one
|
|
123
|
-
// nuclei orbit
|
|
224
|
+
// nuclei orbit would otherwise take minutes). These K_* constants decouple
|
|
124
225
|
// the AUTHORING scale from the RAD/SEC scale: each time term wraps its coefficient
|
|
125
226
|
// in the matching K_, lifting the same authored value to a perceptible period
|
|
126
227
|
// without touching any preset. Tuned so the field reads SLOWLY ALIVE — drift over
|
|
@@ -155,10 +256,10 @@ float vnoise(vec2 p) {
|
|
|
155
256
|
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
|
|
156
257
|
}
|
|
157
258
|
|
|
158
|
-
// The rotated-octave FBM rotation constant
|
|
159
|
-
//
|
|
259
|
+
// The rotated-octave FBM rotation constant is spliced from the shared chunk
|
|
260
|
+
// as the sole FBM_ROT. The loop below stays aurora-local (2.02 lacunarity +
|
|
160
261
|
// uniform-driven octaves, per §3a — only the rotation constant converges).
|
|
161
|
-
${
|
|
262
|
+
${p}
|
|
162
263
|
|
|
163
264
|
float fbm(vec2 p) {
|
|
164
265
|
float v = 0.0;
|
|
@@ -172,52 +273,51 @@ float fbm(vec2 p) {
|
|
|
172
273
|
return v;
|
|
173
274
|
}
|
|
174
275
|
|
|
175
|
-
//
|
|
176
|
-
// procedural surfaces share (the
|
|
276
|
+
// The shared curl-noise flow chunk (curlFBM) is spliced from the single source
|
|
277
|
+
// procedural surfaces share (the shared-chunk precedent, applied to FLOW). The
|
|
177
278
|
// chunk owns ONLY the basis-agnostic curl operator; the host owns the noise basis —
|
|
178
279
|
// aurora wraps its OWN fbm as the scalar potential (so curl rides the same 2.02-
|
|
179
280
|
// lacunarity loop the rest of the warp uses). The curl operator is consumed ONLY on
|
|
180
281
|
// the OPT-IN warpMode == "curl" branch (uWarpMode == 3) — the default warp paths are
|
|
181
282
|
// byte-untouched (no curl call), so every existing aurora gate stays byte-equivalent.
|
|
182
|
-
${
|
|
283
|
+
${re}
|
|
183
284
|
|
|
184
285
|
// The scalar fbm potential ψ for curlFBM — aurora's own fbm. The splice above
|
|
185
286
|
// forward-declares potentialFBM; this defines it (ES 3.00 allows the prototype).
|
|
186
287
|
float potentialFBM(vec2 p) { return fbm(p); }
|
|
187
288
|
|
|
188
|
-
//
|
|
289
|
+
// The painterly-medium organic noise basis (Jarzynski PCG2D integer-bit hash
|
|
189
290
|
// + 2D simplex gradient noise), SPLICED from the shared procedural-color chunk (the
|
|
190
291
|
// single hash source).
|
|
191
292
|
// The painterly mediums (mediumOil's tooth/granulation) opt into pcgHash2/gnoise for
|
|
192
293
|
// organic paper/pigment grain; the smooth/atmospheric pole KEEPS its cheap value-noise
|
|
193
|
-
// fbm above (the cost
|
|
294
|
+
// fbm above (the cost tiering is preserved: this is an additive basis,
|
|
194
295
|
// not a blanket upgrade). The aurora-local hash21/vnoise/fbm loop stays (legitimately
|
|
195
296
|
// divergent per the chunk's §3a).
|
|
196
|
-
${
|
|
297
|
+
${v}
|
|
197
298
|
|
|
198
|
-
// The sRGB OETF (linearToSrgb)
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
${m}
|
|
299
|
+
// The sRGB OETF (linearToSrgb) is spliced from the shared procedural-color chunk,
|
|
300
|
+
// the sole OETF source; the local copy is deleted here. Aurora's linear pipeline
|
|
301
|
+
// closes the color-space seam with this transfer before fragColor.
|
|
302
|
+
${b}
|
|
203
303
|
|
|
204
|
-
//
|
|
304
|
+
// The four Ottosson OKLab/OKLCh matrices + their space fns, spliced from the
|
|
205
305
|
// SAME shared chunk the goo-blob uses (zero new payload, 1e-6-verified). PI is
|
|
206
306
|
// defined first because the chunk's oklabToOklch folds the hue into [0, 2pi).
|
|
207
307
|
const float PI = 3.141592653589793;
|
|
208
|
-
${
|
|
308
|
+
${C}
|
|
209
309
|
|
|
210
|
-
// ── OKLCh palette ramp (
|
|
310
|
+
// ── OKLCh palette ramp (single-sourced twin) ───────────────────────────────
|
|
211
311
|
// The muddy-midtone kill: distant-hue stops interpolated by a plain linear mix()
|
|
212
312
|
// desaturate toward grey at the midpoint. The OKLab-rectangular lerp (L,a,b) holds
|
|
213
313
|
// chroma across the ramp; the OKLCh hue-arc form (deliberate rainbow travel via
|
|
214
314
|
// uHuePath increasing/decreasing) sweeps the hue wheel without flipping.
|
|
215
315
|
//
|
|
216
|
-
//
|
|
316
|
+
// The ramp (interpolateHueTurns + mixPaletteOklab + mixPaletteOklchArc +
|
|
217
317
|
// the smoothstep-eased samplePaletteRamp dispatcher) is SPLICED from the shared
|
|
218
318
|
// procedural-color chunk (the single ramp source). composition.glsl.ts's
|
|
219
319
|
// samplePalette calls samplePaletteRamp.
|
|
220
|
-
${
|
|
320
|
+
${m}
|
|
221
321
|
|
|
222
322
|
// Interleaved Gradient Noise (Jimenez) — a 1-LSB triangular dither applied in
|
|
223
323
|
// DISPLAY space AFTER the OETF, so 8-bit mid-tone banding on the soft gradient is
|
|
@@ -226,7 +326,7 @@ float ign(vec2 p) {
|
|
|
226
326
|
return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715))));
|
|
227
327
|
}
|
|
228
328
|
|
|
229
|
-
// Cellular
|
|
329
|
+
// Cellular, Worley f1
|
|
230
330
|
float cellular(vec2 p) {
|
|
231
331
|
vec2 i = floor(p);
|
|
232
332
|
vec2 f = fract(p);
|
|
@@ -262,7 +362,7 @@ vec2 domainWarp(vec2 p, float t) {
|
|
|
262
362
|
float c2 = cellular(p * uWarpScale * 1.2 + vec2(11.0, 7.0));
|
|
263
363
|
warp = mix(r, vec2(c1, c2), 0.5);
|
|
264
364
|
} else if (uWarpMode == 3) {
|
|
265
|
-
//
|
|
365
|
+
// Curl (Bridson flow warp). The divergence-free curl of an fbm potential
|
|
266
366
|
// advects the field along a source-free swirl — folds + stretches like fluid
|
|
267
367
|
// advection, never the source-y bulge a raw fbm gradient produces. The potential
|
|
268
368
|
// scrolls on the same warp-drift clock; curlFBM is the shared chunk's operator.
|
|
@@ -293,13 +393,13 @@ vec2 domainWarp(vec2 p, float t) {
|
|
|
293
393
|
return warped;
|
|
294
394
|
}
|
|
295
395
|
|
|
296
|
-
` +
|
|
396
|
+
` + we + L + Te + "\n// ── Color utils (OKLCh; the sRGB YIQ hueShift matrix is DELETED) ──────────\nconst vec3 W_LUMA = vec3(0.2126, 0.7152, 0.0722);\n\n// Linear sRGB → OKLab (the cbrt-LMS path; the goo-blob's srgbToOklab takes gamma,\n// here the color field is already linear so we skip the OETF inverse).\nvec3 linOklab(vec3 lin) {\n vec3 lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * (sign(lms) * pow(abs(lms), vec3(1.0 / 3.0)));\n}\n\n// Broken color — hue + chroma jitter at fixed PERCEPTUAL lightness, in OKLCh.\n// Broken color is hue variation at constant VALUE, which only OKLCh makes true (the\n// prior YIQ-style sRGB rotation muddied value). Van-Gogh and oil-pastel consume\n// this seam for per-stroke pigment jitter.\nvec3 brokenColorJitter(vec3 c, float hueSeed, float valueSeed, float strength) {\n float amt = clamp(uBrokenColor * strength, 0.0, 1.0);\n if (amt <= 0.001) return c;\n vec3 lch = oklabToOklch(linOklab(c));\n // ±~16° hue swing + ±~12% chroma swing; L held so value reads constant.\n 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(0.0));\n}\n\n// Saturation — chroma scale at fixed L/H in OKLCh (the perceptual saturation,\n// replacing the luma-mix sRGB form). amt=1 is identity; amt<1 desaturates toward\n// the achromatic axis with NO lightness shift (the muddy-luma-mix grey is gone).\nvec3 saturate3(vec3 c, float amt) {\n vec3 lch = oklabToOklch(linOklab(c));\n lch.y = max(lch.y * amt, 0.0);\n return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3(0.0));\n}\n\n// The chroma floor operates in OKLab: lightness + hue are\n// untouched, chroma is lifted toward the floor. A pale zone BLOOMS to transmission-fit;\n// a vivid zone (already above the floor) is byte-untouched. The near-gray hue guard is\n// STRUCTURAL: below VIVID_EPS the (a,b) direction is precision noise, so the lift\n// synthesizes along the WARM anchor (amber, both components positive) — NEVER the noisy\n// near-zero vector, NEVER a cold/teal hue. uVividness:0 returns c identically (the gated\n// byte-identity opt-out). Mode factor: a dark route lifts the floor a touch (a dim field\n// needs more chroma to read vivid through glass) — derived from the field's own L.\nconst float VIVID_TARGET = 0.115;\nconst float VIVID_EPS = 0.012;\n// The warm amber anchor in OKLab (a,b): OKLCh hue 70°, unit chroma. cos/sin(70°) — both\n// POSITIVE (warm yellow-orange). The near-gray fallback direction, the warm-floor law.\nconst vec2 VIVID_WARM_ANCHOR = vec2(0.34202, 0.93969);\nvec3 vividnessFloor(vec3 c) {\n if (uVividness <= 0.0001) return c;\n vec3 lab = linOklab(c);\n float C = length(lab.yz);\n // Mode-aware: dim fields (low L) get a slightly higher target so they read vivid\n // through glass. The mix factor is gentle (1.0–1.18) so light routes are unaffected.\n float modeLift = mix(1.18, 1.0, clamp(lab.x * 1.4, 0.0, 1.0));\n float Cmin = uVividness * VIVID_TARGET * modeLift;\n vec2 hueDir = (C > VIVID_EPS) ? lab.yz / C : VIVID_WARM_ANCHOR;\n lab.yz = hueDir * max(C, Cmin);\n return max(oklabToLinearSrgb(lab), vec3(0.0));\n}\n\n" + Ee + L + Me + L + De + L + Ne + "\n\n// ── Main ──────────────────────────────────────────────────────────────────\nvoid main() {\n // Normalized 0..1 coordinates for nuclei, domain warp, and medium sampling.\n vec2 uv = vUv;\n vec2 pN = uv;\n\n float t = uTime;\n\n // Warp in pN space\n vec2 p_warp = domainWarp(pN, t);\n\n // Composition\n float paletteId; float valueMod;\n nucleiField(p_warp, t, paletteId, valueMod);\n vec3 col = samplePalette(paletteId);\n col *= 1.0 + uValueVariance * valueMod;\n\n // Breath — slow global luminance wobble\n float breath = sin(t * 6.2831 / max(uBreathPeriod, 1.0));\n col *= 1.0 + uBreathDepth * breath * 0.5;\n\n // Medium dispatch: each is a first-class body with no shared dispatch.\n // 1 pastel · 2 watercolor · 3 oil · 4 crayon (DRY tooth-multiply) ·\n // 5 van-Gogh (atomic comma/crescent dabs) · 6 oil-pastel (stroke deposition) ·\n // 7 kuwahara (anisotropic-Kuwahara edge-preserving painterly finish).\n // van-Gogh is no longer a mediumOil passthrough; oil-pastel and crayon no longer\n // share a body — they share the SUBSTRATE (the tooth/placement helpers), not the\n // dispatch body. Kuwahara is OPT-IN (default-off — no preset selects\n // it unless a config explicitly sets medium:\"kuwahara\"); the smooth default + the\n // van-Gogh HERO + the existing painterly bodies are byte-unchanged by its addition.\n if (uMedium == 1) col = mediumPastel(col, pN, t);\n else if (uMedium == 2) col = mediumWatercolor(col, pN, t);\n else if (uMedium == 3) col = mediumOil(col, pN, t);\n else if (uMedium == 4) col = mediumCrayon(col, pN, t);\n else if (uMedium == 5) col = mediumVangogh(col, pN, t);\n else if (uMedium == 6) col = mediumOilPastel(col, pN, t);\n else if (uMedium == 7) col = mediumKuwahara(col, pN, t);\n // The mutually exclusive metal mediums are opt-in at uMedium==8/9;\n // the smooth default + every existing medium are byte-unchanged by these arms).\n else if (uMedium == 8) col = mediumMetal(col, pN, t);\n else if (uMedium == 9) col = mediumMetalGradient(col, pN, t);\n\n // Cursor-local luminance lean. Position, radius, and the CPU-folded strength are the\n // same four packed values on WebGL2 and WebGPU; absent interactivity writes strength 0.\n vec2 cursorDelta = pN - uCursor;\n float cursorRadius = max(uCursorRadius, 0.01);\n float cursorLean = exp(-dot(cursorDelta, cursorDelta) / (cursorRadius * cursorRadius * 0.5));\n col *= 1.0 + 0.12 * cursorLean * uCursorStrength;\n\n // Saturation trim\n col = saturate3(col, uSaturation);\n\n // The chroma floor is warm-anchored and hue-preserving. It lifts a\n // pale zone toward the transmissive floor so warm glass over the field reads\n // transmissive-not-gray; a vivid zone is untouched; uVividness:0 is a no-op.\n col = vividnessFloor(col);\n\n // Tonemap + film grain\n col = aces(col);\n float grain = hash21(gl_FragCoord.xy + t * 17.0);\n col += (grain - 0.5) * uPaperGrain;\n\n col = clamp(col * 0.985 + 0.008, 0.0, 1.0);\n\n // MANDATORY OETF — closes the seam (mirrors metaball.frag.ts:278). The whole\n // pipeline above (linear palette LUT, ACES tonemap, grain) runs in LINEAR; without\n // this transfer the aurora ships ~2.2× too dark (linear 0.5 → ~0.215, not ~0.735).\n col = linearToSrgb(col);\n\n // 1-LSB triangular IGN dither in DISPLAY space, AFTER the OETF — breaks 8-bit\n // mid-tone banding on the soft gradient. Texture-free (the canonical Jimenez IGN).\n col += (1.0 / 255.0) * (ign(gl_FragCoord.xy) - 0.5);\n\n // Premultiply operates on DISPLAY-space color (matches the blob: OETF, then premul).\n fragColor = vec4(col * uAlpha, uAlpha);\n}\n", Fe = `#version 300 es
|
|
297
397
|
precision highp float;
|
|
298
398
|
|
|
299
399
|
in vec2 vUv;
|
|
300
400
|
out vec4 fragColor;
|
|
301
401
|
|
|
302
|
-
#define MAX_NUCLEI
|
|
402
|
+
#define MAX_NUCLEI 8
|
|
303
403
|
#define BLUR_RINGS 3
|
|
304
404
|
#define BLUR_SECTORS 8
|
|
305
405
|
const float PI = 3.141592653589793;
|
|
@@ -358,7 +458,7 @@ float vnoise(vec2 p) {
|
|
|
358
458
|
float d = hash21(i + vec2(1.0, 1.0));
|
|
359
459
|
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
|
|
360
460
|
}
|
|
361
|
-
${
|
|
461
|
+
${p}
|
|
362
462
|
float fbm(vec2 p) {
|
|
363
463
|
float v = 0.0;
|
|
364
464
|
float a = 0.5;
|
|
@@ -375,8 +475,8 @@ float ign(vec2 p) {
|
|
|
375
475
|
return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715))));
|
|
376
476
|
}
|
|
377
477
|
|
|
378
|
-
${
|
|
379
|
-
${
|
|
478
|
+
${b}
|
|
479
|
+
${C}
|
|
380
480
|
|
|
381
481
|
// linear-sRGB → raw OKLab (the vividnessFloor helper — mirrors aurora.frag's linOklab).
|
|
382
482
|
vec3 linOklab(vec3 lin) {
|
|
@@ -512,6 +612,11 @@ void main() {
|
|
|
512
612
|
float radius = mix(uBlurMin, uBlurMax, zone);
|
|
513
613
|
vec3 col = zoneBlur(uv, radius);
|
|
514
614
|
|
|
615
|
+
vec2 cursorDelta = uv - uCursor;
|
|
616
|
+
float cursorRadius = max(uCursorRadius, 0.01);
|
|
617
|
+
float cursorLean = exp(-dot(cursorDelta, cursorDelta) / (cursorRadius * cursorRadius * 0.5));
|
|
618
|
+
col *= 1.0 + 0.12 * cursorLean * uCursorStrength;
|
|
619
|
+
|
|
515
620
|
// Saturation trim + the source-agnostic vividness floor (a washed photo blooms).
|
|
516
621
|
col = saturate3(col, uSaturation);
|
|
517
622
|
col = vividnessFloor(col);
|
|
@@ -529,147 +634,59 @@ void main() {
|
|
|
529
634
|
// Premultiply on display-space color (matches the palette path: OETF, then premul).
|
|
530
635
|
fragColor = vec4(col * uAlpha, uAlpha);
|
|
531
636
|
}
|
|
532
|
-
`,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
return
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
128,
|
|
546
|
-
128,
|
|
547
|
-
128,
|
|
548
|
-
255
|
|
549
|
-
]), e;
|
|
550
|
-
}
|
|
551
|
-
function Re(e) {
|
|
552
|
-
return e instanceof HTMLImageElement ? {
|
|
553
|
-
width: e.naturalWidth,
|
|
554
|
-
height: e.naturalHeight
|
|
555
|
-
} : {
|
|
556
|
-
width: e.width,
|
|
557
|
-
height: e.height
|
|
637
|
+
`, R = .001, Ie = 1e-4;
|
|
638
|
+
function z(e, t, i) {
|
|
639
|
+
let a = n(e);
|
|
640
|
+
if (i > 0) {
|
|
641
|
+
let t = e.acceleration.value, n = e.velocity.value, r = -(t.x * n.x + t.y * n.y);
|
|
642
|
+
r > 0 && (a.burst = Math.min(1, a.burst + r * 3));
|
|
643
|
+
}
|
|
644
|
+
let o = r(a, t);
|
|
645
|
+
return {
|
|
646
|
+
x: o.cx,
|
|
647
|
+
y: o.cy,
|
|
648
|
+
strength: o.strength,
|
|
649
|
+
radius: o.radius
|
|
558
650
|
};
|
|
559
651
|
}
|
|
560
|
-
function
|
|
561
|
-
let
|
|
562
|
-
e.
|
|
563
|
-
let o = r ? e.LINEAR : e.NEAREST;
|
|
564
|
-
e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, o), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, o);
|
|
565
|
-
let s = i ? e.CLAMP_TO_EDGE : e.REPEAT;
|
|
566
|
-
return e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, s), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, s), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), a;
|
|
652
|
+
function B(e) {
|
|
653
|
+
let t = e.attractorVelocity.value;
|
|
654
|
+
return e.engagement.value > R || e.speed.value > R || e.burst.value > R || Math.hypot(t.x, t.y) > Ie;
|
|
567
655
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
r,
|
|
575
|
-
1
|
|
576
|
-
],
|
|
577
|
-
format: "rgba8unorm",
|
|
578
|
-
usage: Be | 20
|
|
579
|
-
});
|
|
580
|
-
return e.queue.copyExternalImageToTexture({
|
|
581
|
-
source: t,
|
|
582
|
-
flipY: !1
|
|
583
|
-
}, {
|
|
584
|
-
texture: i,
|
|
585
|
-
premultipliedAlpha: !1
|
|
586
|
-
}, [
|
|
587
|
-
n,
|
|
588
|
-
r,
|
|
589
|
-
1
|
|
590
|
-
]), {
|
|
591
|
-
texture: i,
|
|
592
|
-
width: n,
|
|
593
|
-
height: r
|
|
656
|
+
function Le(e) {
|
|
657
|
+
let { gl: t, prog: n, uniforms: r, pointerField: i, getCursorScalars: a, getConfig: o, getReducedMotion: s, getRenderTime: c } = e, l = (e) => 1 - e, u = null, d = {
|
|
658
|
+
x: .5,
|
|
659
|
+
y: .5,
|
|
660
|
+
strength: 0,
|
|
661
|
+
radius: .25
|
|
594
662
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
function
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
n = e, e && t && e(t);
|
|
604
|
-
},
|
|
605
|
-
ensureDecoded(i) {
|
|
606
|
-
i.source !== "image" || i.src == null || i.src !== r && (r = i.src, Ie(i.src).then((r) => {
|
|
607
|
-
t = r, n?.(r), e.wake();
|
|
608
|
-
}).catch((t) => {
|
|
609
|
-
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
610
|
-
}));
|
|
663
|
+
function f() {
|
|
664
|
+
return +!s();
|
|
665
|
+
}
|
|
666
|
+
function p(e) {
|
|
667
|
+
let i = c(e);
|
|
668
|
+
if (t.useProgram(n), t.uniform2f(r.uCursor, d.x, l(d.y)), t.uniform1f(r.uCursorStrength, d.strength), t.uniform1f(r.uCursorRadius, d.radius), t.uniform1f(r.uTime, i), o().interactivity?.light) {
|
|
669
|
+
let e = f(), n = i * .25, a = Math.cos(n) * .5, o = Math.sin(n) * .5, s = (d.x - .5) * 2, c = (.5 - d.y) * 2, l = d.strength * e;
|
|
670
|
+
a = a * (1 - l) + s * l, o = o * (1 - l) + c * l, t.uniform3f(r.uLightDir, a * e + (1 - e) * -.5, o * e + (1 - e) * .6, .62);
|
|
611
671
|
}
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
function
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
e.useProgram(t), e.activeTexture(e.TEXTURE0), r && e.deleteTexture(r), r = ze(e, n);
|
|
619
|
-
};
|
|
620
|
-
return i(n.getDecodedImage() ?? Le()), n.setImageUploader(i), () => {
|
|
621
|
-
r && e.deleteTexture(r), n.setImageUploader(null);
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
//#endregion
|
|
625
|
-
//#region src/components/aurora/constants/renderMode.ts
|
|
626
|
-
function j() {
|
|
627
|
-
let e;
|
|
628
|
-
try {
|
|
629
|
-
e = y();
|
|
630
|
-
} catch {
|
|
631
|
-
return !1;
|
|
672
|
+
t.clear(t.COLOR_BUFFER_BIT), t.drawArrays(t.TRIANGLES, 0, 3);
|
|
673
|
+
}
|
|
674
|
+
function m() {
|
|
675
|
+
if (s()) return !1;
|
|
676
|
+
let e = o();
|
|
677
|
+
return e.nucleiDrift !== 0 || e.paletteDrift !== 0 || e.breathDepth !== 0 || e.warpDrift !== 0 || B(i);
|
|
632
678
|
}
|
|
633
|
-
return e === null ? !1 : e.includes("swiftshader") || e.includes("llvmpipe") || e.includes("software") || e.includes("basic render") || e.includes("microsoft basic");
|
|
634
|
-
}
|
|
635
|
-
function M(e, t = {}) {
|
|
636
|
-
return e !== "css" && !t.forceWebGLUnderSoftwareRaster && j() ? "css" : e === "auto" ? "webgl" : e;
|
|
637
|
-
}
|
|
638
|
-
//#endregion
|
|
639
|
-
//#region src/components/aurora/composables/glSetup.ts
|
|
640
|
-
var N = "[Aurora]", We = /* @__PURE__ */ "uTime.uPalette.uStopCount.uNucleiCount.uNucleiPos.uNucleiRadius.uNucleiPaletteBias.uNucleiValueBias.uNucleiDriftRadius.uNucleiDriftPhase.uNucleiElong.uNucleiAngle.uSoftmaxBeta.uValueVariance.uWarpAmount.uWarpScale.uWarpDrift.uWarpMode.uNoiseOctaves.uMedium.uHuePath.uFlowPattern.uFlowFocal.uFlowAngle.uFlowCurl.uCursor.uCursorStrength.uCursorRadius.uCursorVelocity.uCursorBurst.uStrokeAmount.uStrokeScale.uStrokeAnisotropy.uStrokeLayers.uStrokeMode.uStrokeOrient.uLightDir.uLightColor.uWetEdge.uGranulation.uImpasto.uBrokenColor.uCanvasGrain.uMetalPolish.uMetalHeightScale.uNucleiDrift.uPaletteDrift.uBreathDepth.uBreathPeriod.uSaturation.uPaperGrain.uAlpha.uVividness.uImage.uBlurMin.uBlurMax.uImageAspect".split(".");
|
|
641
|
-
function Ge(e, t, n) {
|
|
642
|
-
let r = ae(e, e.VERTEX_SHADER, t, N), i = ae(e, e.FRAGMENT_SHADER, n, N), a = ie(e, r, i, N);
|
|
643
|
-
e.useProgram(a);
|
|
644
|
-
let o = e.createVertexArray();
|
|
645
|
-
e.bindVertexArray(o);
|
|
646
|
-
let s = e.createBuffer();
|
|
647
|
-
e.bindBuffer(e.ARRAY_BUFFER, s), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
648
|
-
-1,
|
|
649
|
-
-1,
|
|
650
|
-
3,
|
|
651
|
-
-1,
|
|
652
|
-
-1,
|
|
653
|
-
3
|
|
654
|
-
]), e.STATIC_DRAW);
|
|
655
|
-
let c = e.getAttribLocation(a, "aPos");
|
|
656
|
-
e.enableVertexAttribArray(c), e.vertexAttribPointer(c, 2, e.FLOAT, !1, 0, 0);
|
|
657
|
-
let l = {};
|
|
658
|
-
for (let t of We) l[t] = e.getUniformLocation(a, t);
|
|
659
679
|
return {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
vao: o,
|
|
666
|
-
buf: s
|
|
667
|
-
}
|
|
680
|
+
frame: (e) => {
|
|
681
|
+
let t = f(), n = u === null ? 0 : Math.max(0, (e - u) * 1e3);
|
|
682
|
+
u = e, i.tick(t === 0 ? 0 : n), d = z(i, a(), t), p(e);
|
|
683
|
+
},
|
|
684
|
+
needsAnimation: m
|
|
668
685
|
};
|
|
669
686
|
}
|
|
670
687
|
//#endregion
|
|
671
688
|
//#region src/components/aurora/constants/presets.ts
|
|
672
|
-
var
|
|
689
|
+
var Re = 8, ze = 8, Be = 1, Ve = .115, He = .004, Ue = .06, V = {
|
|
673
690
|
palette: [
|
|
674
691
|
{
|
|
675
692
|
L: .64,
|
|
@@ -737,7 +754,7 @@ var Ke = 6, qe = 8, Je = 1, Ye = .115, Xe = .004, Ze = .06, P = {
|
|
|
737
754
|
paperGrain: .008,
|
|
738
755
|
alpha: 1,
|
|
739
756
|
vividness: 1
|
|
740
|
-
},
|
|
757
|
+
}, We = {
|
|
741
758
|
medium: "crayon",
|
|
742
759
|
strokeOrient: "tensor",
|
|
743
760
|
granulation: .3,
|
|
@@ -753,64 +770,63 @@ var Ke = 6, qe = 8, Je = 1, Ye = .115, Xe = .004, Ze = .06, P = {
|
|
|
753
770
|
};
|
|
754
771
|
//#endregion
|
|
755
772
|
//#region src/components/aurora/composables/color.ts
|
|
756
|
-
function
|
|
773
|
+
function H(e, t = 8, n) {
|
|
757
774
|
let r = n ?? new Float32Array(t * 3), i = Math.min(e.length, t);
|
|
758
775
|
for (let t = 0; t < i; t++) {
|
|
759
|
-
let [n, i, a] =
|
|
776
|
+
let [n, i, a] = d(e[t]);
|
|
760
777
|
r[t * 3 + 0] = n, r[t * 3 + 1] = i, r[t * 3 + 2] = a;
|
|
761
778
|
}
|
|
762
779
|
for (let e = i; e < t; e++) r[e * 3 + 0] = 0, r[e * 3 + 1] = 0, r[e * 3 + 2] = 0;
|
|
763
780
|
return r;
|
|
764
781
|
}
|
|
765
|
-
function
|
|
782
|
+
function Ge(e) {
|
|
766
783
|
if (e.length === 0) return "transparent";
|
|
767
|
-
if (e.length === 1) return
|
|
784
|
+
if (e.length === 1) return u(e[0]);
|
|
768
785
|
let t = e.length;
|
|
769
786
|
return `linear-gradient(135deg, ${e.map((e, n) => {
|
|
770
787
|
let r = Math.round(n / (t - 1) * 100);
|
|
771
|
-
return `${
|
|
788
|
+
return `${u(e)} ${r}%`;
|
|
772
789
|
}).join(", ")})`;
|
|
773
790
|
}
|
|
774
|
-
function
|
|
775
|
-
|
|
776
|
-
return {
|
|
777
|
-
L: c,
|
|
778
|
-
C: l,
|
|
779
|
-
h: u
|
|
780
|
-
};
|
|
791
|
+
function Ke(e) {
|
|
792
|
+
return s(e);
|
|
781
793
|
}
|
|
782
|
-
var
|
|
783
|
-
function
|
|
784
|
-
return e ? [Math.max(0, Math.min(1, e[0])), Math.max(0, Math.min(1, e[1]))] : t === "dark" ?
|
|
794
|
+
var qe = [.35, .95], Je = [.18, .42];
|
|
795
|
+
function Ye(e, t) {
|
|
796
|
+
return e ? [Math.max(0, Math.min(1, e[0])), Math.max(0, Math.min(1, e[1]))] : t === "dark" ? Je : qe;
|
|
785
797
|
}
|
|
786
|
-
function
|
|
787
|
-
let n = typeof e == "string" ?
|
|
798
|
+
function Xe(e, t = {}) {
|
|
799
|
+
let n = typeof e == "string" ? s(e) : e, { stopCount: r = 4, harmony: i = "analogous", lightnessSpread: a = .32, chromaFalloff: o = .85, hueSpread: u = 28, lightnessEasing: d = "linear", chromaEasing: f = "bell", temperatureShift: p = 0, avoidHues: m, scheme: h, lBand: g } = t, _ = Math.max(2, Math.min(8, Math.round(r))), [v, y] = Ye(g, h), b = n.L - a / 2, x = n.L + a / 2;
|
|
788
800
|
b < v && (x += v - b, b = v), x > y && (b -= x - y, x = y), b = Math.max(v, b), x = Math.min(y, x);
|
|
789
801
|
let S = [], C = -Infinity;
|
|
790
802
|
for (let e = 0; e < _; e++) {
|
|
791
|
-
let t = _ === 1 ? 0 : e / (_ - 1), r = b + (x - b) *
|
|
792
|
-
if (f === "bell")
|
|
803
|
+
let t = _ === 1 ? 0 : e / (_ - 1), r = b + (x - b) * Qe(t, d), a = n.C * o, s;
|
|
804
|
+
if (f === "bell") s = a + (n.C - a) * $e(t);
|
|
793
805
|
else {
|
|
794
|
-
let e = f === "sine" ?
|
|
795
|
-
|
|
806
|
+
let e = f === "sine" ? Qe(t, "sine") : t;
|
|
807
|
+
s = n.C - (n.C - a) * e;
|
|
796
808
|
}
|
|
797
|
-
let h =
|
|
798
|
-
p > 0 && (h =
|
|
799
|
-
let g =
|
|
809
|
+
let h = c(n.h, i, u, t);
|
|
810
|
+
p > 0 && (h = rt(h, t, p)), m && m.length > 0 && (h = ot(h, m));
|
|
811
|
+
let g = Ze(l({
|
|
800
812
|
L: r,
|
|
801
|
-
C:
|
|
813
|
+
C: s,
|
|
802
814
|
h
|
|
803
815
|
}), C);
|
|
804
816
|
C = g.L, S.push(g);
|
|
805
817
|
}
|
|
806
818
|
return S;
|
|
807
819
|
}
|
|
808
|
-
function
|
|
820
|
+
function Ze(e, t) {
|
|
809
821
|
if (e.L >= t) return e;
|
|
810
822
|
let { h: n } = e, r = t, i = e.C;
|
|
811
823
|
for (let e = 0; e < 48; e++) {
|
|
812
|
-
let [e, t, a] =
|
|
813
|
-
|
|
824
|
+
let [e, t, a] = d({
|
|
825
|
+
L: r,
|
|
826
|
+
C: i,
|
|
827
|
+
h: n
|
|
828
|
+
});
|
|
829
|
+
if (Math.max(e, t, a) <= 1) break;
|
|
814
830
|
i *= .99;
|
|
815
831
|
}
|
|
816
832
|
return {
|
|
@@ -819,36 +835,36 @@ function it(e, t) {
|
|
|
819
835
|
h: n
|
|
820
836
|
};
|
|
821
837
|
}
|
|
822
|
-
function
|
|
838
|
+
function Qe(e, t) {
|
|
823
839
|
return t === "sine" ? .5 - .5 * Math.cos(Math.PI * e) : e;
|
|
824
840
|
}
|
|
825
|
-
function
|
|
841
|
+
function $e(e) {
|
|
826
842
|
return Math.sin(Math.PI * e);
|
|
827
843
|
}
|
|
828
|
-
var
|
|
829
|
-
function
|
|
844
|
+
var et = 70, tt = 250, nt = 22;
|
|
845
|
+
function rt(e, t, n) {
|
|
830
846
|
let r = (t - .5) * 2;
|
|
831
847
|
if (r === 0 || n === 0) return e;
|
|
832
|
-
let i = (ge(e, r >= 0 ?
|
|
833
|
-
return ((e + Math.sign(i) * Math.min(Math.abs(r) * n *
|
|
848
|
+
let i = (o("applyTemperature", ge(e, r >= 0 ? et : tt, 1, "shorter")) - e + 540) % 360 - 180;
|
|
849
|
+
return ((e + Math.sign(i) * Math.min(Math.abs(r) * n * nt, Math.abs(i))) % 360 + 360) % 360;
|
|
834
850
|
}
|
|
835
|
-
var
|
|
836
|
-
function
|
|
837
|
-
let r =
|
|
851
|
+
var U = (e) => (e % 360 + 360) % 360;
|
|
852
|
+
function it(e, t, n) {
|
|
853
|
+
let r = U(e), i = U(t), a = U(n);
|
|
838
854
|
return i <= a ? r >= i && r <= a : r >= i || r <= a;
|
|
839
855
|
}
|
|
840
|
-
function
|
|
841
|
-
let n = Math.abs(
|
|
856
|
+
function at(e, t) {
|
|
857
|
+
let n = Math.abs(U(e) - U(t)) % 360;
|
|
842
858
|
return n > 180 ? 360 - n : n;
|
|
843
859
|
}
|
|
844
|
-
function
|
|
845
|
-
let n = .5, r =
|
|
860
|
+
function ot(e, t) {
|
|
861
|
+
let n = .5, r = U(e);
|
|
846
862
|
for (let e = 0; e < t.length + 2; e++) {
|
|
847
863
|
let e = !1;
|
|
848
864
|
for (let [i, a] of t) {
|
|
849
|
-
if (!
|
|
850
|
-
let t =
|
|
851
|
-
r =
|
|
865
|
+
if (!it(r, i, a)) continue;
|
|
866
|
+
let t = U(i - n), o = U(a + n);
|
|
867
|
+
r = at(r, t) <= at(r, o) ? t : o, e = !0;
|
|
852
868
|
}
|
|
853
869
|
if (!e) return r;
|
|
854
870
|
}
|
|
@@ -856,15 +872,12 @@ function dt(e, t) {
|
|
|
856
872
|
}
|
|
857
873
|
//#endregion
|
|
858
874
|
//#region src/components/aurora/composables/uniformBridge.ts
|
|
859
|
-
var
|
|
875
|
+
var st = {
|
|
860
876
|
x: .5,
|
|
861
877
|
y: .5,
|
|
862
878
|
strength: 0,
|
|
863
|
-
radius: .25
|
|
864
|
-
|
|
865
|
-
velY: 0,
|
|
866
|
-
burst: 0
|
|
867
|
-
}, B = {
|
|
879
|
+
radius: .25
|
|
880
|
+
}, ct = {
|
|
868
881
|
smooth: 0,
|
|
869
882
|
pastel: 1,
|
|
870
883
|
watercolor: 2,
|
|
@@ -875,144 +888,146 @@ var ft = {
|
|
|
875
888
|
kuwahara: 7,
|
|
876
889
|
metal: 8,
|
|
877
890
|
"metal-gradient": 9
|
|
878
|
-
},
|
|
891
|
+
}, lt = {
|
|
879
892
|
shorter: 0,
|
|
880
893
|
longer: 1,
|
|
881
894
|
increasing: 2,
|
|
882
895
|
decreasing: 3
|
|
883
|
-
},
|
|
896
|
+
}, ut = {
|
|
884
897
|
none: 0,
|
|
885
898
|
radial: 1,
|
|
886
899
|
swirl: 2,
|
|
887
900
|
diagonal: 3,
|
|
888
901
|
multi: 4,
|
|
889
902
|
tensor: 5
|
|
890
|
-
},
|
|
903
|
+
}, dt = {
|
|
891
904
|
flow: 0,
|
|
892
905
|
tensor: 1
|
|
893
|
-
},
|
|
906
|
+
}, ft = {
|
|
894
907
|
fbm: 0,
|
|
895
908
|
cellular: 1,
|
|
896
909
|
hybrid: 2,
|
|
897
910
|
curl: 3
|
|
898
|
-
},
|
|
911
|
+
}, pt = {
|
|
899
912
|
oil: 0,
|
|
900
913
|
knife: 1,
|
|
901
914
|
chunky: 3
|
|
902
|
-
},
|
|
915
|
+
}, W = {
|
|
903
916
|
L: .985,
|
|
904
917
|
C: .0125,
|
|
905
918
|
h: 77.5
|
|
906
919
|
};
|
|
907
|
-
function
|
|
908
|
-
return e === void 0 ?
|
|
909
|
-
}
|
|
910
|
-
function _t(e) {
|
|
911
|
-
return B[e.medium];
|
|
920
|
+
function mt(e) {
|
|
921
|
+
return e === void 0 ? f(W.L, W.C, W.h) : Array.isArray(e) ? e : f(e.L, e.C, e.h);
|
|
912
922
|
}
|
|
913
|
-
function
|
|
914
|
-
return
|
|
923
|
+
function ht(e) {
|
|
924
|
+
return ct[e.medium];
|
|
915
925
|
}
|
|
916
|
-
function
|
|
917
|
-
return
|
|
926
|
+
function gt(e) {
|
|
927
|
+
return pt[e.strokeMode];
|
|
918
928
|
}
|
|
919
|
-
function
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
929
|
+
function _t(e) {
|
|
930
|
+
return e.medium === "vangogh" || e.medium === "oil-pastel" || e.medium === "crayon" || e.medium === "kuwahara" ? dt.tensor : dt[e.strokeOrient ?? "flow"];
|
|
931
|
+
}
|
|
932
|
+
function vt(e, t, n, r = !1) {
|
|
933
|
+
let i = (e) => 1 - e, a = {
|
|
934
|
+
palette: /* @__PURE__ */ new Float32Array(24),
|
|
935
|
+
pos: /* @__PURE__ */ new Float32Array(16),
|
|
936
|
+
rad: /* @__PURE__ */ new Float32Array(8),
|
|
937
|
+
pb: /* @__PURE__ */ new Float32Array(8),
|
|
938
|
+
vb: /* @__PURE__ */ new Float32Array(8),
|
|
939
|
+
dr: /* @__PURE__ */ new Float32Array(8),
|
|
940
|
+
dp: /* @__PURE__ */ new Float32Array(8),
|
|
941
|
+
elong: /* @__PURE__ */ new Float32Array(8),
|
|
942
|
+
angle: /* @__PURE__ */ new Float32Array(8)
|
|
930
943
|
};
|
|
931
|
-
return function(
|
|
932
|
-
e.useProgram(t),
|
|
933
|
-
let
|
|
934
|
-
e.uniform1i(n.uNucleiCount,
|
|
935
|
-
for (let e = 0; e <
|
|
936
|
-
let t =
|
|
937
|
-
|
|
944
|
+
return function(o) {
|
|
945
|
+
e.useProgram(t), H(o.palette, 8, a.palette), e.uniform3fv(n.uPalette, a.palette), e.uniform1i(n.uStopCount, Math.min(o.palette.length, 8));
|
|
946
|
+
let s = Math.min(o.nuclei.length, 8);
|
|
947
|
+
e.uniform1i(n.uNucleiCount, s);
|
|
948
|
+
for (let e = 0; e < s; e++) {
|
|
949
|
+
let t = o.nuclei[e];
|
|
950
|
+
a.pos[e * 2 + 0] = t.x, a.pos[e * 2 + 1] = i(t.y), a.rad[e] = t.radius, a.pb[e] = t.paletteBias, a.vb[e] = t.valueBias, a.dr[e] = t.driftRadius, a.dp[e] = t.driftPhase, a.elong[e] = t.elongation ?? 1, a.angle[e] = -(t.angle ?? 0) * Math.PI / 180;
|
|
938
951
|
}
|
|
939
|
-
for (let e =
|
|
940
|
-
e.uniform2fv(n.uNucleiPos,
|
|
941
|
-
let
|
|
942
|
-
e.uniform2f(n.uCursor,
|
|
952
|
+
for (let e = s; e < 8; e++) a.pos[e * 2 + 0] = 0, a.pos[e * 2 + 1] = 0, a.rad[e] = 0, a.pb[e] = 0, a.vb[e] = 0, a.dr[e] = 0, a.dp[e] = 0, a.elong[e] = 1, a.angle[e] = 0;
|
|
953
|
+
e.uniform2fv(n.uNucleiPos, a.pos), e.uniform1fv(n.uNucleiRadius, a.rad), e.uniform1fv(n.uNucleiPaletteBias, a.pb), e.uniform1fv(n.uNucleiValueBias, a.vb), e.uniform1fv(n.uNucleiDriftRadius, a.dr), e.uniform1fv(n.uNucleiDriftPhase, a.dp), e.uniform1fv(n.uNucleiElong, a.elong), e.uniform1fv(n.uNucleiAngle, a.angle), e.uniform1f(n.uSoftmaxBeta, o.softmaxBeta), e.uniform1f(n.uValueVariance, o.valueVariance), e.uniform1f(n.uWarpAmount, o.warpAmount), e.uniform1f(n.uWarpScale, o.warpScale), e.uniform1f(n.uWarpDrift, o.warpDrift), e.uniform1i(n.uWarpMode, ft[o.warpMode]), e.uniform1i(n.uNoiseOctaves, o.noiseOctaves), e.uniform1i(n.uMedium, ht(o)), e.uniform1i(n.uHuePath, lt[o.huePath ?? "shorter"]), e.uniform1i(n.uFlowPattern, ut[o.flow.pattern]), e.uniform2f(n.uFlowFocal, o.flow.focalX, i(o.flow.focalY)), e.uniform1f(n.uFlowAngle, o.flow.angle), e.uniform1f(n.uFlowCurl, o.flow.curl);
|
|
954
|
+
let c = st;
|
|
955
|
+
e.uniform2f(n.uCursor, c.x, i(c.y)), e.uniform1f(n.uCursorStrength, c.strength), e.uniform1f(n.uCursorRadius, c.radius), e.uniform1f(n.uStrokeAmount, o.strokeAmount), e.uniform1f(n.uStrokeScale, o.strokeScale), e.uniform1f(n.uStrokeAnisotropy, o.strokeAnisotropy), e.uniform1i(n.uStrokeLayers, o.strokeLayers), e.uniform1i(n.uStrokeMode, gt(o)), e.uniform1i(n.uStrokeOrient, _t(o));
|
|
943
956
|
{
|
|
944
|
-
let t =
|
|
957
|
+
let t = o.lightDir ?? [
|
|
945
958
|
-.5,
|
|
946
959
|
.6,
|
|
947
960
|
.62
|
|
948
|
-
], r =
|
|
961
|
+
], r = mt(o.lightColor);
|
|
949
962
|
e.uniform3f(n.uLightDir, t[0], t[1], t[2]), e.uniform3f(n.uLightColor, r[0], r[1], r[2]);
|
|
950
963
|
}
|
|
951
|
-
e.uniform1f(n.uWetEdge,
|
|
952
|
-
let
|
|
953
|
-
e.uniform1f(n.uImageAspect,
|
|
964
|
+
e.uniform1f(n.uWetEdge, o.wetEdge), e.uniform1f(n.uGranulation, o.granulation), e.uniform1f(n.uImpasto, o.impasto), e.uniform1f(n.uBrokenColor, o.brokenColor), e.uniform1f(n.uCanvasGrain, o.canvasGrain), e.uniform1f(n.uMetalPolish, o.metalPolish ?? 1), e.uniform1f(n.uMetalHeightScale, o.metalHeightScale ?? 1), e.uniform1f(n.uNucleiDrift, o.nucleiDrift), e.uniform1f(n.uPaletteDrift, o.paletteDrift), e.uniform1f(n.uBreathDepth, o.breathDepth), e.uniform1f(n.uBreathPeriod, o.breathPeriod), e.uniform1f(n.uSaturation, o.saturation), e.uniform1f(n.uPaperGrain, o.paperGrain), e.uniform1f(n.uAlpha, r ? 1 : o.alpha), e.uniform1f(n.uVividness, o.vividness ?? 1), e.uniform1i(n.uImage, 0), e.uniform1f(n.uBlurMin, o.imageBlur?.min ?? .004), e.uniform1f(n.uBlurMax, o.imageBlur?.max ?? .06);
|
|
965
|
+
let l = e.drawingBufferHeight > 0 ? e.drawingBufferWidth / e.drawingBufferHeight : 1;
|
|
966
|
+
e.uniform1f(n.uImageAspect, l);
|
|
954
967
|
};
|
|
955
968
|
}
|
|
956
969
|
//#endregion
|
|
957
|
-
//#region src/components/aurora/composables/
|
|
958
|
-
var
|
|
959
|
-
function
|
|
960
|
-
let
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
970
|
+
//#region src/components/aurora/composables/glSetup.ts
|
|
971
|
+
var G = "[Aurora]", yt = /* @__PURE__ */ "uTime.uPalette.uStopCount.uNucleiCount.uNucleiPos.uNucleiRadius.uNucleiPaletteBias.uNucleiValueBias.uNucleiDriftRadius.uNucleiDriftPhase.uNucleiElong.uNucleiAngle.uSoftmaxBeta.uValueVariance.uWarpAmount.uWarpScale.uWarpDrift.uWarpMode.uNoiseOctaves.uMedium.uHuePath.uFlowPattern.uFlowFocal.uFlowAngle.uFlowCurl.uCursor.uCursorStrength.uCursorRadius.uStrokeAmount.uStrokeScale.uStrokeAnisotropy.uStrokeLayers.uStrokeMode.uStrokeOrient.uLightDir.uLightColor.uWetEdge.uGranulation.uImpasto.uBrokenColor.uCanvasGrain.uMetalPolish.uMetalHeightScale.uNucleiDrift.uPaletteDrift.uBreathDepth.uBreathPeriod.uSaturation.uPaperGrain.uAlpha.uVividness.uImage.uBlurMin.uBlurMax.uImageAspect".split(".");
|
|
972
|
+
function bt(e, t, n) {
|
|
973
|
+
let r = D(e, e.VERTEX_SHADER, t, G), i = D(e, e.FRAGMENT_SHADER, n, G), a = ne(e, r, i, G);
|
|
974
|
+
e.useProgram(a);
|
|
975
|
+
let o = e.createVertexArray();
|
|
976
|
+
e.bindVertexArray(o);
|
|
977
|
+
let s = e.createBuffer();
|
|
978
|
+
e.bindBuffer(e.ARRAY_BUFFER, s), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
979
|
+
-1,
|
|
980
|
+
-1,
|
|
981
|
+
3,
|
|
982
|
+
-1,
|
|
983
|
+
-1,
|
|
984
|
+
3
|
|
985
|
+
]), e.STATIC_DRAW);
|
|
986
|
+
let c = e.getAttribLocation(a, "aPos");
|
|
987
|
+
e.enableVertexAttribArray(c), e.vertexAttribPointer(c, 2, e.FLOAT, !1, 0, 0);
|
|
988
|
+
let l = {};
|
|
989
|
+
for (let t of yt) l[t] = e.getUniformLocation(a, t);
|
|
965
990
|
return {
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
991
|
+
program: a,
|
|
992
|
+
vs: r,
|
|
993
|
+
fs: i,
|
|
994
|
+
uniforms: l,
|
|
995
|
+
geometry: {
|
|
996
|
+
vao: o,
|
|
997
|
+
buf: s
|
|
998
|
+
}
|
|
973
999
|
};
|
|
974
1000
|
}
|
|
975
|
-
function
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
function p() {
|
|
1000
|
-
if (s()) return !1;
|
|
1001
|
-
let e = o();
|
|
1002
|
-
return e.nucleiDrift !== 0 || e.paletteDrift !== 0 || e.breathDepth !== 0 || e.warpDrift !== 0 ? !0 : K(i);
|
|
1003
|
-
}
|
|
1004
|
-
return {
|
|
1005
|
-
frame: (e) => {
|
|
1006
|
-
let t = d(), n = l === null ? 0 : Math.max(0, (e - l) * 1e3);
|
|
1007
|
-
l = e, i.tick(t === 0 ? 0 : n), u = G(i, a(), t), f(e);
|
|
1008
|
-
},
|
|
1009
|
-
needsAnimation: p
|
|
1001
|
+
function xt(e) {
|
|
1002
|
+
return (t) => {
|
|
1003
|
+
let n = e.getConfig().source === "image", { program: r, vs: i, fs: a, uniforms: o, geometry: s } = bt(t, Ce, n ? Fe : Pe), c = n ? Se(t, r, e.imageCoordinator) : null, l = (e) => {
|
|
1004
|
+
t.viewport(0, 0, e?.w ?? t.canvas.width, e?.h ?? t.canvas.height), t.useProgram(r);
|
|
1005
|
+
}, u = vt(t, r, o, e.opaquePresentation), d = (e) => u(e);
|
|
1006
|
+
e.registerConfigUploader(d), d(e.getConfig());
|
|
1007
|
+
let f = Le({
|
|
1008
|
+
gl: t,
|
|
1009
|
+
prog: r,
|
|
1010
|
+
uniforms: o,
|
|
1011
|
+
pointerField: e.pointerField,
|
|
1012
|
+
getCursorScalars: e.getCursorScalars,
|
|
1013
|
+
getConfig: e.getConfig,
|
|
1014
|
+
getReducedMotion: e.getReducedMotion,
|
|
1015
|
+
getRenderTime: e.getRenderTime
|
|
1016
|
+
});
|
|
1017
|
+
return t.clearColor(0, 0, 0, +!!e.opaquePresentation), t.disable(t.DEPTH_TEST), e.opaquePresentation ? t.disable(t.BLEND) : (t.enable(t.BLEND), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA)), {
|
|
1018
|
+
frame: f.frame,
|
|
1019
|
+
shouldContinue: f.needsAnimation,
|
|
1020
|
+
resize: l,
|
|
1021
|
+
teardown: () => {
|
|
1022
|
+
e.registerConfigUploader(null), t.deleteProgram(r), t.deleteShader(i), t.deleteShader(a), t.deleteBuffer(s.buf), t.deleteVertexArray(s.vao), c?.();
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1010
1025
|
};
|
|
1011
1026
|
}
|
|
1012
1027
|
//#endregion
|
|
1013
1028
|
//#region src/components/aurora/constants/shaders/aurora.wgsl.ts
|
|
1014
|
-
var
|
|
1015
|
-
const MAX_NUCLEI: i32 =
|
|
1029
|
+
var St = `
|
|
1030
|
+
const MAX_NUCLEI: i32 = 8;
|
|
1016
1031
|
const MAX_STOPS: i32 = 8;
|
|
1017
1032
|
const PI: f32 = 3.141592653589793;
|
|
1018
1033
|
|
|
@@ -1029,10 +1044,10 @@ struct Uniforms {
|
|
|
1029
1044
|
// scalars2: (uAlpha, uNucleiDrift, uPaletteDrift, uBreathDepth)
|
|
1030
1045
|
scalars2: vec4<f32>,
|
|
1031
1046
|
// scalars3: (uBreathPeriod, uCursorStrength, uCursorRadius, uVividness)
|
|
1032
|
-
//
|
|
1047
|
+
// The .w pad lane now carries the chroma-floor strength.
|
|
1033
1048
|
scalars3: vec4<f32>,
|
|
1034
1049
|
// cursor: (uCursor.x, uCursor.y, uMetalPolish, uMetalHeightScale)
|
|
1035
|
-
//
|
|
1050
|
+
// The two free pad lanes carry the metal-medium knobs (the
|
|
1036
1051
|
// metal light is cursor-synthesized so it reads in-struct on the WGSL primary too).
|
|
1037
1052
|
cursor: vec4<f32>,
|
|
1038
1053
|
// ints: (uStopCount, uNucleiCount, uWarpMode, uNoiseOctaves)
|
|
@@ -1040,10 +1055,10 @@ struct Uniforms {
|
|
|
1040
1055
|
// ints1: (uMedium, uHuePath, _, _)
|
|
1041
1056
|
ints1: vec4<i32>,
|
|
1042
1057
|
palette: array<vec4<f32>, 8>,
|
|
1043
|
-
nuc0: array<vec4<f32>,
|
|
1044
|
-
nuc1: array<vec4<f32>,
|
|
1045
|
-
nuc2: array<vec4<f32>,
|
|
1046
|
-
//
|
|
1058
|
+
nuc0: array<vec4<f32>, 8>,
|
|
1059
|
+
nuc1: array<vec4<f32>, 8>,
|
|
1060
|
+
nuc2: array<vec4<f32>, 8>,
|
|
1061
|
+
// The painterly-medium scalar lanes are appended after the
|
|
1047
1062
|
// arrays so EVERY existing offset (and the smooth-default parity capture) is
|
|
1048
1063
|
// byte-identical (these lanes are written 0 on a smooth config). scalars4:
|
|
1049
1064
|
// (uStrokeAmount, uStrokeScale, uStrokeAnisotropy, uCanvasGrain). scalars5:
|
|
@@ -1062,7 +1077,7 @@ const K_NUCLEI: f32 = 14.0;
|
|
|
1062
1077
|
const K_PAL: f32 = 24.0;
|
|
1063
1078
|
const K_WARP: f32 = 5.0;
|
|
1064
1079
|
|
|
1065
|
-
// ── Noise (
|
|
1080
|
+
// ── Noise (Aurora-local hash21/vnoise/fbm, deliberately distinct) ──────────
|
|
1066
1081
|
fn hash21(p0: vec2<f32>) -> f32 {
|
|
1067
1082
|
var p = fract(p0 * vec2<f32>(123.34, 456.21));
|
|
1068
1083
|
p = p + dot(p, p + 45.32);
|
|
@@ -1086,7 +1101,7 @@ fn vnoise(p: vec2<f32>) -> f32 {
|
|
|
1086
1101
|
return mix(mix(a, b, uu.x), mix(c, d, uu.x), uu.y);
|
|
1087
1102
|
}
|
|
1088
1103
|
|
|
1089
|
-
${
|
|
1104
|
+
${w}
|
|
1090
1105
|
|
|
1091
1106
|
fn fbm(p0: vec2<f32>) -> f32 {
|
|
1092
1107
|
var v = 0.0;
|
|
@@ -1102,16 +1117,19 @@ fn fbm(p0: vec2<f32>) -> f32 {
|
|
|
1102
1117
|
return v;
|
|
1103
1118
|
}
|
|
1104
1119
|
|
|
1105
|
-
|
|
1106
|
-
${
|
|
1107
|
-
|
|
1120
|
+
fn potentialFBM(p: vec2f) -> f32 { return fbm(p); }
|
|
1121
|
+
${ie}
|
|
1122
|
+
|
|
1123
|
+
${y}
|
|
1124
|
+
${S}
|
|
1125
|
+
${_}
|
|
1108
1126
|
|
|
1109
1127
|
// Interleaved Gradient Noise (Jimenez) — display-space 1-LSB dither.
|
|
1110
1128
|
fn ign(p: vec2<f32>) -> f32 {
|
|
1111
1129
|
return fract(52.9829189 * fract(dot(p, vec2<f32>(0.06711056, 0.00583715))));
|
|
1112
1130
|
}
|
|
1113
1131
|
|
|
1114
|
-
// Cellular
|
|
1132
|
+
// Cellular, Worley f1.
|
|
1115
1133
|
fn cellular(p: vec2<f32>) -> f32 {
|
|
1116
1134
|
let i = floor(p);
|
|
1117
1135
|
let f = fract(p);
|
|
@@ -1127,7 +1145,7 @@ fn cellular(p: vec2<f32>) -> f32 {
|
|
|
1127
1145
|
return sqrt(m);
|
|
1128
1146
|
}
|
|
1129
1147
|
|
|
1130
|
-
// ── Warp (Quilez double warp + the
|
|
1148
|
+
// ── Warp (Quilez double warp + the four warp modes + the cursor swirl) ──
|
|
1131
1149
|
fn domainWarp(p: vec2<f32>, t: f32) -> vec2<f32> {
|
|
1132
1150
|
let warpScale = u.scalars1.x;
|
|
1133
1151
|
let warpDrift = u.scalars1.y;
|
|
@@ -1153,6 +1171,9 @@ fn domainWarp(p: vec2<f32>, t: f32) -> vec2<f32> {
|
|
|
1153
1171
|
let c1 = cellular(p * warpScale * 1.2);
|
|
1154
1172
|
let c2 = cellular(p * warpScale * 1.2 + vec2<f32>(11.0, 7.0));
|
|
1155
1173
|
warp = mix(r, vec2<f32>(c1, c2), 0.5);
|
|
1174
|
+
} else if (warpMode == 3) {
|
|
1175
|
+
let fp = p * warpScale + vec2<f32>(t * warpDrift * K_WARP);
|
|
1176
|
+
warp = curlFBM(fp);
|
|
1156
1177
|
}
|
|
1157
1178
|
var warped = p + warpAmount * warp;
|
|
1158
1179
|
|
|
@@ -1241,7 +1262,7 @@ fn saturate3(c: vec3<f32>, amt: f32) -> vec3<f32> {
|
|
|
1241
1262
|
return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3<f32>(0.0));
|
|
1242
1263
|
}
|
|
1243
1264
|
|
|
1244
|
-
//
|
|
1265
|
+
// The chroma floor, the WGSL twin of the GLSL vividnessFloor.
|
|
1245
1266
|
// OKLab chroma lifted toward the floor, hue + L preserved; below VIVID_EPS the (a,b)
|
|
1246
1267
|
// direction is precision noise so the lift synthesizes along the WARM anchor (amber,
|
|
1247
1268
|
// both components positive) — never teal/navy. vividness (scalars3.w) == 0 is a no-op
|
|
@@ -1280,7 +1301,7 @@ fn aces(color0: vec3<f32>) -> vec3<f32> {
|
|
|
1280
1301
|
return clamp(mix(color, newPeak * vec3<f32>(1.0), g), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
1281
1302
|
}
|
|
1282
1303
|
|
|
1283
|
-
// ──
|
|
1304
|
+
// ── Painterly-medium bodies (the keystone WGSL port) ───────────────────────
|
|
1284
1305
|
// Spliced HERE, after every helper the mediums consume is defined (domainWarp,
|
|
1285
1306
|
// nucleiField, samplePalette, linOklab, saturate3, oklabToOklch/oklchToOklab,
|
|
1286
1307
|
// hash21/vnoise/fbm) and before the vertex/fragment stages. applyMedium(col,p,t)
|
|
@@ -1298,17 +1319,17 @@ fn mGranulation() -> f32 { return u.scalars5.y; }
|
|
|
1298
1319
|
fn mBrokenColor() -> f32 { return u.scalars5.z; }
|
|
1299
1320
|
fn mKuwaharaQ() -> f32 { return u.scalars5.w; }
|
|
1300
1321
|
fn mKuwaharaRadius() -> f32 { return u.kuwahara.x; }
|
|
1301
|
-
//
|
|
1322
|
+
// The metal-medium knobs ride the free cursor.z/.w pad lanes
|
|
1302
1323
|
// (uniformBridgeWGPU packs them; written 0 on a non-metal config → no-op). These read
|
|
1303
1324
|
// the IN-STRUCT cursor — the metal light is cursor-synthesized so it crosses to WGSL
|
|
1304
|
-
// (a phantom uLightDir read would be flat on the primary
|
|
1325
|
+
// (a phantom uLightDir read would be flat on the primary; uLightDir is fragment-only).
|
|
1305
1326
|
fn mMetalPolish() -> f32 { return u.cursor.z; }
|
|
1306
1327
|
fn mMetalHeightScale() -> f32 { return u.cursor.w; }
|
|
1307
1328
|
|
|
1308
|
-
// ── Gradient pack (
|
|
1329
|
+
// ── Gradient pack (the WGSL twin) ──────────────────────────────────────────
|
|
1309
1330
|
// structureTensorField re-plumbs its already-computed luma gradient (Gx,Gy) out
|
|
1310
|
-
// through the return's .w lane so the metal medium pays ZERO extra taps. 12 bits per
|
|
1311
|
-
// bounded component ([-4,4]) into one f32; the crayon/kuwahara callers read only .xy/.z.
|
|
1331
|
+
// through the return value's .w lane so the metal medium pays ZERO extra taps. 12 bits per
|
|
1332
|
+
// bounded component ([-4,4]) fit into one f32; the crayon/kuwahara callers read only .xy/.z.
|
|
1312
1333
|
fn packGrad(gx: f32, gy: f32) -> f32 {
|
|
1313
1334
|
let qx = floor(clamp(gx * 0.125 + 0.5, 0.0, 1.0) * 4095.0);
|
|
1314
1335
|
let qy = floor(clamp(gy * 0.125 + 0.5, 0.0, 1.0) * 4095.0);
|
|
@@ -1340,10 +1361,10 @@ fn brokenColorJitter(c: vec3<f32>, hueSeed: f32, valueSeed: f32, strength: f32)
|
|
|
1340
1361
|
return max(oklabToLinearSrgb(oklchToOklab(lch)), vec3<f32>(0.0));
|
|
1341
1362
|
}
|
|
1342
1363
|
|
|
1343
|
-
// ── Structure
|
|
1364
|
+
// ── Structure tensor / edge-tangent flow (the WGSL twin) ───────────────────
|
|
1344
1365
|
// Returns vec4(tangent.x, tangent.y, A, packGrad(Gx,Gy)) — the minor-eigenvector
|
|
1345
|
-
// edge-tangent + coherence + the metal medium's packed gradient
|
|
1346
|
-
//
|
|
1366
|
+
// edge-tangent + coherence + the metal medium's packed gradient. The .xy/.z
|
|
1367
|
+
// crayon/kuwahara callers are byte-unchanged.
|
|
1347
1368
|
fn structureTensorField(p: vec2<f32>, t: f32, fallbackDir: vec2<f32>) -> vec4<f32> {
|
|
1348
1369
|
let e = 0.0035;
|
|
1349
1370
|
let l00 = dot(sampleBase(p + vec2<f32>(-e, -e), t), W_LUMA);
|
|
@@ -1630,18 +1651,18 @@ fn mediumMetalGradient(col: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {
|
|
|
1630
1651
|
// (pastel/watercolor/crayon) + kuwahara + metal port their own bodies; the
|
|
1631
1652
|
// oil/vangogh/oil-pastel STROKE cascade renders the anisotropic-Kuwahara PAINTERLY
|
|
1632
1653
|
// finish here (a real oil-paint read, never the smooth core — the "NO FALLBACKS on
|
|
1633
|
-
// Safari" mandate; the full per-dab Starry-Night stroke WGSL
|
|
1634
|
-
//
|
|
1654
|
+
// Safari" mandate; the full per-dab Starry-Night stroke WGSL remains a separate
|
|
1655
|
+
// full-fidelity port).
|
|
1635
1656
|
fn applyMedium(col: vec3<f32>, p: vec2<f32>, t: f32) -> vec3<f32> {
|
|
1636
1657
|
let medium = u.ints1.x;
|
|
1637
1658
|
if (medium == 1) { return mediumPastel(col, p, t); }
|
|
1638
1659
|
if (medium == 2) { return mediumWatercolor(col, p, t); }
|
|
1639
1660
|
if (medium == 4) { return mediumCrayon(col, p, t); }
|
|
1640
|
-
//
|
|
1641
|
-
// WGSL primary
|
|
1661
|
+
// Metal uses both renderer paths; a fragment-only implementation is invisible on the
|
|
1662
|
+
// WGSL primary. IDs 8 and 9 select metal and metal-gradient respectively.
|
|
1642
1663
|
if (medium == 8) { return mediumMetal(col, p, t); }
|
|
1643
1664
|
if (medium == 9) { return mediumMetalGradient(col, p, t); }
|
|
1644
|
-
// oil(3)
|
|
1665
|
+
// oil(3), vangogh(5), oil-pastel(6), kuwahara(7) all render the painterly
|
|
1645
1666
|
// anisotropic-Kuwahara finish on the WGSL primary (the WebGL2 fallback carries the
|
|
1646
1667
|
// full per-dab stroke cascade for oil/vangogh/oil-pastel).
|
|
1647
1668
|
if (medium == 3 || medium == 5 || medium == 6 || medium == 7) {
|
|
@@ -1695,17 +1716,23 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1695
1716
|
let breath = sin(t * 6.2831 / max(breathPeriod, 1.0));
|
|
1696
1717
|
col = col * (1.0 + breathDepth * breath * 0.5);
|
|
1697
1718
|
|
|
1698
|
-
//
|
|
1699
|
-
// no-op pass-through so the DEFAULT smooth config
|
|
1700
|
-
//
|
|
1719
|
+
// Painterly-medium dispatch. uMedium 0 (smooth) is a
|
|
1720
|
+
// no-op pass-through so the DEFAULT smooth config renders unchanged
|
|
1721
|
+
// (the parity capture); uMedium 1-7 render the painterly
|
|
1701
1722
|
// bodies (pastel/watercolor/crayon/kuwahara) or the anisotropic-Kuwahara finish
|
|
1702
1723
|
// (oil/vangogh/oil-pastel) — never a silent smooth degrade on Safari 26.
|
|
1703
1724
|
col = applyMedium(col, pN, t);
|
|
1704
1725
|
|
|
1726
|
+
// Cursor-local luminance lean, byte-parallel with the GLSL path.
|
|
1727
|
+
let cursorDelta = pN - u.cursor.xy;
|
|
1728
|
+
let cursorRadius = max(u.scalars3.z, 0.01);
|
|
1729
|
+
let cursorLean = exp(-dot(cursorDelta, cursorDelta) / (cursorRadius * cursorRadius * 0.5));
|
|
1730
|
+
col = col * (1.0 + 0.12 * cursorLean * u.scalars3.y);
|
|
1731
|
+
|
|
1705
1732
|
// Saturation trim.
|
|
1706
1733
|
col = saturate3(col, saturation);
|
|
1707
1734
|
|
|
1708
|
-
//
|
|
1735
|
+
// The chroma floor is warm-anchored and hue-preserving. The WGSL
|
|
1709
1736
|
// twin of the GLSL call; vividness:0 is a no-op so the smooth/pale default stays gated.
|
|
1710
1737
|
col = vividnessFloor(col, vividness);
|
|
1711
1738
|
|
|
@@ -1727,14 +1754,14 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1727
1754
|
// Premultiply on DISPLAY-space color (matches the WebGL2 path: OETF, then premul).
|
|
1728
1755
|
return vec4<f32>(col * alpha, alpha);
|
|
1729
1756
|
}
|
|
1730
|
-
`,
|
|
1731
|
-
const MAX_NUCLEI: i32 =
|
|
1757
|
+
`, Ct = `
|
|
1758
|
+
const MAX_NUCLEI: i32 = 8;
|
|
1732
1759
|
const PI: f32 = 3.141592653589793;
|
|
1733
1760
|
const BLUR_RINGS: i32 = 3;
|
|
1734
1761
|
const BLUR_SECTORS: i32 = 8;
|
|
1735
1762
|
|
|
1736
1763
|
// The image program's OWN uniform struct (packed vec4 lanes — trivial std140/WGSL
|
|
1737
|
-
// alignment). DISTINCT from the palette program's
|
|
1764
|
+
// alignment). DISTINCT from the palette program's 672-byte struct (a separate program).
|
|
1738
1765
|
struct ImageUniforms {
|
|
1739
1766
|
// scalars0: (uTime, uWarpAmount, uWarpScale, uWarpDrift)
|
|
1740
1767
|
scalars0: vec4<f32>,
|
|
@@ -1749,8 +1776,8 @@ struct ImageUniforms {
|
|
|
1749
1776
|
// ints: (uNucleiCount, uNoiseOctaves, _, _)
|
|
1750
1777
|
ints: vec4<i32>,
|
|
1751
1778
|
// nuc0[i] = (pos.x, pos.y, radius, valueBias); nuc1[i] = (driftRadius, driftPhase, elong, angle)
|
|
1752
|
-
nuc0: array<vec4<f32>,
|
|
1753
|
-
nuc1: array<vec4<f32>,
|
|
1779
|
+
nuc0: array<vec4<f32>, 8>,
|
|
1780
|
+
nuc1: array<vec4<f32>, 8>,
|
|
1754
1781
|
};
|
|
1755
1782
|
|
|
1756
1783
|
@group(0) @binding(0) var<uniform> u: ImageUniforms;
|
|
@@ -1776,7 +1803,7 @@ fn vnoise(p: vec2<f32>) -> f32 {
|
|
|
1776
1803
|
let d = hash21(i + vec2<f32>(1.0, 1.0));
|
|
1777
1804
|
return mix(mix(a, b, uu.x), mix(c, d, uu.x), uu.y);
|
|
1778
1805
|
}
|
|
1779
|
-
${
|
|
1806
|
+
${w}
|
|
1780
1807
|
fn fbm(p0: vec2<f32>) -> f32 {
|
|
1781
1808
|
var v = 0.0;
|
|
1782
1809
|
var a = 0.5;
|
|
@@ -1794,8 +1821,8 @@ fn ign(p: vec2<f32>) -> f32 {
|
|
|
1794
1821
|
return fract(52.9829189 * fract(dot(p, vec2<f32>(0.06711056, 0.00583715))));
|
|
1795
1822
|
}
|
|
1796
1823
|
|
|
1797
|
-
${
|
|
1798
|
-
${
|
|
1824
|
+
${y}
|
|
1825
|
+
${S}
|
|
1799
1826
|
|
|
1800
1827
|
fn linOklab(lin: vec3<f32>) -> vec3<f32> {
|
|
1801
1828
|
let lms = LINEAR_SRGB_TO_LMS * lin;
|
|
@@ -1957,6 +1984,11 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1957
1984
|
let radius = mix(blurMin, blurMax, zone);
|
|
1958
1985
|
var col = zoneBlur(uv, radius);
|
|
1959
1986
|
|
|
1987
|
+
let cursorDelta = uv - u.cursor.xy;
|
|
1988
|
+
let cursorRadius = max(u.scalars1.w, 0.01);
|
|
1989
|
+
let cursorLean = exp(-dot(cursorDelta, cursorDelta) / (cursorRadius * cursorRadius * 0.5));
|
|
1990
|
+
col = col * (1.0 + 0.12 * cursorLean * u.scalars1.z);
|
|
1991
|
+
|
|
1960
1992
|
col = saturate3(col, saturation);
|
|
1961
1993
|
col = vividnessFloor(col, vividness);
|
|
1962
1994
|
|
|
@@ -1971,7 +2003,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1971
2003
|
|
|
1972
2004
|
return vec4<f32>(col * alpha, alpha);
|
|
1973
2005
|
}
|
|
1974
|
-
`,
|
|
2006
|
+
`, K = {
|
|
1975
2007
|
scalars0: 0,
|
|
1976
2008
|
scalars1: 4,
|
|
1977
2009
|
scalars2: 8,
|
|
@@ -1981,40 +2013,40 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1981
2013
|
ints1: 24,
|
|
1982
2014
|
palette: 28,
|
|
1983
2015
|
nuc0: 60,
|
|
1984
|
-
nuc1:
|
|
1985
|
-
nuc2:
|
|
1986
|
-
scalars4:
|
|
1987
|
-
scalars5:
|
|
1988
|
-
kuwahara:
|
|
1989
|
-
},
|
|
1990
|
-
function
|
|
1991
|
-
let e = /* @__PURE__ */ new ArrayBuffer(
|
|
2016
|
+
nuc1: 92,
|
|
2017
|
+
nuc2: 124,
|
|
2018
|
+
scalars4: 156,
|
|
2019
|
+
scalars5: 160,
|
|
2020
|
+
kuwahara: 164
|
|
2021
|
+
}, wt = .01, Tt = 8, Et = 4, Dt = (e) => 1 - e;
|
|
2022
|
+
function Ot() {
|
|
2023
|
+
let e = /* @__PURE__ */ new ArrayBuffer(672);
|
|
1992
2024
|
return {
|
|
1993
2025
|
buffer: e,
|
|
1994
2026
|
f32: new Float32Array(e),
|
|
1995
2027
|
i32: new Int32Array(e),
|
|
1996
|
-
paletteScratch: new Float32Array(24)
|
|
2028
|
+
paletteScratch: /* @__PURE__ */ new Float32Array(24)
|
|
1997
2029
|
};
|
|
1998
2030
|
}
|
|
1999
|
-
function
|
|
2000
|
-
let { f32:
|
|
2001
|
-
|
|
2002
|
-
let
|
|
2003
|
-
|
|
2031
|
+
function kt(e, t, n, r, i = t.alpha) {
|
|
2032
|
+
let { f32: a, i32: o, paletteScratch: s } = e;
|
|
2033
|
+
a[K.scalars0 + 0] = r, a[K.scalars0 + 1] = t.softmaxBeta, a[K.scalars0 + 2] = t.valueVariance, a[K.scalars0 + 3] = t.warpAmount, a[K.scalars1 + 0] = t.warpScale, a[K.scalars1 + 1] = t.warpDrift, a[K.scalars1 + 2] = t.saturation, a[K.scalars1 + 3] = t.paperGrain, a[K.scalars2 + 0] = i, a[K.scalars2 + 1] = t.nucleiDrift, a[K.scalars2 + 2] = t.paletteDrift, a[K.scalars2 + 3] = t.breathDepth, a[K.scalars3 + 0] = t.breathPeriod, a[K.scalars3 + 1] = n.strength, a[K.scalars3 + 2] = n.radius, a[K.scalars3 + 3] = t.vividness ?? 1, a[K.cursor + 0] = n.x, a[K.cursor + 1] = Dt(n.y), a[K.cursor + 2] = t.metalPolish ?? 1, a[K.cursor + 3] = t.metalHeightScale ?? 1, o[K.ints0 + 0] = Math.min(t.palette.length, 8);
|
|
2034
|
+
let c = Math.min(t.nuclei.length, 8);
|
|
2035
|
+
o[K.ints0 + 1] = c, o[K.ints0 + 2] = ft[t.warpMode], o[K.ints0 + 3] = t.noiseOctaves, o[K.ints1 + 0] = ct[t.medium], o[K.ints1 + 1] = lt[t.huePath ?? "shorter"], o[K.ints1 + 2] = 0, o[K.ints1 + 3] = 0, H(t.palette, 8, s);
|
|
2004
2036
|
for (let e = 0; e < 8; e++) {
|
|
2005
|
-
let t =
|
|
2006
|
-
|
|
2037
|
+
let t = K.palette + e * 4;
|
|
2038
|
+
a[t + 0] = s[e * 3 + 0], a[t + 1] = s[e * 3 + 1], a[t + 2] = s[e * 3 + 2], a[t + 3] = 0;
|
|
2007
2039
|
}
|
|
2008
|
-
for (let e = 0; e <
|
|
2009
|
-
let n =
|
|
2010
|
-
if (e <
|
|
2040
|
+
for (let e = 0; e < 8; e++) {
|
|
2041
|
+
let n = K.nuc0 + e * 4, r = K.nuc1 + e * 4, i = K.nuc2 + e * 4;
|
|
2042
|
+
if (e < c) {
|
|
2011
2043
|
let o = t.nuclei[e];
|
|
2012
|
-
|
|
2013
|
-
} else
|
|
2044
|
+
a[n + 0] = o.x, a[n + 1] = Dt(o.y), a[n + 2] = o.radius, a[n + 3] = o.paletteBias, a[r + 0] = o.valueBias, a[r + 1] = o.driftRadius, a[r + 2] = o.driftPhase, a[r + 3] = o.elongation ?? 1, a[i + 0] = -(o.angle ?? 0) * Math.PI / 180, a[i + 1] = 0, a[i + 2] = 0, a[i + 3] = 0;
|
|
2045
|
+
} else a[n + 0] = 0, a[n + 1] = 0, a[n + 2] = 0, a[n + 3] = 0, a[r + 0] = 0, a[r + 1] = 0, a[r + 2] = 0, a[r + 3] = 1, a[i + 0] = 0, a[i + 1] = 0, a[i + 2] = 0, a[i + 3] = 0;
|
|
2014
2046
|
}
|
|
2015
|
-
return
|
|
2047
|
+
return a[K.scalars4 + 0] = t.strokeAmount, a[K.scalars4 + 1] = t.strokeScale, a[K.scalars4 + 2] = t.strokeAnisotropy, a[K.scalars4 + 3] = t.canvasGrain, a[K.scalars5 + 0] = t.wetEdge, a[K.scalars5 + 1] = t.granulation, a[K.scalars5 + 2] = t.brokenColor, a[K.scalars5 + 3] = t.kuwaharaQ ?? Et, a[K.kuwahara + 0] = t.kuwaharaRadius ?? wt, a[K.kuwahara + 1] = Tt, a[K.kuwahara + 2] = 0, a[K.kuwahara + 3] = 0, e;
|
|
2016
2048
|
}
|
|
2017
|
-
var
|
|
2049
|
+
var q = {
|
|
2018
2050
|
scalars0: 0,
|
|
2019
2051
|
scalars1: 4,
|
|
2020
2052
|
scalars2: 8,
|
|
@@ -2022,154 +2054,155 @@ var J = {
|
|
|
2022
2054
|
cursor: 16,
|
|
2023
2055
|
ints: 20,
|
|
2024
2056
|
nuc0: 24,
|
|
2025
|
-
nuc1:
|
|
2026
|
-
},
|
|
2027
|
-
function
|
|
2028
|
-
let e = /* @__PURE__ */ new ArrayBuffer(
|
|
2057
|
+
nuc1: 56
|
|
2058
|
+
}, At = (e) => 1 - e;
|
|
2059
|
+
function jt() {
|
|
2060
|
+
let e = /* @__PURE__ */ new ArrayBuffer(352);
|
|
2029
2061
|
return {
|
|
2030
2062
|
buffer: e,
|
|
2031
2063
|
f32: new Float32Array(e),
|
|
2032
2064
|
i32: new Int32Array(e)
|
|
2033
2065
|
};
|
|
2034
2066
|
}
|
|
2035
|
-
function
|
|
2036
|
-
let { f32:
|
|
2037
|
-
|
|
2038
|
-
let
|
|
2039
|
-
|
|
2040
|
-
for (let e = 0; e <
|
|
2041
|
-
let n =
|
|
2042
|
-
if (e <
|
|
2067
|
+
function Mt(e, t, n, r, i, a = t.alpha) {
|
|
2068
|
+
let { f32: o, i32: s } = e;
|
|
2069
|
+
o[q.scalars0 + 0] = r, o[q.scalars0 + 1] = t.warpAmount, o[q.scalars0 + 2] = t.warpScale, o[q.scalars0 + 3] = t.warpDrift, o[q.scalars1 + 0] = t.softmaxBeta, o[q.scalars1 + 1] = t.nucleiDrift, o[q.scalars1 + 2] = n.strength, o[q.scalars1 + 3] = n.radius, o[q.scalars2 + 0] = t.saturation, o[q.scalars2 + 1] = t.paperGrain, o[q.scalars2 + 2] = a, o[q.scalars2 + 3] = t.vividness ?? 1, o[q.image + 0] = t.imageBlur?.min ?? .004, o[q.image + 1] = t.imageBlur?.max ?? .06, o[q.image + 2] = i, o[q.image + 3] = 0, o[q.cursor + 0] = n.x, o[q.cursor + 1] = At(n.y), o[q.cursor + 2] = 0, o[q.cursor + 3] = 0;
|
|
2070
|
+
let c = Math.min(t.nuclei.length, 8);
|
|
2071
|
+
s[q.ints + 0] = c, s[q.ints + 1] = t.noiseOctaves, s[q.ints + 2] = 0, s[q.ints + 3] = 0;
|
|
2072
|
+
for (let e = 0; e < 8; e++) {
|
|
2073
|
+
let n = q.nuc0 + e * 4, r = q.nuc1 + e * 4;
|
|
2074
|
+
if (e < c) {
|
|
2043
2075
|
let i = t.nuclei[e];
|
|
2044
|
-
|
|
2045
|
-
} else
|
|
2076
|
+
o[n + 0] = i.x, o[n + 1] = At(i.y), o[n + 2] = i.radius, o[n + 3] = i.valueBias, o[r + 0] = i.driftRadius, o[r + 1] = i.driftPhase, o[r + 2] = i.elongation ?? 1, o[r + 3] = -(i.angle ?? 0) * Math.PI / 180;
|
|
2077
|
+
} else o[n + 0] = 0, o[n + 1] = 0, o[n + 2] = 0, o[n + 3] = 0, o[r + 0] = 0, o[r + 1] = 0, o[r + 2] = 1, o[r + 3] = 0;
|
|
2046
2078
|
}
|
|
2047
2079
|
return e;
|
|
2048
2080
|
}
|
|
2049
2081
|
//#endregion
|
|
2050
2082
|
//#region src/components/aurora/composables/wgpuSetup.ts
|
|
2051
|
-
var
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2083
|
+
var J = 2, Nt = {
|
|
2084
|
+
color: {
|
|
2085
|
+
srcFactor: "one",
|
|
2086
|
+
dstFactor: "one-minus-src-alpha",
|
|
2087
|
+
operation: "add"
|
|
2088
|
+
},
|
|
2089
|
+
alpha: {
|
|
2090
|
+
srcFactor: "one",
|
|
2091
|
+
dstFactor: "one-minus-src-alpha",
|
|
2092
|
+
operation: "add"
|
|
2093
|
+
}
|
|
2094
|
+
};
|
|
2095
|
+
function Pt(e) {
|
|
2096
|
+
let { canvas: t, opaquePresentation: n, getCursorScalars: r, getConfig: i, getReducedMotion: a, getRenderTime: o, pointerField: s, getDecodedImage: c, registerImageUploader: l } = e, u = null;
|
|
2097
|
+
return function(e, d, f) {
|
|
2098
|
+
if (i().source === "image") return Ft(e, d, f, {
|
|
2056
2099
|
canvas: t,
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2100
|
+
opaquePresentation: n,
|
|
2101
|
+
getCursorScalars: r,
|
|
2102
|
+
getConfig: i,
|
|
2103
|
+
getReducedMotion: a,
|
|
2104
|
+
getRenderTime: o,
|
|
2105
|
+
pointerField: s,
|
|
2106
|
+
getDecodedImage: c,
|
|
2107
|
+
registerImageUploader: l
|
|
2063
2108
|
});
|
|
2064
|
-
let
|
|
2109
|
+
let p = e.createShaderModule({
|
|
2065
2110
|
label: "[Aurora] aurora.wgsl",
|
|
2066
|
-
code:
|
|
2067
|
-
}),
|
|
2111
|
+
code: St
|
|
2112
|
+
}), m = e.createBuffer({
|
|
2068
2113
|
label: "[Aurora] uniforms",
|
|
2069
|
-
size:
|
|
2070
|
-
usage:
|
|
2071
|
-
}),
|
|
2114
|
+
size: 672,
|
|
2115
|
+
usage: 72
|
|
2116
|
+
}), h = e.createBindGroupLayout({
|
|
2072
2117
|
label: "[Aurora] bind-group-0",
|
|
2073
2118
|
entries: [{
|
|
2074
2119
|
binding: 0,
|
|
2075
|
-
visibility:
|
|
2120
|
+
visibility: J,
|
|
2076
2121
|
buffer: { type: "uniform" }
|
|
2077
2122
|
}]
|
|
2078
|
-
}),
|
|
2123
|
+
}), g = e.createRenderPipeline({
|
|
2079
2124
|
label: "[Aurora] pipeline",
|
|
2080
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
2125
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [h] }),
|
|
2081
2126
|
vertex: {
|
|
2082
|
-
module:
|
|
2127
|
+
module: p,
|
|
2083
2128
|
entryPoint: "vs_main"
|
|
2084
2129
|
},
|
|
2085
2130
|
fragment: {
|
|
2086
|
-
module:
|
|
2131
|
+
module: p,
|
|
2087
2132
|
entryPoint: "fs_main",
|
|
2088
2133
|
targets: [{
|
|
2089
|
-
format:
|
|
2090
|
-
blend:
|
|
2091
|
-
color: {
|
|
2092
|
-
srcFactor: "one",
|
|
2093
|
-
dstFactor: "one-minus-src-alpha",
|
|
2094
|
-
operation: "add"
|
|
2095
|
-
},
|
|
2096
|
-
alpha: {
|
|
2097
|
-
srcFactor: "one",
|
|
2098
|
-
dstFactor: "one-minus-src-alpha",
|
|
2099
|
-
operation: "add"
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2134
|
+
format: f,
|
|
2135
|
+
blend: n ? void 0 : Nt
|
|
2102
2136
|
}]
|
|
2103
2137
|
},
|
|
2104
2138
|
primitive: { topology: "triangle-list" }
|
|
2105
|
-
}),
|
|
2139
|
+
}), _ = e.createBindGroup({
|
|
2106
2140
|
label: "[Aurora] bind-group",
|
|
2107
|
-
layout:
|
|
2141
|
+
layout: h,
|
|
2108
2142
|
entries: [{
|
|
2109
2143
|
binding: 0,
|
|
2110
|
-
resource: { buffer:
|
|
2144
|
+
resource: { buffer: m }
|
|
2111
2145
|
}]
|
|
2112
|
-
}),
|
|
2113
|
-
function
|
|
2114
|
-
function
|
|
2115
|
-
let
|
|
2116
|
-
|
|
2117
|
-
let
|
|
2118
|
-
|
|
2119
|
-
let
|
|
2120
|
-
view:
|
|
2146
|
+
}), v = Ot();
|
|
2147
|
+
function y(e) {}
|
|
2148
|
+
function b(t) {
|
|
2149
|
+
let c = +!a(), l = u === null ? 0 : Math.max(0, (t - u) * 1e3);
|
|
2150
|
+
u = t, s.tick(c === 0 ? 0 : l);
|
|
2151
|
+
let f = z(s, r(), c), p = i();
|
|
2152
|
+
kt(v, p, f, o(t), n ? 1 : p.alpha), e.queue.writeBuffer(m, 0, v.buffer);
|
|
2153
|
+
let h = d.getCurrentTexture().createView(), y = e.createCommandEncoder({ label: "[Aurora] frame" }), b = y.beginRenderPass({ colorAttachments: [{
|
|
2154
|
+
view: h,
|
|
2121
2155
|
clearValue: {
|
|
2122
2156
|
r: 0,
|
|
2123
2157
|
g: 0,
|
|
2124
2158
|
b: 0,
|
|
2125
|
-
a:
|
|
2159
|
+
a: +!!n
|
|
2126
2160
|
},
|
|
2127
2161
|
loadOp: "clear",
|
|
2128
2162
|
storeOp: "store"
|
|
2129
2163
|
}] });
|
|
2130
|
-
|
|
2164
|
+
b.setPipeline(g), b.setBindGroup(0, _), b.draw(3, 1, 0, 0), b.end(), e.queue.submit([y.finish()]);
|
|
2131
2165
|
}
|
|
2132
|
-
function
|
|
2133
|
-
if (
|
|
2134
|
-
let e =
|
|
2135
|
-
return e.nucleiDrift !== 0 || e.paletteDrift !== 0 || e.breathDepth !== 0 || e.warpDrift !== 0
|
|
2166
|
+
function x() {
|
|
2167
|
+
if (a()) return !1;
|
|
2168
|
+
let e = i();
|
|
2169
|
+
return e.nucleiDrift !== 0 || e.paletteDrift !== 0 || e.breathDepth !== 0 || e.warpDrift !== 0 || B(s);
|
|
2136
2170
|
}
|
|
2137
2171
|
return {
|
|
2138
|
-
frame:
|
|
2139
|
-
shouldContinue:
|
|
2140
|
-
resize:
|
|
2141
|
-
time: (e) => i() ? 3.7 : e,
|
|
2172
|
+
frame: b,
|
|
2173
|
+
shouldContinue: x,
|
|
2174
|
+
resize: y,
|
|
2142
2175
|
teardown: () => {
|
|
2143
|
-
|
|
2176
|
+
m.destroy();
|
|
2144
2177
|
}
|
|
2145
2178
|
};
|
|
2146
2179
|
};
|
|
2147
2180
|
}
|
|
2148
|
-
function
|
|
2149
|
-
let { canvas: i,
|
|
2181
|
+
function Ft(e, t, n, r) {
|
|
2182
|
+
let { canvas: i, opaquePresentation: a, getCursorScalars: o, getConfig: s, getReducedMotion: c, getRenderTime: l, pointerField: u, getDecodedImage: d, registerImageUploader: f } = r, p = null, m = e.createShaderModule({
|
|
2150
2183
|
label: "[Aurora] aurora-image.wgsl",
|
|
2151
|
-
code:
|
|
2152
|
-
}),
|
|
2184
|
+
code: Ct
|
|
2185
|
+
}), h = e.createBuffer({
|
|
2153
2186
|
label: "[Aurora] image uniforms",
|
|
2154
|
-
size:
|
|
2155
|
-
usage:
|
|
2156
|
-
}),
|
|
2187
|
+
size: 352,
|
|
2188
|
+
usage: 72
|
|
2189
|
+
}), g = e.createSampler({
|
|
2157
2190
|
label: "[Aurora] image sampler",
|
|
2158
2191
|
magFilter: "linear",
|
|
2159
2192
|
minFilter: "linear",
|
|
2160
2193
|
addressModeU: "clamp-to-edge",
|
|
2161
2194
|
addressModeV: "clamp-to-edge"
|
|
2162
|
-
}),
|
|
2195
|
+
}), _ = e.createBindGroupLayout({
|
|
2163
2196
|
label: "[Aurora] image bind-group-0",
|
|
2164
2197
|
entries: [
|
|
2165
2198
|
{
|
|
2166
2199
|
binding: 0,
|
|
2167
|
-
visibility:
|
|
2200
|
+
visibility: J,
|
|
2168
2201
|
buffer: { type: "uniform" }
|
|
2169
2202
|
},
|
|
2170
2203
|
{
|
|
2171
2204
|
binding: 1,
|
|
2172
|
-
visibility:
|
|
2205
|
+
visibility: J,
|
|
2173
2206
|
texture: {
|
|
2174
2207
|
sampleType: "float",
|
|
2175
2208
|
viewDimension: "2d"
|
|
@@ -2177,222 +2210,231 @@ function Lt(e, t, n, r) {
|
|
|
2177
2210
|
},
|
|
2178
2211
|
{
|
|
2179
2212
|
binding: 2,
|
|
2180
|
-
visibility:
|
|
2213
|
+
visibility: J,
|
|
2181
2214
|
sampler: { type: "filtering" }
|
|
2182
2215
|
}
|
|
2183
2216
|
]
|
|
2184
|
-
}),
|
|
2217
|
+
}), v = e.createRenderPipeline({
|
|
2185
2218
|
label: "[Aurora] image pipeline",
|
|
2186
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
2219
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [_] }),
|
|
2187
2220
|
vertex: {
|
|
2188
|
-
module:
|
|
2221
|
+
module: m,
|
|
2189
2222
|
entryPoint: "vs_main"
|
|
2190
2223
|
},
|
|
2191
2224
|
fragment: {
|
|
2192
|
-
module:
|
|
2225
|
+
module: m,
|
|
2193
2226
|
entryPoint: "fs_main",
|
|
2194
2227
|
targets: [{
|
|
2195
2228
|
format: n,
|
|
2196
|
-
blend:
|
|
2197
|
-
color: {
|
|
2198
|
-
srcFactor: "one",
|
|
2199
|
-
dstFactor: "one-minus-src-alpha",
|
|
2200
|
-
operation: "add"
|
|
2201
|
-
},
|
|
2202
|
-
alpha: {
|
|
2203
|
-
srcFactor: "one",
|
|
2204
|
-
dstFactor: "one-minus-src-alpha",
|
|
2205
|
-
operation: "add"
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2229
|
+
blend: a ? void 0 : Nt
|
|
2208
2230
|
}]
|
|
2209
2231
|
},
|
|
2210
2232
|
primitive: { topology: "triangle-list" }
|
|
2211
|
-
}),
|
|
2212
|
-
function
|
|
2233
|
+
}), y = P(e, d() ?? N()).texture;
|
|
2234
|
+
function b() {
|
|
2213
2235
|
return e.createBindGroup({
|
|
2214
2236
|
label: "[Aurora] image bind-group",
|
|
2215
|
-
layout:
|
|
2237
|
+
layout: _,
|
|
2216
2238
|
entries: [
|
|
2217
2239
|
{
|
|
2218
2240
|
binding: 0,
|
|
2219
|
-
resource: { buffer:
|
|
2241
|
+
resource: { buffer: h }
|
|
2220
2242
|
},
|
|
2221
2243
|
{
|
|
2222
2244
|
binding: 1,
|
|
2223
|
-
resource:
|
|
2245
|
+
resource: y.createView()
|
|
2224
2246
|
},
|
|
2225
2247
|
{
|
|
2226
2248
|
binding: 2,
|
|
2227
|
-
resource:
|
|
2249
|
+
resource: g
|
|
2228
2250
|
}
|
|
2229
2251
|
]
|
|
2230
2252
|
});
|
|
2231
2253
|
}
|
|
2232
|
-
let
|
|
2233
|
-
|
|
2234
|
-
|
|
2254
|
+
let x = b();
|
|
2255
|
+
f((t) => {
|
|
2256
|
+
y.destroy(), y = P(e, t).texture, x = b();
|
|
2235
2257
|
});
|
|
2236
|
-
let
|
|
2237
|
-
function
|
|
2238
|
-
function
|
|
2239
|
-
let r = +!
|
|
2240
|
-
|
|
2241
|
-
let
|
|
2242
|
-
|
|
2243
|
-
let
|
|
2244
|
-
view:
|
|
2258
|
+
let S = jt();
|
|
2259
|
+
function C(e) {}
|
|
2260
|
+
function w(n) {
|
|
2261
|
+
let r = +!c(), d = p === null ? 0 : Math.max(0, (n - p) * 1e3);
|
|
2262
|
+
p = n, u.tick(r === 0 ? 0 : d);
|
|
2263
|
+
let f = z(u, o(), r), m = i.height > 0 ? i.width / i.height : 1, g = s();
|
|
2264
|
+
Mt(S, g, f, l(n), m, a ? 1 : g.alpha), e.queue.writeBuffer(h, 0, S.buffer);
|
|
2265
|
+
let _ = t.getCurrentTexture().createView(), y = e.createCommandEncoder({ label: "[Aurora] image frame" }), b = y.beginRenderPass({ colorAttachments: [{
|
|
2266
|
+
view: _,
|
|
2245
2267
|
clearValue: {
|
|
2246
2268
|
r: 0,
|
|
2247
2269
|
g: 0,
|
|
2248
2270
|
b: 0,
|
|
2249
|
-
a:
|
|
2271
|
+
a: +!!a
|
|
2250
2272
|
},
|
|
2251
2273
|
loadOp: "clear",
|
|
2252
2274
|
storeOp: "store"
|
|
2253
2275
|
}] });
|
|
2254
|
-
|
|
2276
|
+
b.setPipeline(v), b.setBindGroup(0, x), b.draw(3, 1, 0, 0), b.end(), e.queue.submit([y.finish()]);
|
|
2255
2277
|
}
|
|
2256
|
-
function
|
|
2257
|
-
if (
|
|
2258
|
-
let e =
|
|
2259
|
-
return e.nucleiDrift !== 0 || e.warpDrift !== 0 || e.paletteDrift !== 0
|
|
2278
|
+
function ee() {
|
|
2279
|
+
if (c()) return !1;
|
|
2280
|
+
let e = s();
|
|
2281
|
+
return e.nucleiDrift !== 0 || e.warpDrift !== 0 || e.paletteDrift !== 0 || B(u);
|
|
2260
2282
|
}
|
|
2261
2283
|
return {
|
|
2262
|
-
frame:
|
|
2263
|
-
shouldContinue:
|
|
2264
|
-
resize:
|
|
2265
|
-
time: (e) => s() ? 3.7 : e,
|
|
2284
|
+
frame: w,
|
|
2285
|
+
shouldContinue: ee,
|
|
2286
|
+
resize: C,
|
|
2266
2287
|
teardown: () => {
|
|
2267
|
-
|
|
2288
|
+
f(null), y.destroy(), h.destroy();
|
|
2268
2289
|
}
|
|
2269
2290
|
};
|
|
2270
2291
|
}
|
|
2271
2292
|
//#endregion
|
|
2272
2293
|
//#region src/components/aurora/composables/runtime.ts
|
|
2273
|
-
function
|
|
2274
|
-
return e.mode === "capture"
|
|
2294
|
+
function It(e) {
|
|
2295
|
+
return e.mode === "capture" || e.initStrategy === "eager";
|
|
2275
2296
|
}
|
|
2276
|
-
function
|
|
2297
|
+
function Lt(e) {
|
|
2277
2298
|
return typeof e.preserveDrawingBuffer == "boolean" ? e.preserveDrawingBuffer : e.mode === "capture";
|
|
2278
2299
|
}
|
|
2279
|
-
function
|
|
2280
|
-
let
|
|
2300
|
+
function Rt(e = "live") {
|
|
2301
|
+
let t = e !== "capture";
|
|
2302
|
+
return {
|
|
2303
|
+
opaque: t,
|
|
2304
|
+
alphaMode: t ? "opaque" : "premultiplied",
|
|
2305
|
+
contextAlpha: !t
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
var zt = (e) => Math.min(1, Math.max(0, e));
|
|
2309
|
+
function Y(e) {
|
|
2310
|
+
return e.interactivity?.swirl === !0 || e.medium !== "smooth" && e.interactivity?.light === !0;
|
|
2311
|
+
}
|
|
2312
|
+
var Bt = 3.7;
|
|
2313
|
+
function Vt(e, t, n, r) {
|
|
2314
|
+
return r ? Bt : e.interactivity?.scroll === !0 ? t + Math.min(1, Math.max(0, n)) * e.breathPeriod : t;
|
|
2315
|
+
}
|
|
2316
|
+
function Ht(e, n, r = {}) {
|
|
2317
|
+
let i = Lt(r), a = Rt(r.mode), o = e.style.opacity, s = (t) => {
|
|
2318
|
+
a.opaque && (e.style.opacity = String(zt(t)));
|
|
2319
|
+
};
|
|
2320
|
+
s(n.alpha);
|
|
2321
|
+
let c = !r.forceWebGLUnderSoftwareRaster && F(), l = n, u = 0, d = t({
|
|
2281
2322
|
mass: 1,
|
|
2282
2323
|
damping: .9,
|
|
2283
2324
|
attractorResponse: .28,
|
|
2284
2325
|
leadGain: .08,
|
|
2285
2326
|
halfLifeMs: 110
|
|
2286
|
-
}),
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2327
|
+
}), f = .8, p = .25, m = () => {
|
|
2328
|
+
let e = l.interactivity, t = Y(l);
|
|
2329
|
+
return {
|
|
2330
|
+
strength: t ? f : 0,
|
|
2331
|
+
radius: p,
|
|
2332
|
+
amplitude: t ? Math.min(1, Math.max(0, e?.amplitude ?? .5)) : 0
|
|
2333
|
+
};
|
|
2334
|
+
}, h = null, g = xe({
|
|
2335
|
+
wake: () => b.wake(),
|
|
2291
2336
|
onError: r.onInitError
|
|
2292
|
-
}),
|
|
2293
|
-
|
|
2337
|
+
}), _ = c ? /* @__PURE__ */ Error("[Aurora] GPU animation is unavailable under software rasterization") : null, v = !1;
|
|
2338
|
+
function y() {
|
|
2339
|
+
!_ || v || (v = !0, r.onInitError?.(_));
|
|
2340
|
+
}
|
|
2341
|
+
let b = c ? {
|
|
2342
|
+
backend: "webgl2",
|
|
2343
|
+
arm: y,
|
|
2344
|
+
armAsync: () => (y(), Promise.reject(_)),
|
|
2345
|
+
presize: () => {},
|
|
2294
2346
|
suspend: () => {},
|
|
2295
2347
|
resume: () => {},
|
|
2296
2348
|
wake: () => {},
|
|
2297
2349
|
renderAt: () => {},
|
|
2298
2350
|
dispose: () => {},
|
|
2299
2351
|
reducedMotion: !1
|
|
2300
|
-
} :
|
|
2352
|
+
} : ee(e, {
|
|
2301
2353
|
mode: r.mode === "capture" ? "capture" : "live",
|
|
2302
|
-
|
|
2354
|
+
alphaMode: a.alphaMode,
|
|
2355
|
+
dprPolicy: x,
|
|
2303
2356
|
revealBloom: r.revealBloom ?? !1,
|
|
2304
2357
|
contextAttrs: {
|
|
2305
2358
|
antialias: !1,
|
|
2306
|
-
alpha:
|
|
2307
|
-
premultipliedAlpha:
|
|
2359
|
+
alpha: a.contextAlpha,
|
|
2360
|
+
premultipliedAlpha: a.contextAlpha,
|
|
2308
2361
|
preserveDrawingBuffer: i
|
|
2309
2362
|
},
|
|
2310
|
-
setupWGPU:
|
|
2363
|
+
setupWGPU: Pt({
|
|
2311
2364
|
canvas: e,
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2365
|
+
opaquePresentation: a.opaque,
|
|
2366
|
+
getCursorScalars: m,
|
|
2367
|
+
getConfig: () => l,
|
|
2368
|
+
getReducedMotion: () => b.reducedMotion,
|
|
2369
|
+
getRenderTime: (e) => Vt(l, e, u, b.reducedMotion),
|
|
2370
|
+
pointerField: d,
|
|
2371
|
+
getDecodedImage: () => g.getDecodedImage(),
|
|
2372
|
+
registerImageUploader: (e) => g.setImageUploader(e)
|
|
2318
2373
|
}),
|
|
2319
|
-
setupGL: (
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2374
|
+
setupGL: xt({
|
|
2375
|
+
opaquePresentation: a.opaque,
|
|
2376
|
+
getConfig: () => l,
|
|
2377
|
+
getReducedMotion: () => b.reducedMotion,
|
|
2378
|
+
getRenderTime: (e) => Vt(l, e, u, b.reducedMotion),
|
|
2379
|
+
getCursorScalars: m,
|
|
2380
|
+
pointerField: d,
|
|
2381
|
+
imageCoordinator: g,
|
|
2382
|
+
registerConfigUploader: (e) => {
|
|
2383
|
+
h = e;
|
|
2323
2384
|
}
|
|
2324
|
-
|
|
2325
|
-
gl: t,
|
|
2326
|
-
prog: r,
|
|
2327
|
-
uniforms: c,
|
|
2328
|
-
pointerField: s,
|
|
2329
|
-
getCursorScalars: u,
|
|
2330
|
-
getConfig: () => o,
|
|
2331
|
-
getReducedMotion: () => h.reducedMotion
|
|
2332
|
-
});
|
|
2333
|
-
return t.clearColor(0, 0, 0, 0), t.disable(t.DEPTH_TEST), t.enable(t.BLEND), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA), d = (e) => {
|
|
2334
|
-
o = e, g(e);
|
|
2335
|
-
}, d(o), {
|
|
2336
|
-
frame: _.frame,
|
|
2337
|
-
shouldContinue: _.needsAnimation,
|
|
2338
|
-
resize: p,
|
|
2339
|
-
time: (e) => h.reducedMotion ? 3.7 : e,
|
|
2340
|
-
teardown: () => {
|
|
2341
|
-
t.deleteProgram(r), t.deleteShader(i), t.deleteShader(a), t.deleteBuffer(l.buf), t.deleteVertexArray(l.vao), f?.();
|
|
2342
|
-
}
|
|
2343
|
-
};
|
|
2344
|
-
},
|
|
2385
|
+
}),
|
|
2345
2386
|
onInitError: r.onInitError ? (e) => r.onInitError?.(e instanceof Error ? e : Error(String(e))) : void 0,
|
|
2346
2387
|
onStatus: r.onRendererStatus
|
|
2347
2388
|
});
|
|
2348
|
-
|
|
2349
|
-
function
|
|
2350
|
-
|
|
2389
|
+
_ && r.onRendererStatus?.(te("webgl2", "Software renderer", _));
|
|
2390
|
+
function S(e, t, n = .8) {
|
|
2391
|
+
Y(l) && (f = n, d.setActive(!0), d.setPointer(e, t), b.wake());
|
|
2351
2392
|
}
|
|
2352
|
-
function
|
|
2353
|
-
|
|
2393
|
+
function C() {
|
|
2394
|
+
d.setActive(!1), b.wake();
|
|
2354
2395
|
}
|
|
2355
|
-
function
|
|
2356
|
-
|
|
2396
|
+
function w(e) {
|
|
2397
|
+
p = e, b.wake();
|
|
2357
2398
|
}
|
|
2358
|
-
function
|
|
2359
|
-
|
|
2399
|
+
function T(e) {
|
|
2400
|
+
let t = Math.min(1, Math.max(0, e));
|
|
2401
|
+
t !== u && (u = t, l.interactivity?.scroll === !0 && !b.reducedMotion && b.wake());
|
|
2360
2402
|
}
|
|
2361
|
-
function
|
|
2362
|
-
|
|
2363
|
-
r.onInitError?.(e instanceof Error ? e : Error(String(e)));
|
|
2364
|
-
}) : h.arm();
|
|
2403
|
+
function E() {
|
|
2404
|
+
b.armAsync().catch(() => void 0);
|
|
2365
2405
|
}
|
|
2366
|
-
function
|
|
2367
|
-
return
|
|
2406
|
+
function ne() {
|
|
2407
|
+
return b.armAsync();
|
|
2368
2408
|
}
|
|
2369
|
-
return
|
|
2370
|
-
arm: () =>
|
|
2371
|
-
armAsync: () =>
|
|
2409
|
+
return g.ensureDecoded(l), r.mode !== "capture" && It(r) && E(), {
|
|
2410
|
+
arm: () => E(),
|
|
2411
|
+
armAsync: () => ne(),
|
|
2372
2412
|
update: (e) => {
|
|
2373
|
-
|
|
2413
|
+
l = e, s(e.alpha), Y(e) || d.setActive(!1), h?.(e), g.ensureDecoded(e), b.wake();
|
|
2374
2414
|
},
|
|
2375
|
-
setCursor:
|
|
2376
|
-
clearCursor:
|
|
2377
|
-
setCursorRadius:
|
|
2378
|
-
|
|
2415
|
+
setCursor: S,
|
|
2416
|
+
clearCursor: C,
|
|
2417
|
+
setCursorRadius: w,
|
|
2418
|
+
setScrollProgress: T,
|
|
2379
2419
|
get reducedMotion() {
|
|
2380
|
-
return
|
|
2420
|
+
return b.reducedMotion;
|
|
2381
2421
|
},
|
|
2382
|
-
pause: (e = "manual") =>
|
|
2383
|
-
resume: (e = "manual") =>
|
|
2384
|
-
renderAt: (e) =>
|
|
2385
|
-
dispose: () =>
|
|
2422
|
+
pause: (e = "manual") => b.suspend(e),
|
|
2423
|
+
resume: (e = "manual") => b.resume(e),
|
|
2424
|
+
renderAt: (e) => b.renderAt(e),
|
|
2425
|
+
dispose: () => {
|
|
2426
|
+
b.dispose(), a.opaque && (e.style.opacity = o);
|
|
2427
|
+
}
|
|
2386
2428
|
};
|
|
2387
2429
|
}
|
|
2388
2430
|
//#endregion
|
|
2389
2431
|
//#region src/components/aurora/composables/configSource.ts
|
|
2390
|
-
function
|
|
2432
|
+
function Ut(e) {
|
|
2391
2433
|
return typeof e == "function" ? e : e && typeof e == "object" && "value" in e ? () => e.value : () => e;
|
|
2392
2434
|
}
|
|
2393
2435
|
//#endregion
|
|
2394
2436
|
//#region src/components/aurora/composables/useAurora.ts
|
|
2395
|
-
function
|
|
2437
|
+
function Wt(e) {
|
|
2396
2438
|
if (typeof window > "u") return () => {};
|
|
2397
2439
|
if (typeof window.requestIdleCallback == "function") {
|
|
2398
2440
|
let t = window.requestIdleCallback(() => e(), { timeout: 2e3 });
|
|
@@ -2409,63 +2451,62 @@ function Ht(e) {
|
|
|
2409
2451
|
r = !0, cancelAnimationFrame(t), n !== void 0 && clearTimeout(n);
|
|
2410
2452
|
};
|
|
2411
2453
|
}
|
|
2412
|
-
function
|
|
2413
|
-
let o =
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2454
|
+
function Gt(e, t, n = {}, r = {}) {
|
|
2455
|
+
let o = Ut(t), s = r.renderMode === "css", c = null, l = null, u = null, d = null, f = null, p = null, m = !1, h = me(!1), g = he(s ? E() : T("webgl2")), _ = i({
|
|
2456
|
+
target: e,
|
|
2457
|
+
trackExit: !0,
|
|
2458
|
+
reactive: !0,
|
|
2459
|
+
enabled: O(() => !s && o().interactivity?.scroll === !0)
|
|
2460
|
+
});
|
|
2461
|
+
d = j(_, (e) => c?.setScrollProgress(e), { flush: "sync" });
|
|
2462
|
+
let v = n.mode === "capture" || n.initStrategy === "eager";
|
|
2463
|
+
function y(e) {
|
|
2418
2464
|
let t = e instanceof Error ? e : Error(String(e));
|
|
2419
|
-
|
|
2465
|
+
g.value = te(g.value.engine, g.value.adapter, t), n.onInitError?.(t);
|
|
2420
2466
|
}
|
|
2421
|
-
function
|
|
2422
|
-
if (
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
g.value = !0, c.update(o()), typeof window.matchMedia == "function" && (m = window.matchMedia("(prefers-reduced-motion: reduce)"), m.addEventListener("change", y)), l = k(o, (e) => c?.update(e), { deep: !0 }), o().interactivity?.scroll && e.value && (d = k(i({
|
|
2431
|
-
target: e,
|
|
2432
|
-
trackExit: !0
|
|
2433
|
-
}), (e) => {
|
|
2434
|
-
!c || c.reducedMotion || c.setCursorRadius(.2 + e * .25);
|
|
2435
|
-
}));
|
|
2467
|
+
async function b() {
|
|
2468
|
+
if (m || !c) return;
|
|
2469
|
+
m = !0;
|
|
2470
|
+
let e = c;
|
|
2471
|
+
try {
|
|
2472
|
+
await e.armAsync();
|
|
2473
|
+
} catch (e) {
|
|
2474
|
+
g.value.phase !== "error" && y(e);
|
|
2475
|
+
return;
|
|
2436
2476
|
}
|
|
2477
|
+
c !== e || g.value.engine === "css" || (h.value = !0, e.update(o()), e.setScrollProgress(_.value), l = j(o, (t) => e.update(t), { deep: !0 }));
|
|
2437
2478
|
}
|
|
2438
|
-
return
|
|
2479
|
+
return de(() => {
|
|
2439
2480
|
let t = e.value;
|
|
2440
2481
|
if (!t || s) return;
|
|
2441
2482
|
try {
|
|
2442
|
-
c =
|
|
2483
|
+
c = Ht(t, o(), {
|
|
2443
2484
|
initStrategy: "deferred",
|
|
2444
2485
|
...n,
|
|
2445
2486
|
onRendererStatus: (e) => {
|
|
2446
|
-
|
|
2487
|
+
g.value = e, h.value = e.phase === "ready", n.onRendererStatus?.(e);
|
|
2447
2488
|
}
|
|
2448
2489
|
});
|
|
2449
2490
|
} catch (e) {
|
|
2450
|
-
|
|
2491
|
+
y(e);
|
|
2451
2492
|
return;
|
|
2452
2493
|
}
|
|
2453
2494
|
if (v) {
|
|
2454
|
-
|
|
2495
|
+
b();
|
|
2455
2496
|
return;
|
|
2456
2497
|
}
|
|
2457
2498
|
p = a(e, {
|
|
2458
|
-
pause: () => c?.pause("off-screen"),
|
|
2459
|
-
resume: () => c?.resume("off-screen")
|
|
2499
|
+
pause: () => c?.pause("off-screen-io"),
|
|
2500
|
+
resume: () => c?.resume("off-screen-io")
|
|
2460
2501
|
}, { pauseWhenHidden: !1 });
|
|
2461
2502
|
let r = p.isIntersecting;
|
|
2462
|
-
u =
|
|
2463
|
-
!e ||
|
|
2464
|
-
f = null, r.value &&
|
|
2503
|
+
u = j(r, (e) => {
|
|
2504
|
+
!e || m || f || (f = Wt(() => {
|
|
2505
|
+
f = null, r.value && b();
|
|
2465
2506
|
}));
|
|
2466
2507
|
}, { immediate: !0 });
|
|
2467
|
-
}),
|
|
2468
|
-
f?.(), u?.(), l?.(), d?.(), p?.dispose(),
|
|
2508
|
+
}), ue(() => {
|
|
2509
|
+
f?.(), u?.(), l?.(), d?.(), p?.dispose(), c?.dispose(), c = null;
|
|
2469
2510
|
}), {
|
|
2470
2511
|
setCursor: (e, t, n) => c?.setCursor(e, t, n),
|
|
2471
2512
|
clearCursor: () => c?.clearCursor(),
|
|
@@ -2473,8 +2514,8 @@ function Ut(e, t, n = {}, r = {}) {
|
|
|
2473
2514
|
renderAt: (e) => c?.renderAt(e),
|
|
2474
2515
|
pause: () => c?.pause(),
|
|
2475
2516
|
resume: () => c?.resume(),
|
|
2476
|
-
isArmed:
|
|
2477
|
-
rendererStatus:
|
|
2517
|
+
isArmed: pe(h),
|
|
2518
|
+
rendererStatus: pe(g)
|
|
2478
2519
|
};
|
|
2479
2520
|
}
|
|
2480
2521
|
//#endregion
|
|
@@ -2483,7 +2524,7 @@ function X(e) {
|
|
|
2483
2524
|
let t = Math.max(0, Math.min(1, e));
|
|
2484
2525
|
return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
|
|
2485
2526
|
}
|
|
2486
|
-
function
|
|
2527
|
+
function Kt([e, t, n]) {
|
|
2487
2528
|
let r = .76, i = Math.min(e, Math.min(t, n)), a = i < .08 ? i - 6.25 * i * i : .04, o = e - a, s = t - a, c = n - a, l = Math.max(o, Math.max(s, c)), u = (e) => Math.max(0, Math.min(1, e));
|
|
2488
2529
|
if (l < r) return [
|
|
2489
2530
|
u(o),
|
|
@@ -2499,10 +2540,10 @@ function Wt([e, t, n]) {
|
|
|
2499
2540
|
u(c + (f - c) * m)
|
|
2500
2541
|
];
|
|
2501
2542
|
}
|
|
2502
|
-
function
|
|
2543
|
+
function qt([e, t, n]) {
|
|
2503
2544
|
return .2126 * e + .7152 * t + .0722 * n;
|
|
2504
2545
|
}
|
|
2505
|
-
function
|
|
2546
|
+
function Jt(e, t) {
|
|
2506
2547
|
let n = e.length;
|
|
2507
2548
|
if (n === 0) return [
|
|
2508
2549
|
0,
|
|
@@ -2517,7 +2558,7 @@ function Kt(e, t) {
|
|
|
2517
2558
|
s[2] + (c[2] - s[2]) * o
|
|
2518
2559
|
];
|
|
2519
2560
|
}
|
|
2520
|
-
function
|
|
2561
|
+
function Z(e, t, n, r) {
|
|
2521
2562
|
let i = 0, a = 0, o = 0;
|
|
2522
2563
|
for (let s of e) {
|
|
2523
2564
|
let e = n - s.x, c = r - s.y, l = (s.angle ?? 0) * Math.PI / 180, u = Math.cos(l), d = Math.sin(l), f = u * e + d * c, p = -d * e + u * c, m = f / Math.max(s.elongation ?? 1, .01), h = p, g = m * m + h * h, _ = Math.max(s.radius, .01), v = Math.exp(-t * g / (_ * _));
|
|
@@ -2529,13 +2570,13 @@ function qt(e, t, n, r) {
|
|
|
2529
2570
|
valueMod: a / s
|
|
2530
2571
|
};
|
|
2531
2572
|
}
|
|
2532
|
-
function
|
|
2533
|
-
let r = e.palette.map((e) =>
|
|
2573
|
+
function Yt(e, t, n) {
|
|
2574
|
+
let r = e.palette.map((e) => d(e)), { paletteId: i, valueMod: a } = Z(e.nuclei, e.softmaxBeta, t, n), o = Jt(r, i), s = 1 + e.valueVariance * a, c = [
|
|
2534
2575
|
o[0] * s,
|
|
2535
2576
|
o[1] * s,
|
|
2536
2577
|
o[2] * s
|
|
2537
2578
|
];
|
|
2538
|
-
return c =
|
|
2579
|
+
return c = Kt(c), c = [
|
|
2539
2580
|
Math.max(0, Math.min(1, c[0] * .985 + .008)),
|
|
2540
2581
|
Math.max(0, Math.min(1, c[1] * .985 + .008)),
|
|
2541
2582
|
Math.max(0, Math.min(1, c[2] * .985 + .008))
|
|
@@ -2545,17 +2586,17 @@ function Jt(e, t, n) {
|
|
|
2545
2586
|
X(c[2])
|
|
2546
2587
|
];
|
|
2547
2588
|
}
|
|
2548
|
-
function
|
|
2589
|
+
function Xt([e, t, n]) {
|
|
2549
2590
|
let r = (e) => Math.round(Math.max(0, Math.min(1, e)) * 255);
|
|
2550
2591
|
return `rgb(${r(e)}, ${r(t)}, ${r(n)})`;
|
|
2551
2592
|
}
|
|
2552
|
-
function
|
|
2553
|
-
return
|
|
2593
|
+
function Zt(e) {
|
|
2594
|
+
return qt(e.map((e) => {
|
|
2554
2595
|
let t = Math.max(0, Math.min(1, e));
|
|
2555
2596
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
2556
2597
|
}));
|
|
2557
2598
|
}
|
|
2558
|
-
function
|
|
2599
|
+
function Qt(e, t = {}) {
|
|
2559
2600
|
let n = Math.max(2, Math.min(16, Math.round(t.grid ?? 8))), r = [], i = 0, a = [
|
|
2560
2601
|
0,
|
|
2561
2602
|
0,
|
|
@@ -2568,13 +2609,13 @@ function Zt(e, t = {}) {
|
|
|
2568
2609
|
0
|
|
2569
2610
|
];
|
|
2570
2611
|
for (let t = 0; t < n; t++) for (let s = 0; s < n; s++) {
|
|
2571
|
-
let c = (s + .5) / n, l = (t + .5) / n, u =
|
|
2612
|
+
let c = (s + .5) / n, l = (t + .5) / n, u = Yt(e, c, l);
|
|
2572
2613
|
r.push({
|
|
2573
2614
|
x: c,
|
|
2574
2615
|
y: l,
|
|
2575
2616
|
color: u
|
|
2576
2617
|
});
|
|
2577
|
-
let d =
|
|
2618
|
+
let d = Zt(u);
|
|
2578
2619
|
i += d;
|
|
2579
2620
|
let f = (l < .5 ? 0 : 2) + (c < .5 ? 0 : 1);
|
|
2580
2621
|
a[f] += d, o[f] += 1;
|
|
@@ -2591,10 +2632,10 @@ function Zt(e, t = {}) {
|
|
|
2591
2632
|
];
|
|
2592
2633
|
for (let e of r) l[0] += e.color[0], l[1] += e.color[1], l[2] += e.color[2];
|
|
2593
2634
|
l[0] /= r.length, l[1] /= r.length, l[2] /= r.length;
|
|
2594
|
-
let u =
|
|
2635
|
+
let u = $t(r, n);
|
|
2595
2636
|
if (u) return {
|
|
2596
2637
|
backgroundImage: `url("${u}")`,
|
|
2597
|
-
backgroundColor:
|
|
2638
|
+
backgroundColor: Xt(l),
|
|
2598
2639
|
metrics: {
|
|
2599
2640
|
mean: s,
|
|
2600
2641
|
quadrants: c
|
|
@@ -2606,14 +2647,14 @@ function Zt(e, t = {}) {
|
|
|
2606
2647
|
let t = (e.x * 100).toFixed(2), n = (e.y * 100).toFixed(2), r = (e) => Math.round(Math.max(0, Math.min(1, e)) * 255), [i, a, o] = e.color, s = `rgba(${r(i)}, ${r(a)}, ${r(o)}, 0.7)`, c = `rgba(${r(i)}, ${r(a)}, ${r(o)}, 0)`;
|
|
2607
2648
|
return `radial-gradient(circle ${d.toFixed(2)}% at ${t}% ${n}%, ${s} 0%, ${c} 100%)`;
|
|
2608
2649
|
}).join(", "),
|
|
2609
|
-
backgroundColor:
|
|
2650
|
+
backgroundColor: Xt(l),
|
|
2610
2651
|
metrics: {
|
|
2611
2652
|
mean: s,
|
|
2612
2653
|
quadrants: c
|
|
2613
2654
|
}
|
|
2614
2655
|
};
|
|
2615
2656
|
}
|
|
2616
|
-
function
|
|
2657
|
+
function $t(e, t) {
|
|
2617
2658
|
if (typeof document > "u") return null;
|
|
2618
2659
|
let n;
|
|
2619
2660
|
try {
|
|
@@ -2638,10 +2679,10 @@ function Qt(e, t) {
|
|
|
2638
2679
|
}
|
|
2639
2680
|
//#endregion
|
|
2640
2681
|
//#region src/components/aurora/Aurora.vue?vue&type=script&setup=true&lang.ts
|
|
2641
|
-
var
|
|
2682
|
+
var en = ["data-aurora-substrate"], tn = /*#__PURE__*/ e(/* @__PURE__ */ oe({
|
|
2642
2683
|
__name: "Aurora",
|
|
2643
2684
|
props: {
|
|
2644
|
-
config: { default: () =>
|
|
2685
|
+
config: { default: () => V },
|
|
2645
2686
|
runtimeOptions: {},
|
|
2646
2687
|
onInitError: {},
|
|
2647
2688
|
renderMode: { default: "auto" },
|
|
@@ -2649,15 +2690,15 @@ var $t = ["data-aurora-substrate"], en = /* @__PURE__ */ e(/* @__PURE__ */ ce({
|
|
|
2649
2690
|
},
|
|
2650
2691
|
emits: ["rendererStatus"],
|
|
2651
2692
|
setup(e, { expose: t, emit: n }) {
|
|
2652
|
-
let r = n, i = e, a =
|
|
2693
|
+
let r = n, i = e, a = I(i.renderMode, { forceWebGLUnderSoftwareRaster: i.runtimeOptions?.forceWebGLUnderSoftwareRaster ?? !1 }), o = O(() => Math.max(0, Math.min(1, i.opacityCeiling))), s = me(null), c = se(), l = c?.appContext.config.errorHandler, u = l ? (e) => l(e, c?.proxy ?? null, "Aurora initialization") : void 0, d = Gt(s, () => i.config, {
|
|
2653
2694
|
...i.runtimeOptions ?? {},
|
|
2654
2695
|
onInitError: i.onInitError ?? i.runtimeOptions?.onInitError ?? u
|
|
2655
2696
|
}, { renderMode: a });
|
|
2656
|
-
|
|
2697
|
+
j(d.rendererStatus, (e) => r("rendererStatus", e), {
|
|
2657
2698
|
immediate: !0,
|
|
2658
2699
|
flush: "sync"
|
|
2659
2700
|
});
|
|
2660
|
-
let f =
|
|
2701
|
+
let f = O(() => Qt(i.config)), p = O(() => f.value.backgroundImage), m = O(() => f.value.backgroundColor);
|
|
2661
2702
|
return t({
|
|
2662
2703
|
config: i.config,
|
|
2663
2704
|
canvasRef: s,
|
|
@@ -2669,29 +2710,29 @@ var $t = ["data-aurora-substrate"], en = /* @__PURE__ */ e(/* @__PURE__ */ ce({
|
|
|
2669
2710
|
resume: d.resume,
|
|
2670
2711
|
isArmed: d.isArmed,
|
|
2671
2712
|
rendererStatus: d.rendererStatus
|
|
2672
|
-
}), (e, t) => (fe(),
|
|
2713
|
+
}), (e, t) => (fe(), ae("div", {
|
|
2673
2714
|
class: "aurora-root block h-full w-full overflow-hidden",
|
|
2674
|
-
"data-aurora-substrate":
|
|
2675
|
-
style:
|
|
2676
|
-
}, [
|
|
2677
|
-
class: "aurora-placeholder h-full w-full",
|
|
2715
|
+
"data-aurora-substrate": A(a),
|
|
2716
|
+
style: le({ opacity: o.value })
|
|
2717
|
+
}, [k("div", {
|
|
2718
|
+
class: "aurora-placeholder h-full min-h-0 w-full",
|
|
2678
2719
|
"aria-hidden": "true",
|
|
2679
|
-
style:
|
|
2720
|
+
style: le({
|
|
2680
2721
|
backgroundImage: p.value,
|
|
2681
2722
|
backgroundColor: m.value
|
|
2682
2723
|
})
|
|
2683
|
-
}, null, 4),
|
|
2724
|
+
}, null, 4), k("div", { class: ce(["aurora-canvas-layer h-full min-h-0 w-full", { "aurora-canvas-layer--armed": A(d).isArmed.value }]) }, [k("canvas", {
|
|
2684
2725
|
ref_key: "canvasRef",
|
|
2685
2726
|
ref: s,
|
|
2686
2727
|
"aria-hidden": "true",
|
|
2687
|
-
class:
|
|
2688
|
-
}, null, 2)], 12,
|
|
2728
|
+
class: ce(["aurora-canvas block h-full w-full", { "aurora-canvas--armed": A(d).isArmed.value }])
|
|
2729
|
+
}, null, 2)], 2)], 12, en));
|
|
2689
2730
|
}
|
|
2690
|
-
}), [["__scopeId", "data-v-
|
|
2731
|
+
}), [["__scopeId", "data-v-aebed9bd"]]);
|
|
2691
2732
|
//#endregion
|
|
2692
2733
|
//#region src/components/aurora/composables/useCursorInteraction.ts
|
|
2693
|
-
function
|
|
2694
|
-
let r =
|
|
2734
|
+
function nn(e, t, n) {
|
|
2735
|
+
let r = Ut(t), i = n.hitFraction ?? .35, a = null, o = null;
|
|
2695
2736
|
function s(e, t) {
|
|
2696
2737
|
let n = t.getBoundingClientRect();
|
|
2697
2738
|
return {
|
|
@@ -2749,7 +2790,7 @@ function tn(e, t, n) {
|
|
|
2749
2790
|
if (!n) return;
|
|
2750
2791
|
let { x: i, y: c } = s(t, n), u = l(i, c);
|
|
2751
2792
|
if (t.altKey && u === null) {
|
|
2752
|
-
if (r().nuclei.length >=
|
|
2793
|
+
if (r().nuclei.length >= 8) return;
|
|
2753
2794
|
r().nuclei.push(f(i, c)), t.preventDefault();
|
|
2754
2795
|
return;
|
|
2755
2796
|
}
|
|
@@ -2778,20 +2819,20 @@ function tn(e, t, n) {
|
|
|
2778
2819
|
}, a = n.getBoundingClientRect(), o = l((i.clientX - a.left) / Math.max(a.width, 1), (i.clientY - a.top) / Math.max(a.height, 1));
|
|
2779
2820
|
o !== null && r().nuclei.length > 1 && (r().nuclei.splice(o, 1), t.preventDefault());
|
|
2780
2821
|
}
|
|
2781
|
-
return
|
|
2822
|
+
return de(() => {
|
|
2782
2823
|
let t = e.value;
|
|
2783
2824
|
t && (t.addEventListener("pointermove", p), t.addEventListener("pointerleave", m), t.addEventListener("pointerdown", h), t.addEventListener("pointerup", g), t.addEventListener("pointercancel", g), t.addEventListener("contextmenu", _));
|
|
2784
|
-
}),
|
|
2825
|
+
}), ue(() => {
|
|
2785
2826
|
let t = e.value;
|
|
2786
2827
|
t && (t.removeEventListener("pointermove", p), t.removeEventListener("pointerleave", m), t.removeEventListener("pointerdown", h), t.removeEventListener("pointerup", g), t.removeEventListener("pointercancel", g), t.removeEventListener("contextmenu", _));
|
|
2787
2828
|
}), { isDragging: () => a };
|
|
2788
2829
|
}
|
|
2789
2830
|
//#endregion
|
|
2790
2831
|
//#region src/components/aurora/composables/atoms-fields.ts
|
|
2791
|
-
function
|
|
2832
|
+
function Q(e, t, n) {
|
|
2792
2833
|
return e + (t - e) * n;
|
|
2793
2834
|
}
|
|
2794
|
-
var
|
|
2835
|
+
var $ = {
|
|
2795
2836
|
saturation: {
|
|
2796
2837
|
calm: .85,
|
|
2797
2838
|
vivid: 1.2
|
|
@@ -2812,7 +2853,7 @@ var Q = {
|
|
|
2812
2853
|
calm: 16,
|
|
2813
2854
|
vivid: 44
|
|
2814
2855
|
}
|
|
2815
|
-
},
|
|
2856
|
+
}, rn = {
|
|
2816
2857
|
still: {
|
|
2817
2858
|
nucleiDrift: 0,
|
|
2818
2859
|
paletteDrift: 0,
|
|
@@ -2831,9 +2872,69 @@ var Q = {
|
|
|
2831
2872
|
warpDrift: .008,
|
|
2832
2873
|
breathDepth: .05
|
|
2833
2874
|
}
|
|
2834
|
-
};
|
|
2835
|
-
function
|
|
2836
|
-
let
|
|
2875
|
+
}, an = .61803398875;
|
|
2876
|
+
function on(e, t = "composed") {
|
|
2877
|
+
let n = Math.max(1, Math.min(8, Math.round(e))), r = [
|
|
2878
|
+
[.33, .33],
|
|
2879
|
+
[.67, .67],
|
|
2880
|
+
[.67, .33],
|
|
2881
|
+
[.33, .67],
|
|
2882
|
+
[.5, .33],
|
|
2883
|
+
[.5, .67],
|
|
2884
|
+
[.33, .5],
|
|
2885
|
+
[.67, .5]
|
|
2886
|
+
], i = (e) => {
|
|
2887
|
+
if (t === "scattered") {
|
|
2888
|
+
let t = e * an * Math.PI * 2, r = .12 + .3 * Math.sqrt((e + .5) / n);
|
|
2889
|
+
return [g(.5 + r * Math.cos(t), .1, .9), g(.5 + r * Math.sin(t), .1, .9)];
|
|
2890
|
+
}
|
|
2891
|
+
if (t === "centred") {
|
|
2892
|
+
if (n === 1) return [.5, .5];
|
|
2893
|
+
let t = e / n * Math.PI * 2;
|
|
2894
|
+
return [.5 + .12 * Math.cos(t), .5 + .12 * Math.sin(t)];
|
|
2895
|
+
}
|
|
2896
|
+
return r[e % r.length];
|
|
2897
|
+
};
|
|
2898
|
+
return Array.from({ length: n }, (e, t) => {
|
|
2899
|
+
let [r, a] = i(t);
|
|
2900
|
+
return {
|
|
2901
|
+
x: r,
|
|
2902
|
+
y: a,
|
|
2903
|
+
radius: .5,
|
|
2904
|
+
paletteBias: n === 1 ? 0 : t / (n - 1),
|
|
2905
|
+
valueBias: (t % 2 == 0 ? 1 : -1) * .05,
|
|
2906
|
+
driftRadius: .045,
|
|
2907
|
+
driftPhase: t * 2.4 % (Math.PI * 2)
|
|
2908
|
+
};
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
var sn = .03;
|
|
2912
|
+
function cn(e, t, n) {
|
|
2913
|
+
let r = e.length;
|
|
2914
|
+
if (r === 0 || t <= 0) return;
|
|
2915
|
+
let i = e.reduce((e, t) => e + t.C, 0) / r, a = Math.min(.22, i * 1.5), o = (e, t, n) => l({
|
|
2916
|
+
L: e,
|
|
2917
|
+
C: t,
|
|
2918
|
+
h: n
|
|
2919
|
+
}).C;
|
|
2920
|
+
if (e.forEach((e, n) => {
|
|
2921
|
+
let r = n % 2 == 0 ? a : sn;
|
|
2922
|
+
e.C = o(e.L, g(Q(e.C, r, t), 0, .4), e.h);
|
|
2923
|
+
}), !n) return;
|
|
2924
|
+
let s = 0;
|
|
2925
|
+
for (let t = 1; t < r; t++) e[t].L < e[s].L && (s = t);
|
|
2926
|
+
let c = e[s];
|
|
2927
|
+
c.C = o(c.L, sn, c.h);
|
|
2928
|
+
}
|
|
2929
|
+
function ln(e) {
|
|
2930
|
+
return e < .4 ? "fbm" : e < .75 ? "hybrid" : "cellular";
|
|
2931
|
+
}
|
|
2932
|
+
function un(e, t) {
|
|
2933
|
+
let n = g(t, 0, 1);
|
|
2934
|
+
e.warpAmount = g(Q(.2, .6, n), 0, .6), e.warpScale = g(Q(1, 2.6, n), .5, 3), e.warpMode = ln(n), e.noiseOctaves = n < .5 ? 3 : n < .85 ? 4 : 5;
|
|
2935
|
+
}
|
|
2936
|
+
function dn(e, t, n) {
|
|
2937
|
+
let r = g(n, 0, 1);
|
|
2837
2938
|
switch (t) {
|
|
2838
2939
|
case "watercolor":
|
|
2839
2940
|
e.wetEdge = r, e.granulation = r * .8;
|
|
@@ -2856,138 +2957,92 @@ function rn(e, t, n) {
|
|
|
2856
2957
|
break;
|
|
2857
2958
|
}
|
|
2858
2959
|
}
|
|
2859
|
-
function
|
|
2960
|
+
function fn(e, t) {
|
|
2860
2961
|
switch (t) {
|
|
2861
|
-
case "watercolor": return
|
|
2962
|
+
case "watercolor": return g(e.wetEdge, 0, 1);
|
|
2862
2963
|
case "oil":
|
|
2863
2964
|
case "vangogh":
|
|
2864
2965
|
case "pastel":
|
|
2865
2966
|
case "oil-pastel":
|
|
2866
2967
|
case "crayon":
|
|
2867
|
-
case "kuwahara": return
|
|
2968
|
+
case "kuwahara": return g(e.strokeAmount, 0, 1);
|
|
2868
2969
|
case "metal":
|
|
2869
|
-
case "metal-gradient": return
|
|
2970
|
+
case "metal-gradient": return g((e.metalPolish ?? 1) / 4, 0, 1);
|
|
2870
2971
|
}
|
|
2871
2972
|
}
|
|
2872
|
-
function
|
|
2973
|
+
function pn(e) {
|
|
2873
2974
|
return e.nucleiDrift + e.paletteDrift + e.warpDrift > .001 ? "drifting" : e.breathDepth > .001 ? "breathing" : "still";
|
|
2874
2975
|
}
|
|
2875
|
-
function
|
|
2876
|
-
return n === t ? 0 :
|
|
2976
|
+
function mn(e, t, n) {
|
|
2977
|
+
return n === t ? 0 : g((e - t) / (n - t), 0, 1);
|
|
2877
2978
|
}
|
|
2878
2979
|
//#endregion
|
|
2879
2980
|
//#region src/components/aurora/composables/atoms.ts
|
|
2880
|
-
var
|
|
2881
|
-
function
|
|
2882
|
-
let n = Math.max(1, Math.min(6, Math.round(e))), r = [
|
|
2883
|
-
[.33, .33],
|
|
2884
|
-
[.67, .67],
|
|
2885
|
-
[.67, .33],
|
|
2886
|
-
[.33, .67],
|
|
2887
|
-
[.5, .5],
|
|
2888
|
-
[.5, .33]
|
|
2889
|
-
], i = (e) => {
|
|
2890
|
-
switch (t) {
|
|
2891
|
-
case "scattered": {
|
|
2892
|
-
let t = e * ln * Math.PI * 2, r = .12 + .3 * Math.sqrt((e + .5) / n);
|
|
2893
|
-
return [S(.5 + r * Math.cos(t), .1, .9), S(.5 + r * Math.sin(t), .1, .9)];
|
|
2894
|
-
}
|
|
2895
|
-
case "centred": {
|
|
2896
|
-
if (n === 1) return [.5, .5];
|
|
2897
|
-
let t = e / n * Math.PI * 2, r = .12;
|
|
2898
|
-
return [.5 + r * Math.cos(t), .5 + r * Math.sin(t)];
|
|
2899
|
-
}
|
|
2900
|
-
default: return r[e % r.length];
|
|
2901
|
-
}
|
|
2902
|
-
};
|
|
2903
|
-
return Array.from({ length: n }, (e, t) => {
|
|
2904
|
-
let [r, a] = i(t);
|
|
2905
|
-
return {
|
|
2906
|
-
x: r,
|
|
2907
|
-
y: a,
|
|
2908
|
-
radius: .5,
|
|
2909
|
-
paletteBias: n === 1 ? 0 : t / (n - 1),
|
|
2910
|
-
valueBias: (t % 2 == 0 ? 1 : -1) * .05,
|
|
2911
|
-
driftRadius: .045,
|
|
2912
|
-
driftPhase: t * 2.4 % (Math.PI * 2)
|
|
2913
|
-
};
|
|
2914
|
-
});
|
|
2915
|
-
}
|
|
2916
|
-
var $ = .03;
|
|
2917
|
-
function dn(e, t, n) {
|
|
2918
|
-
let r = e.length;
|
|
2919
|
-
if (r === 0 || t <= 0) return;
|
|
2920
|
-
let i = e.reduce((e, t) => e + t.C, 0) / r, a = Math.min(.22, i * 1.5), o = (e, t, n) => c({
|
|
2921
|
-
L: e,
|
|
2922
|
-
C: t,
|
|
2923
|
-
h: n
|
|
2924
|
-
}).C;
|
|
2925
|
-
if (e.forEach((e, n) => {
|
|
2926
|
-
let r = n % 2 == 0 ? a : $, i = S(Z(e.C, r, t), 0, .4);
|
|
2927
|
-
e.C = o(e.L, i, e.h);
|
|
2928
|
-
}), n) {
|
|
2929
|
-
let t = 0;
|
|
2930
|
-
for (let n = 1; n < r; n++) e[n].L < e[t].L && (t = n);
|
|
2931
|
-
let n = e[t];
|
|
2932
|
-
n.C = o(n.L, $, n.h);
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
function fn(e) {
|
|
2936
|
-
return e < .4 ? "fbm" : e < .75 ? "hybrid" : "cellular";
|
|
2937
|
-
}
|
|
2938
|
-
function pn(e, t) {
|
|
2939
|
-
let n = S(t, 0, 1);
|
|
2940
|
-
e.warpAmount = S(Z(.2, .6, n), 0, .6), e.warpScale = S(Z(1, 2.6, n), .5, 3), e.warpMode = fn(n), e.noiseOctaves = n < .5 ? 3 : n < .85 ? 4 : 5;
|
|
2941
|
-
}
|
|
2942
|
-
function mn(e = cn, t = P) {
|
|
2981
|
+
var hn = {};
|
|
2982
|
+
function gn(e = hn, t = V) {
|
|
2943
2983
|
let n = {
|
|
2944
2984
|
...t,
|
|
2945
2985
|
palette: t.palette.map((e) => ({ ...e })),
|
|
2946
2986
|
nuclei: t.nuclei.map((e) => ({ ...e })),
|
|
2947
2987
|
flow: { ...t.flow }
|
|
2948
|
-
}, r = e.colorEnergy === void 0 ? void 0 :
|
|
2988
|
+
}, r = e.colorEnergy === void 0 ? void 0 : g(e.colorEnergy, 0, 1);
|
|
2949
2989
|
if (e.seed !== void 0) {
|
|
2950
|
-
let t = e.hueSpread === void 0 ? r === void 0 ? void 0 :
|
|
2951
|
-
n.palette =
|
|
2990
|
+
let t = e.hueSpread === void 0 ? r === void 0 ? void 0 : Q($.hueSpread.calm, $.hueSpread.vivid, r) : g(e.hueSpread, 0, 180);
|
|
2991
|
+
n.palette = Xe(e.seed, {
|
|
2952
2992
|
harmony: e.harmony ?? "analogous",
|
|
2953
2993
|
stopCount: 4,
|
|
2954
|
-
temperatureShift: r === void 0 ? 0 :
|
|
2994
|
+
temperatureShift: r === void 0 ? 0 : Q($.temperatureShift.calm, $.temperatureShift.vivid, r),
|
|
2955
2995
|
...t === void 0 ? {} : { hueSpread: t },
|
|
2956
2996
|
...e.lightnessScheme === void 0 ? {} : { scheme: e.lightnessScheme },
|
|
2957
2997
|
...e.lBand === void 0 ? {} : { lBand: e.lBand }
|
|
2958
|
-
}), e.chromaVariance !== void 0 && e.chromaVariance > 0 &&
|
|
2998
|
+
}), e.chromaVariance !== void 0 && e.chromaVariance > 0 && cn(n.palette, g(e.chromaVariance, 0, 1), e.chromaCounterpoint ?? !1);
|
|
2959
2999
|
}
|
|
2960
|
-
if (r !== void 0 && (n.saturation =
|
|
2961
|
-
let t =
|
|
2962
|
-
n.nucleiDrift =
|
|
3000
|
+
if (r !== void 0 && (n.saturation = g(Q($.saturation.calm, $.saturation.vivid, r), .6, 1.3), n.valueVariance = g(Q($.valueVariance.calm, $.valueVariance.vivid, r), 0, .3), n.breathDepth = g(Q($.breathDepth.calm, $.breathDepth.vivid, r), 0, .15)), e.zones !== void 0 && (n.nuclei = on(e.zones.count, e.zones.arrangement ?? "composed")), e.noise !== void 0 && un(n, e.noise), e.medium !== void 0 && (n.medium = e.medium.kind, (e.medium.kind === "vangogh" || e.medium.kind === "oil-pastel") && (n.strokeOrient = "tensor"), e.medium.kind !== "smooth" && e.medium.amount !== void 0 && dn(n, e.medium.kind, e.medium.amount)), e.motion !== void 0) {
|
|
3001
|
+
let t = rn[e.motion];
|
|
3002
|
+
n.nucleiDrift = g(t.nucleiDrift, 0, .05), n.paletteDrift = g(t.paletteDrift, 0, .04), n.warpDrift = g(t.warpDrift, 0, .015), n.breathDepth = g(e.motion === "still" ? 0 : Math.max(n.breathDepth, t.breathDepth), 0, .15);
|
|
2963
3003
|
}
|
|
2964
3004
|
if (e.interactivity !== void 0) {
|
|
2965
|
-
let t = e.interactivity;
|
|
3005
|
+
let t = e.interactivity, r = e.medium?.kind !== void 0 && e.medium.kind !== "smooth" ? e.interactivity.light : void 0;
|
|
2966
3006
|
n.interactivity = {
|
|
2967
|
-
...
|
|
3007
|
+
...r === void 0 ? {} : { light: r },
|
|
3008
|
+
...t.scroll === void 0 ? {} : { scroll: t.scroll },
|
|
2968
3009
|
swirl: t.swirl ?? !0,
|
|
2969
|
-
amplitude: t.amplitude === void 0 ? .5 :
|
|
3010
|
+
amplitude: t.amplitude === void 0 ? .5 : g(t.amplitude, 0, 1)
|
|
2970
3011
|
};
|
|
2971
3012
|
}
|
|
2972
3013
|
return n;
|
|
2973
3014
|
}
|
|
2974
|
-
function
|
|
2975
|
-
let t = e.medium, n =
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
seed: e.palette.length > 0 ?
|
|
3015
|
+
function _n(e) {
|
|
3016
|
+
let t = e.medium, n = e.interactivity, r = n && (n.scroll !== void 0 || n.swirl !== void 0 || n.amplitude !== void 0) ? {
|
|
3017
|
+
...n.scroll === void 0 ? {} : { scroll: n.scroll },
|
|
3018
|
+
...n.swirl === void 0 ? {} : { swirl: n.swirl },
|
|
3019
|
+
...n.amplitude === void 0 ? {} : { amplitude: n.amplitude }
|
|
3020
|
+
} : void 0, i = {
|
|
3021
|
+
seed: e.palette.length > 0 ? u(e.palette[0]) : "#3a7bd5",
|
|
2981
3022
|
harmony: "analogous",
|
|
2982
|
-
colorEnergy:
|
|
3023
|
+
colorEnergy: mn(e.saturation, $.saturation.calm, $.saturation.vivid),
|
|
2983
3024
|
zones: {
|
|
2984
|
-
count: Math.max(1, Math.min(
|
|
3025
|
+
count: Math.max(1, Math.min(8, e.nuclei.length)),
|
|
2985
3026
|
arrangement: "composed"
|
|
2986
3027
|
},
|
|
2987
|
-
noise:
|
|
2988
|
-
|
|
2989
|
-
|
|
3028
|
+
noise: mn(e.warpAmount, .2, .6),
|
|
3029
|
+
motion: pn(e)
|
|
3030
|
+
};
|
|
3031
|
+
return t === "smooth" ? {
|
|
3032
|
+
...i,
|
|
3033
|
+
medium: { kind: t },
|
|
3034
|
+
...r ? { interactivity: r } : {}
|
|
3035
|
+
} : {
|
|
3036
|
+
...i,
|
|
3037
|
+
medium: {
|
|
3038
|
+
kind: t,
|
|
3039
|
+
amount: fn(e, t)
|
|
3040
|
+
},
|
|
3041
|
+
...r || n?.light !== void 0 ? { interactivity: {
|
|
3042
|
+
...r,
|
|
3043
|
+
...n?.light === void 0 ? {} : { light: n.light }
|
|
3044
|
+
} } : {}
|
|
2990
3045
|
};
|
|
2991
3046
|
}
|
|
2992
3047
|
//#endregion
|
|
2993
|
-
export {
|
|
3048
|
+
export { tn as Aurora, hn as DEFAULT_ATOMS, V as DEFAULT_AURORA_CONFIG, Be as DEFAULT_VIVIDNESS, Ue as IMAGE_BLUR_MAX_DEFAULT, He as IMAGE_BLUR_MIN_DEFAULT, Re as MAX_NUCLEI, ze as MAX_STOPS, We as PAPER_WASH_GROUND, Ve as VIVID_TARGET, Qt as auroraFallbackGround, _n as configToAtoms, Ht as createAurora, s as cssToOklch, Xe as deriveAurora, H as flattenPalette, Ke as hexToOklchStop, F as isSoftwareWebGLRenderer, Z as nucleiFieldStatic, on as nucleiPrior, u as oklchStopToHex, d as oklchToLinear, Ge as paletteToCssGradient, qt as relativeLuminance, gn as resolveAtoms, I as resolveRenderMode, Yt as sampleAuroraField, Gt as useAurora, nn as useCursorInteraction };
|