@mkbabb/glass-ui 8.0.0 → 10.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/MIGRATION.md +4768 -0
- package/README.md +57 -13
- package/dist/DialogContent-CwIBvou_.js +157 -0
- package/dist/{DropdownMenuTrigger-8UZsBtZ8.js → DropdownMenuTrigger-CKRnhDSQ.js} +1 -1
- package/dist/{Surface-i1tWC-Ga.js → Surface-1nPoabc3.js} +1 -1
- package/dist/{accent-tone-solve-Cw7WkRD9.js → accent-tone-solve-5H6FY2QO.js} +1 -1
- package/dist/aurora.js +386 -355
- package/dist/{badge-owUOaaba.js → badge-BO6BC4G5.js} +1 -1
- package/dist/badge.js +1 -1
- package/dist/blob.js +44 -44
- package/dist/{button-yvGPb0Bx.js → button-BOFTUPyU.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/{card-3HFFpC7_.js → card-ByyqRBvK.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/carousel.js +3 -3
- package/dist/{checkbox-BnXuGgJ3.js → checkbox-B1qn65se.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip.js +8 -3
- package/dist/{class-names-q-UGOkHH.js → class-names-FlXcvRRT.js} +65 -18
- package/dist/{collapsible-B7O6m-Ch.js → collapsible-DFzK29Oh.js} +5 -2
- package/dist/collapsible.js +1 -1
- package/dist/color.glsl-DTJhdekG.js +34 -0
- package/dist/color.js +11 -11
- package/dist/color.wgsl-BTszLY39.js +398 -0
- package/dist/{command-BuBnYpxF.js → command-C-5xSEJ2.js} +8 -8
- package/dist/command.js +1 -1
- package/dist/component-styles.css +1 -0
- package/dist/components/_shared/class-names.d.ts +10 -1
- package/dist/components/_shared/control.d.ts +0 -1
- package/dist/components/_shared/index.d.ts +0 -1
- package/dist/components/_shared/menu/menu.css +1 -1
- package/dist/components/_shared/overlay/index.d.ts +1 -0
- package/dist/components/_shared/overlay/shortcuts.d.ts +12 -0
- package/dist/components/aurora/Aurora.vue.d.ts +1 -0
- package/dist/components/aurora/composables/atoms.d.ts +22 -6
- package/dist/components/aurora/composables/frameLoop.d.ts +6 -5
- package/dist/components/aurora/composables/runtime.d.ts +28 -1
- package/dist/components/aurora/composables/useAurora.d.ts +28 -0
- package/dist/components/aurora/composables/wgpuSetup.d.ts +1 -1
- package/dist/components/aurora/constants/presets.d.ts +62 -5
- package/dist/components/aurora/index.d.ts +1 -1
- package/dist/components/blob/Blob.vue.d.ts +3 -3
- package/dist/components/card/Card.vue.d.ts +8 -2
- package/dist/components/chip/Chip.vue.d.ts +1 -7
- package/dist/components/chip/chipVariants.d.ts +1 -0
- package/dist/components/collapsible/Collapsible.vue.d.ts +1 -0
- package/dist/components/command/CommandDialog.vue.d.ts +1 -1
- package/dist/components/configurator/Configurator.vue.d.ts +25 -2
- package/dist/components/configurator/ConfiguratorRow.vue.d.ts +4 -2
- package/dist/components/configurator/styles.css +1 -1
- package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -1
- package/dist/components/deck/styles/capture.css +1 -1
- package/dist/components/dialog/styles.css +1 -1
- package/dist/components/dock/DockSeparator.vue.d.ts +2 -3
- package/dist/components/dock/GlassDock.vue.d.ts +1 -0
- package/dist/components/dock/composables/dockContext.d.ts +1 -8
- package/dist/components/dock/composables/dockCrossfadeContext.d.ts +0 -2
- package/dist/components/dock/composables/index.d.ts +1 -1
- package/dist/components/dock/composables/useDockHold.d.ts +16 -12
- package/dist/components/dock/composables/useDockRun.d.ts +20 -0
- package/dist/components/dock/composables/useDockSearch.d.ts +1 -1
- package/dist/components/dock/composables/useDockShellProps.d.ts +18 -101
- package/dist/components/dock/composables/useDockState.d.ts +2 -9
- package/dist/components/dock/constants.d.ts +15 -0
- package/dist/components/dock/index.d.ts +2 -2
- package/dist/components/dock/styles/controls/icon-button.css +1 -1
- package/dist/components/dock/styles/controls/tab-button.css +1 -1
- package/dist/components/dock/styles/controls/triggers.css +1 -1
- package/dist/components/dock/styles/controls.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/run.css +1 -0
- package/dist/components/dock/styles/search.css +1 -1
- package/dist/components/dock/styles/shape.css +1 -1
- package/dist/components/dock/styles/shell-regions.css +1 -1
- package/dist/components/dock/styles/shell.css +1 -1
- package/dist/components/fourier-field/FourierField.vue.d.ts +29 -26
- package/dist/components/fourier-field/clock.d.ts +35 -0
- package/dist/components/fourier-field/constants.d.ts +80 -104
- package/dist/components/fourier-field/index.d.ts +3 -28
- package/dist/components/fourier-field/math.d.ts +69 -77
- package/dist/components/fourier-field/renderer/mint.d.ts +50 -0
- package/dist/components/fourier-field/renderer/uniforms.d.ts +84 -0
- package/dist/components/fourier-field/renderer/wgpu.d.ts +28 -0
- package/dist/components/fourier-field/shaders/compute.wgsl.d.ts +1 -0
- package/dist/components/fourier-field/shaders/render.wgsl.d.ts +1 -0
- package/dist/components/fourier-field/useFourierField.d.ts +49 -0
- package/dist/components/handmark/HandMark.vue.d.ts +18 -14
- package/dist/components/handmark/index.d.ts +4 -23
- package/dist/components/handmark/stroke.d.ts +92 -0
- package/dist/components/labeled-field/LabeledSwitch.vue.d.ts +3 -1
- package/dist/components/labeled-field/types.d.ts +1 -1
- package/dist/components/menu/DropdownMenu.vue.d.ts +1 -1
- package/dist/components/metric/coalesce-metric.d.ts +6 -1
- package/dist/components/metric/styles.css +1 -1
- package/dist/components/popover/Popover.vue.d.ts +1 -1
- package/dist/components/scroll-progress-rim/styles.css +1 -1
- package/dist/components/sheet/styles.css +1 -1
- package/dist/components/slider/styles.css +1 -1
- package/dist/components/tabs/SegmentedTabs.vue.d.ts +25 -112
- package/dist/components/tabs/composables/useTabDragMorph.d.ts +1 -1
- package/dist/components/tabs/composables/useTabResponsive.d.ts +11 -11
- 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/tabs/types.d.ts +85 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/toast/Toast.vue.d.ts +2 -2
- package/dist/composables/color/index.d.ts +0 -15
- package/dist/composables/dark/darkModeSyncScript.d.ts +42 -0
- package/dist/composables/dom/useResolveTokenColor.d.ts +1 -1
- package/dist/composables/glass/index.d.ts +2 -0
- package/dist/composables/keyboard/useKeyboardShortcuts.d.ts +47 -1
- package/dist/composables/motion/pointer/pointerFieldMappings.d.ts +0 -41
- package/dist/{components/search/composables → composables/search}/index.d.ts +2 -2
- package/dist/{components/search/composables/fuzzySearchIndex.d.ts → composables/search/match.d.ts} +8 -3
- package/dist/composables/sidebar/types.d.ts +5 -1
- package/dist/configurator-DiwVN573.js +339 -0
- package/dist/configurator.js +1 -1
- package/dist/constellation.js +5 -5
- package/dist/{content-CWO-XL7o.js → content-So3j6SOe.js} +1 -1
- package/dist/control-DJp15L4U.js +7 -0
- package/dist/dark-mode-toggle.js +2 -2
- package/dist/{dark-z_P5QwqI.js → dark-pONY3x93.js} +2 -2
- package/dist/dark.js +1 -1
- package/dist/{data-table-_RrOEdiw.js → data-table-Ba_uTfPc.js} +3 -3
- package/dist/data-table.js +1 -1
- package/dist/{deck-Ci6YjB5e.js → deck-Cm_VmyNL.js} +1 -1
- package/dist/deck.js +1 -1
- package/dist/{dialog-CbRnTRtg.js → dialog-BZoFG0j8.js} +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dock.js +718 -496
- package/dist/dom.js +90 -8
- package/dist/easing.js +5 -5
- package/dist/expandable-container-CZUj9BzY.js +142 -0
- package/dist/expandable-container.js +2 -142
- package/dist/fourier-field.js +638 -855
- package/dist/fourier-math.js +6 -6
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +88 -75
- package/dist/handmark.js +330 -718
- package/dist/index.d.ts +2 -2
- package/dist/infinite-scroll.js +16 -17
- package/dist/{input-Bls2A4Tt.js → input-eLZ_AU7l.js} +1 -1
- package/dist/input.js +1 -1
- package/dist/keyboard.js +64 -21
- package/dist/{label-BQEZhnK_.js → label-CE03H1KL.js} +2 -2
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +9 -6
- package/dist/{menu-wLu1XGKn.js → menu-BnmCOa3y.js} +93 -90
- package/dist/menu.js +2 -2
- package/dist/metric.js +12 -7
- package/dist/{motion-D4uYE0UM.js → motion-BvV1_24p.js} +1 -1
- package/dist/motion-core.js +35 -35
- package/dist/{number-field-NFAwQ0HK.js → number-field-RP89046a.js} +2 -2
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +3 -3
- package/dist/{participation-B0hdsIRo.js → participation-Di4UHbzk.js} +8 -8
- package/dist/{pointerFieldMappings-DP5tla5z.js → pointerFieldMappings-DXwlU5uj.js} +7 -23
- package/dist/popover-DA87hFBx.js +184 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-DF8dWZIX.js → progress-eVa-mc7J.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-group-Ci8o-pDx.js → radio-group-B58Bz16F.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{select-CDgwGH_P.js → select-fy3vtArm.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/{separator-CN11t406.js → separator-D4EZM10u.js} +2 -2
- package/dist/separator.js +1 -1
- package/dist/{sheet-BEFvnO_u.js → sheet-BQJyER59.js} +120 -115
- package/dist/sheet.js +2 -2
- package/dist/shortcuts-DGGWNRNe.js +13 -0
- package/dist/sidebar.js +4 -4
- package/dist/{slider-gsc8jDIo.js → slider-5ChjjWSR.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{status-dot-BpnqOP5N.js → status-dot-W4LFiJps.js} +2 -2
- package/dist/status-dot.js +1 -1
- 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/dissolve.css +1 -1
- package/dist/styles/glass/focus-veil.css +1 -1
- package/dist/styles/glass/ladder.css +1 -1
- package/dist/styles/glass/material.css +1 -1
- package/dist/styles/glass/overlay-plate.css +1 -1
- package/dist/styles/glass/reveal.css +1 -1
- package/dist/styles/glass-specular-track.css +1 -1
- package/dist/styles/paper.css +1 -1
- package/dist/styles/scroll-choreography.css +1 -1
- package/dist/styles/scroll-chrome.css +1 -1
- package/dist/styles/scroll-driven.css +1 -1
- package/dist/styles/theme/literals.css +1 -1
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm-glass.css +1 -1
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/offsets.css +1 -1
- package/dist/styles/tokens/scheme-motion.css +1 -1
- package/dist/styles/tokens/sizing.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/responsive.css +1 -1
- package/dist/styles/view-transition.css +1 -1
- package/dist/styles/viz-reveal.css +1 -1
- package/dist/surface.js +1 -1
- package/dist/{switch-DxZzDrmV.js → switch-BYUZ6g9G.js} +2 -2
- package/dist/switch.js +1 -1
- package/dist/{tabs-CYscnq5H.js → tabs-rdRXKXxd.js} +4 -3
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +44 -42
- package/dist/{toast-9c6Kp58L.js → toast-DVOwo6GB.js} +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-11aPGMfE.js → toggle-group-CC5b3o1R.js} +2 -2
- package/dist/toggle-group.js +1 -1
- package/dist/{tooltip-DqKMZ4dn.js → tooltip-DhTHhtJN.js} +2 -2
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAccentTone-DFAh1osB.js → useAccentTone-DitmKfGL.js} +1 -1
- package/dist/{resolveCanvasColor-6MCrswTB.js → useCanvas2D-CQRElMyE.js} +1 -11
- package/dist/{usePointerVelocityField-DsIf7yyq.js → usePointerVelocityField-Lx26_Yap.js} +1 -1
- package/dist/useResolveTokenColor-B2FfJnd9.js +24 -0
- package/package.json +5 -21
- package/dist/DialogContent-4hzLiaCQ.js +0 -152
- package/dist/canvas.d.ts +0 -1
- package/dist/canvas.js +0 -2
- package/dist/color.wgsl-B0N3mKMb.js +0 -412
- package/dist/compile-D7VYG3gi.js +0 -19
- package/dist/components/dock/composables/useDockOverflowFit.d.ts +0 -20
- package/dist/components/dock/composables/useDockTouchGate.d.ts +0 -42
- package/dist/components/dock/styles/overflow.css +0 -1
- package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +0 -24
- package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +0 -31
- package/dist/components/fourier-field/composables/uniformBridgeWGPU.d.ts +0 -39
- package/dist/components/fourier-field/composables/useFourierField.d.ts +0 -56
- package/dist/components/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +0 -1
- package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +0 -4
- package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +0 -1
- package/dist/components/fourier-field/shaders/fourier-field.ribbon.d.ts +0 -51
- package/dist/components/handmark/brush.d.ts +0 -269
- package/dist/components/handmark/composables/useHandMark.d.ts +0 -99
- package/dist/components/handmark/constants.d.ts +0 -69
- package/dist/components/handmark/freehand.d.ts +0 -69
- package/dist/components/handmark/geometry.d.ts +0 -62
- package/dist/components/handmark/ink.d.ts +0 -11
- package/dist/components/handmark/noise.d.ts +0 -30
- package/dist/components/handmark/texture.d.ts +0 -39
- package/dist/components/handmark/types.d.ts +0 -70
- package/dist/components/search/SearchBar.vue.d.ts +0 -38
- package/dist/components/search/index.d.ts +0 -8
- package/dist/components/search/searchVariants.d.ts +0 -16
- package/dist/configurator-BoeScnDL.js +0 -311
- package/dist/control-Da4XeT43.js +0 -11
- package/dist/popover-DBMKTPkL.js +0 -181
- package/dist/search.d.ts +0 -1
- package/dist/search.js +0 -61
- package/dist/useFuzzySearch-CUnZknpm.js +0 -177
- package/dist/useResolveTokenColor-CspQv_ik.js +0 -107
- /package/dist/{components/search/composables → composables/search}/types.d.ts +0 -0
- /package/dist/{components/search/composables → composables/search}/useFuzzySearch.d.ts +0 -0
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./createCanvasLifecycle-hJHobVTn.js";
|
|
2
|
-
import { a as n, i as r, o as i, r as a } from "./rendererStatus-BxUlBLVy.js";
|
|
3
|
-
//#region src/components/aurora/constants/budget.ts
|
|
4
|
-
var o = 2, s = 1.5;
|
|
5
|
-
function c(e, t, n) {
|
|
6
|
-
return Math.max(t, Math.min(n, e));
|
|
7
|
-
}
|
|
8
|
-
function l() {
|
|
9
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1;
|
|
10
|
-
return Math.min(e, o);
|
|
11
|
-
}
|
|
12
|
-
function u() {
|
|
13
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1;
|
|
14
|
-
return Math.min(e, s);
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/composables/glass/webgl/useWebGLCanvas.ts
|
|
18
|
-
function d() {
|
|
19
|
-
if (typeof document > "u") return null;
|
|
20
|
-
let e = null;
|
|
21
|
-
try {
|
|
22
|
-
if (e = document.createElement("canvas").getContext("webgl2"), !e) return null;
|
|
23
|
-
let t = e.getExtension("WEBGL_debug_renderer_info");
|
|
24
|
-
return t ? String(e.getParameter(t.UNMASKED_RENDERER_WEBGL) ?? "").toLowerCase() : null;
|
|
25
|
-
} catch {
|
|
26
|
-
return null;
|
|
27
|
-
} finally {
|
|
28
|
-
e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function f(e, n) {
|
|
32
|
-
let { setup: r, contextAttrs: i } = n, a = null, o = null;
|
|
33
|
-
function s() {
|
|
34
|
-
let t = e.getContext("webgl2", i ?? void 0);
|
|
35
|
-
if (!t) throw Error("[useWebGLCanvas] WebGL2 unavailable");
|
|
36
|
-
return a = t, o = r(a), {
|
|
37
|
-
frame: o.frame,
|
|
38
|
-
shouldContinue: o.shouldContinue,
|
|
39
|
-
time: o.time,
|
|
40
|
-
teardown: () => {
|
|
41
|
-
o?.teardown?.(), a?.getExtension("WEBGL_lose_context")?.loseContext(), a = null, o = null;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
let c = null, l = null;
|
|
46
|
-
function u(e) {
|
|
47
|
-
e.preventDefault(), a = null, o = null, l?.();
|
|
48
|
-
}
|
|
49
|
-
let d = t({
|
|
50
|
-
canvas: e,
|
|
51
|
-
mode: n.mode,
|
|
52
|
-
respectReducedMotion: n.respectReducedMotion,
|
|
53
|
-
dprPolicy: n.dprPolicy,
|
|
54
|
-
composeIntersectionPark: n.composeIntersectionPark,
|
|
55
|
-
intersectionRootMargin: n.intersectionRootMargin,
|
|
56
|
-
revealBloom: n.revealBloom,
|
|
57
|
-
onContextStateChange: n.onContextStateChange,
|
|
58
|
-
onContextError: n.onContextError,
|
|
59
|
-
buildContext: s,
|
|
60
|
-
resize: (e) => o?.resize(e),
|
|
61
|
-
bindContextEvents: (t, n) => {
|
|
62
|
-
c = t, l = n, e.addEventListener("webglcontextlost", u, !1), e.addEventListener("webglcontextrestored", c, !1);
|
|
63
|
-
},
|
|
64
|
-
unbindContextEvents: () => {
|
|
65
|
-
e.removeEventListener("webglcontextlost", u, !1), c && e.removeEventListener("webglcontextrestored", c, !1);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return {
|
|
69
|
-
arm: d.arm,
|
|
70
|
-
presize: d.presize,
|
|
71
|
-
suspend: d.suspend,
|
|
72
|
-
resume: d.resume,
|
|
73
|
-
wake: d.wake,
|
|
74
|
-
renderAt: d.renderAt,
|
|
75
|
-
dispose: d.dispose,
|
|
76
|
-
get gl() {
|
|
77
|
-
return a;
|
|
78
|
-
},
|
|
79
|
-
get reducedMotion() {
|
|
80
|
-
return d.reducedMotion;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/composables/glass/webgpu/webgpuDevice.ts
|
|
86
|
-
var p = class extends Error {
|
|
87
|
-
kind;
|
|
88
|
-
constructor(e, t, n) {
|
|
89
|
-
super(t), this.name = "WebGPUInitError", this.kind = e, n !== void 0 && (this.cause = n);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
function m(e) {
|
|
93
|
-
try {
|
|
94
|
-
let t = e.info;
|
|
95
|
-
if (t?.isFallbackAdapter || e.isFallbackAdapter) return !0;
|
|
96
|
-
if (!t) return !1;
|
|
97
|
-
let n = [
|
|
98
|
-
t.vendor,
|
|
99
|
-
t.architecture,
|
|
100
|
-
t.description
|
|
101
|
-
].filter((e) => typeof e == "string").join(" ").toLowerCase();
|
|
102
|
-
return n.includes("swiftshader") || n.includes("llvmpipe") || n.includes("software") || n.includes("basic render") || n.includes("microsoft basic");
|
|
103
|
-
} catch {
|
|
104
|
-
return !1;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
var h = 6e3;
|
|
108
|
-
function g(e, t) {
|
|
109
|
-
if (typeof setTimeout > "u") return e;
|
|
110
|
-
let n, r = new Promise((e, r) => {
|
|
111
|
-
n = setTimeout(() => {
|
|
112
|
-
r(new p("acquire-timeout", `[useWebGPUCanvas] ${t}() did not settle within ${h}ms — falling to the WebGL2 net`));
|
|
113
|
-
}, h);
|
|
114
|
-
});
|
|
115
|
-
return Promise.race([e, r]).finally(() => clearTimeout(n));
|
|
116
|
-
}
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/composables/glass/webgpu/useWebGPUCanvas.ts
|
|
119
|
-
function _() {
|
|
120
|
-
return typeof navigator < "u" && "gpu" in navigator && navigator.gpu != null;
|
|
121
|
-
}
|
|
122
|
-
var v = null;
|
|
123
|
-
function y(e, t) {
|
|
124
|
-
if (v) return v;
|
|
125
|
-
if (!_()) return Promise.reject(new p("no-navigator-gpu", "[useWebGPUCanvas] navigator.gpu unavailable"));
|
|
126
|
-
let n = (async () => {
|
|
127
|
-
let i = await g(navigator.gpu.requestAdapter(e), "requestAdapter");
|
|
128
|
-
if (!i) throw new p("no-adapter", "[useWebGPUCanvas] no GPU adapter");
|
|
129
|
-
if (m(i)) throw new p("software-adapter", "[useWebGPUCanvas] software WebGPU adapter (SwiftShader/llvmpipe/fallback) — falling to the WebGL2 net");
|
|
130
|
-
let a;
|
|
131
|
-
try {
|
|
132
|
-
a = await g(i.requestDevice(t), "requestDevice");
|
|
133
|
-
} catch (e) {
|
|
134
|
-
throw e instanceof p ? e : new p("device-request", "[useWebGPUCanvas] requestDevice rejected", e);
|
|
135
|
-
}
|
|
136
|
-
return a.lost.then(() => {
|
|
137
|
-
v === n && (v = null);
|
|
138
|
-
}), {
|
|
139
|
-
device: a,
|
|
140
|
-
adapterClass: r(i.info)
|
|
141
|
-
};
|
|
142
|
-
})();
|
|
143
|
-
return n.catch(() => {
|
|
144
|
-
v === n && (v = null);
|
|
145
|
-
}), v = n, n;
|
|
146
|
-
}
|
|
147
|
-
function b(n, r) {
|
|
148
|
-
let { setup: i } = r, a = r.alphaMode ?? "premultiplied", o = null, s = null, c = "bgra8unorm", l = null, u = !1, d = null, f = null, m = "Acquiring adapter", h = null, g = null, v = null;
|
|
149
|
-
function b() {
|
|
150
|
-
if (!o) throw Error("[useWebGPUCanvas] device not acquired");
|
|
151
|
-
let e = n.getContext("webgpu");
|
|
152
|
-
if (!e) throw Error("[useWebGPUCanvas] WebGPU context unavailable");
|
|
153
|
-
return s = e, c = navigator.gpu.getPreferredCanvasFormat(), e.configure({
|
|
154
|
-
device: o,
|
|
155
|
-
format: c,
|
|
156
|
-
alphaMode: a
|
|
157
|
-
}), o.pushErrorScope("validation"), o.addEventListener("uncapturederror", x), l = i(o, s, c), C(), v = o.popErrorScope(), v.then((e) => {
|
|
158
|
-
e && r.onInitError?.(e);
|
|
159
|
-
}), {
|
|
160
|
-
frame: (e) => l?.frame(e),
|
|
161
|
-
shouldContinue: () => l?.shouldContinue() ?? !1,
|
|
162
|
-
time: (e) => l?.time?.(e) ?? e,
|
|
163
|
-
teardown: S
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function x(e) {
|
|
167
|
-
let t = e.error;
|
|
168
|
-
r.onInitError?.(t);
|
|
169
|
-
}
|
|
170
|
-
function S() {
|
|
171
|
-
l?.teardown?.(), o?.removeEventListener("uncapturederror", x), s?.unconfigure(), s = null, l = null, v = null;
|
|
172
|
-
}
|
|
173
|
-
function C() {
|
|
174
|
-
try {
|
|
175
|
-
l?.resize(e(n, r.dprPolicy)), l?.frame(0);
|
|
176
|
-
} catch {}
|
|
177
|
-
}
|
|
178
|
-
let w = t({
|
|
179
|
-
canvas: n,
|
|
180
|
-
mode: r.mode,
|
|
181
|
-
respectReducedMotion: r.respectReducedMotion,
|
|
182
|
-
dprPolicy: r.dprPolicy,
|
|
183
|
-
composeIntersectionPark: r.composeIntersectionPark,
|
|
184
|
-
intersectionRootMargin: r.intersectionRootMargin,
|
|
185
|
-
revealBloom: r.revealBloom,
|
|
186
|
-
onContextStateChange: (e) => {
|
|
187
|
-
if (e === "lost") {
|
|
188
|
-
r.onContextStateChange?.(e);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
let t = v;
|
|
192
|
-
if (!t) {
|
|
193
|
-
r.onContextStateChange?.(e);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
t.then((n) => {
|
|
197
|
-
!u && !n && v === t && r.onContextStateChange?.(e);
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
onContextError: (e) => r.onInitError?.(e),
|
|
201
|
-
buildContext: b,
|
|
202
|
-
resize: (e) => l?.resize(e),
|
|
203
|
-
bindContextEvents: (e, t) => {
|
|
204
|
-
h = e, g = t;
|
|
205
|
-
},
|
|
206
|
-
unbindContextEvents: () => {
|
|
207
|
-
h = null, g = null;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
async function T() {
|
|
211
|
-
if (!_()) throw new p("no-navigator-gpu", "[useWebGPUCanvas] navigator.gpu unavailable");
|
|
212
|
-
let e = await y(r.adapterOptions, r.deviceDescriptor);
|
|
213
|
-
o = e.device, m = e.adapterClass, E(e.device);
|
|
214
|
-
}
|
|
215
|
-
function E(e) {
|
|
216
|
-
e.lost.then((e) => {
|
|
217
|
-
if (!u) {
|
|
218
|
-
if (g?.(), S(), o = null, e.reason === "destroyed") {
|
|
219
|
-
let t = /* @__PURE__ */ Error(`[useWebGPUCanvas] device destroyed${e.message ? ` (${e.message})` : ""}`);
|
|
220
|
-
f = t, r.onInitError?.(t);
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
T().then(() => {
|
|
224
|
-
u || h?.();
|
|
225
|
-
}).catch((e) => {
|
|
226
|
-
f = e, r.onInitError?.(e);
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
async function D() {
|
|
232
|
-
if (!u) {
|
|
233
|
-
if (f) throw f;
|
|
234
|
-
if (d) return d;
|
|
235
|
-
if (o) {
|
|
236
|
-
w.arm();
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
return w.presize(), d = (async () => {
|
|
240
|
-
try {
|
|
241
|
-
if (await T(), u) return;
|
|
242
|
-
if (w.arm(), v) {
|
|
243
|
-
let e = r.mode !== "capture";
|
|
244
|
-
e && w.suspend("manual");
|
|
245
|
-
let t = await v;
|
|
246
|
-
if (u) return;
|
|
247
|
-
if (t) throw new p("pipeline-validation", `[useWebGPUCanvas] pipeline failed validation (${t.message})`);
|
|
248
|
-
e && w.resume("manual");
|
|
249
|
-
}
|
|
250
|
-
} catch (e) {
|
|
251
|
-
throw f = e, S(), e instanceof p || r.onInitError?.(e), e;
|
|
252
|
-
} finally {
|
|
253
|
-
d = null;
|
|
254
|
-
}
|
|
255
|
-
})(), d;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return {
|
|
259
|
-
armAsync: D,
|
|
260
|
-
arm: () => {
|
|
261
|
-
o && w.arm();
|
|
262
|
-
},
|
|
263
|
-
presize: w.presize,
|
|
264
|
-
suspend: w.suspend,
|
|
265
|
-
resume: w.resume,
|
|
266
|
-
wake: w.wake,
|
|
267
|
-
renderAt: w.renderAt,
|
|
268
|
-
dispose: () => {
|
|
269
|
-
u = !0, w.dispose(), o = null;
|
|
270
|
-
},
|
|
271
|
-
get device() {
|
|
272
|
-
return o;
|
|
273
|
-
},
|
|
274
|
-
get adapterClass() {
|
|
275
|
-
return m;
|
|
276
|
-
},
|
|
277
|
-
get reducedMotion() {
|
|
278
|
-
return w.reducedMotion;
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
//#endregion
|
|
283
|
-
//#region src/composables/glass/webgpu/useGpuSubstrate.ts
|
|
284
|
-
function x(e, t) {
|
|
285
|
-
let r;
|
|
286
|
-
return r = f(e, {
|
|
287
|
-
mode: t.mode,
|
|
288
|
-
respectReducedMotion: t.respectReducedMotion,
|
|
289
|
-
contextAttrs: t.contextAttrs,
|
|
290
|
-
dprPolicy: t.dprPolicy,
|
|
291
|
-
composeIntersectionPark: t.composeIntersectionPark,
|
|
292
|
-
intersectionRootMargin: t.intersectionRootMargin,
|
|
293
|
-
revealBloom: t.revealBloom,
|
|
294
|
-
onContextStateChange: (e) => {
|
|
295
|
-
t.onStatus?.(e === "lost" ? n("webgl2") : {
|
|
296
|
-
phase: "ready",
|
|
297
|
-
engine: "webgl2",
|
|
298
|
-
adapter: a(r.gl)
|
|
299
|
-
});
|
|
300
|
-
},
|
|
301
|
-
setup: t.setupGL,
|
|
302
|
-
onContextError: (e) => {
|
|
303
|
-
t.onStatus?.(i("webgl2", "WebGL 2 context", e)), t.onInitError?.(e);
|
|
304
|
-
}
|
|
305
|
-
}), r;
|
|
306
|
-
}
|
|
307
|
-
function S(e, t) {
|
|
308
|
-
let r = _() && t.setupWGPU != null, o = null, s = null, c = r ? "webgpu" : "webgl2", l = !1, u = (e) => t.onStatus?.(e), d = (e, t, r) => u(e === "lost" ? n(t) : {
|
|
309
|
-
phase: "ready",
|
|
310
|
-
engine: t,
|
|
311
|
-
adapter: r()
|
|
312
|
-
});
|
|
313
|
-
u(n(c)), r ? o = b(e, {
|
|
314
|
-
mode: t.mode,
|
|
315
|
-
respectReducedMotion: t.respectReducedMotion,
|
|
316
|
-
dprPolicy: t.dprPolicy,
|
|
317
|
-
composeIntersectionPark: t.composeIntersectionPark,
|
|
318
|
-
intersectionRootMargin: t.intersectionRootMargin,
|
|
319
|
-
revealBloom: t.revealBloom,
|
|
320
|
-
setup: t.setupWGPU,
|
|
321
|
-
alphaMode: t.alphaMode,
|
|
322
|
-
adapterOptions: t.adapterOptions,
|
|
323
|
-
deviceDescriptor: t.deviceDescriptor,
|
|
324
|
-
onContextStateChange: (e) => {
|
|
325
|
-
d(e, "webgpu", () => o?.adapterClass ?? "Hardware adapter");
|
|
326
|
-
},
|
|
327
|
-
onInitError: (e) => {
|
|
328
|
-
u(i("webgpu", o?.adapterClass ?? "Hardware adapter", e)), t.onInitError?.(e);
|
|
329
|
-
}
|
|
330
|
-
}) : s = x(e, t);
|
|
331
|
-
function f(r) {
|
|
332
|
-
o?.dispose(), o = null, c = "webgl2", u(n("webgl2")), t.onBackendFallback?.({
|
|
333
|
-
from: "webgpu",
|
|
334
|
-
to: "webgl2",
|
|
335
|
-
error: r
|
|
336
|
-
});
|
|
337
|
-
try {
|
|
338
|
-
s = x(e, t), s.arm(), u({
|
|
339
|
-
phase: "ready",
|
|
340
|
-
engine: "webgl2",
|
|
341
|
-
adapter: a(s.gl)
|
|
342
|
-
});
|
|
343
|
-
} catch (e) {
|
|
344
|
-
throw s = null, u(i("webgl2", "WebGL 2 context", e)), t.onInitError?.(e), e;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
async function m() {
|
|
348
|
-
if (!l) {
|
|
349
|
-
if (h(), o) try {
|
|
350
|
-
await o.armAsync(), u({
|
|
351
|
-
phase: "ready",
|
|
352
|
-
engine: "webgpu",
|
|
353
|
-
adapter: o.adapterClass
|
|
354
|
-
});
|
|
355
|
-
return;
|
|
356
|
-
} catch (e) {
|
|
357
|
-
if (l) return;
|
|
358
|
-
if (e instanceof p && e.kind !== "pipeline-validation") {
|
|
359
|
-
f(e);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
throw u(i("webgpu", o.adapterClass, e)), e;
|
|
363
|
-
}
|
|
364
|
-
try {
|
|
365
|
-
s?.arm(), u({
|
|
366
|
-
phase: "ready",
|
|
367
|
-
engine: "webgl2",
|
|
368
|
-
adapter: a(s?.gl ?? null)
|
|
369
|
-
});
|
|
370
|
-
} catch (e) {
|
|
371
|
-
throw u(i("webgl2", "WebGL 2 context", e)), t.onInitError?.(e), e;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
function h() {
|
|
376
|
-
l || (o?.presize(), s?.presize());
|
|
377
|
-
}
|
|
378
|
-
function g() {
|
|
379
|
-
l || (h(), o?.arm(), s?.arm());
|
|
380
|
-
}
|
|
381
|
-
return {
|
|
382
|
-
get backend() {
|
|
383
|
-
return c;
|
|
384
|
-
},
|
|
385
|
-
armAsync: m,
|
|
386
|
-
arm: g,
|
|
387
|
-
presize: h,
|
|
388
|
-
suspend: (e) => {
|
|
389
|
-
o?.suspend(e), s?.suspend(e);
|
|
390
|
-
},
|
|
391
|
-
resume: (e) => {
|
|
392
|
-
o?.resume(e), s?.resume(e);
|
|
393
|
-
},
|
|
394
|
-
wake: () => {
|
|
395
|
-
o?.wake(), s?.wake();
|
|
396
|
-
},
|
|
397
|
-
renderAt: (e) => {
|
|
398
|
-
o?.renderAt(e), s?.renderAt(e);
|
|
399
|
-
},
|
|
400
|
-
dispose: () => {
|
|
401
|
-
l = !0, o?.dispose(), s?.dispose(), o = null, s = null;
|
|
402
|
-
},
|
|
403
|
-
get reducedMotion() {
|
|
404
|
-
return (o ?? s)?.reducedMotion ?? !1;
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
//#endregion
|
|
409
|
-
//#region src/composables/glass/procedural/color.glsl.ts
|
|
410
|
-
var C = "\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}", w = "const mat2 FBM_ROT = mat2(0.8, 0.6, -0.6, 0.8);", T = "\n// value.js LINEAR_SRGB_TO_LMS (constants.ts), row-major; written here as GLSL\n// columns (= the transpose) so mat3 * vec3 evaluates the row-major M·v.\nconst mat3 LINEAR_SRGB_TO_LMS = mat3(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS→OKLab coefficients (gamut.ts lines 295-297 —\n// these differ at the ~1e-9 digit from LMS_TO_OKLAB_MATRIX; use the inline ones to\n// mirror the exact value.js path), row-major → GLSL columns.\nconst mat3 LMS_TO_OKLAB = mat3(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF (constants.ts), row-major → GLSL columns. Rows:\n// l = [1, 0.3963377774, 0.2158037573], m = [1, -0.1055613458, -0.0638541728],\n// s = [1, -0.0894841775, -1.2914855480].\nconst mat3 OKLAB_TO_LMS = mat3(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB (constants.ts), row-major → GLSL columns.\nconst mat3 LMS_TO_LINEAR_SRGB = mat3(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\n// Gamma sRGB → raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nvec3 srgbToOklab(vec3 c) {\n vec3 lin = srgbToLinear(c);\n vec3 lms = LINEAR_SRGB_TO_LMS * lin;\n vec3 lmsCbrt = sign(lms) * pow(abs(lms), vec3(1.0 / 3.0));\n return LMS_TO_OKLAB * lmsCbrt;\n}\n\n// Raw OKLab (L, a, b) → linear sRGB. Mirrors value.js oklabToLinearSRGB.\nvec3 oklabToLinearSrgb(vec3 lab) {\n vec3 lms_ = OKLAB_TO_LMS * lab;\n vec3 lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab → OKLCh: H in RADIANS. Mirrors value.js rawOklabToOklch (which returns\n// degrees; we stay in radians and only fold to [0, 2pi)).\nvec3 oklabToOklch(vec3 lab) {\n float C = length(lab.yz);\n float H = atan(lab.z, lab.y);\n if (H < 0.0) H += 2.0 * PI;\n return vec3(lab.x, C, H);\n}\n\n// OKLCh (H radians) → OKLab. Mirrors value.js rawOklchToOklab.\nvec3 oklchToOklab(vec3 lch) {\n return vec3(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}", E = "\n// value.js interpolateHue in the NORMALIZED-TURNS domain (h_rad/TAU → turns, the\n// exact .5/+1.0 branch per method, fract() wrap, *TAU back). A radians-native port\n// (PI thresholds / +TAU wrap) diverges 180° at the antipode. methods: 0 shorter,\n// 1 longer, 2 increasing, 3 decreasing.\nfloat interpolateHueTurns(float h0, float h1, float t, int method) {\n float TAU = 2.0 * PI;\n float a = h0 / TAU;\n float b = h1 / TAU;\n float i = b - a;\n if (method == 0) { // shorter\n if (i > 0.5) a += 1.0; else if (i < -0.5) b += 1.0;\n } else if (method == 1) { // longer\n if (i > 0.0 && i < 0.5) a += 1.0; else if (i > -0.5 && i <= 0.0) b += 1.0;\n } else if (method == 2) { // increasing\n if (i < 0.0) b += 1.0;\n } else { // decreasing\n if (i > 0.0) a += 1.0;\n }\n float r = a + t * (b - a);\n r = fract(r); // (r % 1 + 1) % 1 — fract is non-negative in GLSL\n return r * TAU; // back to radians\n}\n\n// Linear-sRGB endpoint pair → OKLab-rectangular interpolation → linear sRGB. Holds\n// chroma across the ramp (no grey midpoint). The default/shorter ramp path.\nvec3 mixPaletteOklab(vec3 linA, vec3 linB, float t) {\n vec3 labA = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linA) * pow(abs(LINEAR_SRGB_TO_LMS * linA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linB) * pow(abs(LINEAR_SRGB_TO_LMS * linB), vec3(1.0 / 3.0)));\n vec3 lab = mix(labA, labB, t);\n return oklabToLinearSrgb(lab);\n}\n\n// Linear-sRGB endpoint pair → OKLCh interpolation along the huePath arc → linear\n// sRGB. L and C lerp; H walks the chosen arc. The deliberate-rainbow path.\nvec3 mixPaletteOklchArc(vec3 linA, vec3 linB, float t, int method) {\n vec3 labA = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linA) * pow(abs(LINEAR_SRGB_TO_LMS * linA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linB) * pow(abs(LINEAR_SRGB_TO_LMS * linB), vec3(1.0 / 3.0)));\n vec3 lchA = oklabToOklch(labA);\n vec3 lchB = oklabToOklch(labB);\n float L = mix(lchA.x, lchB.x, t);\n float C = mix(lchA.y, lchB.y, t);\n float H = interpolateHueTurns(lchA.z, lchB.z, t, method);\n return oklabToLinearSrgb(oklchToOklab(vec3(L, C, H)));\n}\n\n// The ramp dispatcher aurora's samplePalette splices. tRaw is the raw inter-stop\n// parameter [0,1]; the smoothstep ease + the huePath branch live HERE so the ramp is\n// one source. increasing(2)/decreasing(3) take the OKLCh hue-arc (rainbow sweep);\n// every other method takes the OKLab-rectangular straight line (no hue detour).\nvec3 samplePaletteRamp(vec3 a, vec3 b, float tRaw, int huePath) {\n float t = smoothstep(0.0, 1.0, tRaw);\n if (huePath == 2 || huePath == 3) {\n return mixPaletteOklchArc(a, b, t, huePath);\n }\n return mixPaletteOklab(a, b, t);\n}", D = "\n// Jarzynski PCG2D — uvec2 → uvec2 permuted-congruential hash (JCGT 2020).\nuvec2 pcg2d(uvec2 v) {\n v = v * 1664525u + 1013904223u;\n v.x += v.y * 1664525u;\n v.y += v.x * 1664525u;\n v = v ^ (v >> 16u);\n v.x += v.y * 1664525u;\n v.y += v.x * 1664525u;\n v = v ^ (v >> 16u);\n return v;\n}\n\n// Float→[0,1) scalar hash: bit-reinterpret the lattice coordinate, pcg2d it, take the\n// high word back to [0,1). Integer-bit — no sin() periodicity, no float-fract lattice.\nfloat pcgHash2(vec2 p) {\n uvec2 u = floatBitsToUint(p);\n return float(pcg2d(u).x) * (1.0 / 4294967296.0);\n}\n\n// Integer-lattice gradient: pcg2d the integer cell, fold the hash to an angle, return\n// the unit gradient vector. The gradient basis (not a scalar value) is what makes the\n// noise zero at the nodes (no value-noise plateaus).\nvec2 pcgGrad2(ivec2 cell) {\n uvec2 h = pcg2d(uvec2(cell));\n float ang = float(h.x) * (1.0 / 4294967296.0) * 6.28318530717958647692;\n return vec2(cos(ang), sin(ang));\n}\n\n// 2D SIMPLEX gradient noise (Gustavson skew). The skew transform F2/G2 maps the square\n// lattice onto a simplex (triangular) grid — no axis-aligned directional bias. Each of\n// the three simplex corners contributes grad·offset shaped by a radial (0.5 - r²)⁴\n// falloff. Output is ~[-1, 1]; callers remap to [0,1] via 0.5 + 0.5*gnoise.\nfloat gnoise(vec2 p) {\n const float F2 = 0.36602540378443864676; // (sqrt(3) - 1) / 2\n const float G2 = 0.21132486540518711775; // (3 - sqrt(3)) / 6\n float s = (p.x + p.y) * F2;\n vec2 i = floor(p + s);\n float tt = (i.x + i.y) * G2;\n vec2 x0 = p - (i - tt); // offset from the simplex origin corner\n ivec2 i1 = (x0.x > x0.y) ? ivec2(1, 0) : ivec2(0, 1);\n vec2 x1 = x0 - vec2(i1) + G2;\n vec2 x2 = x0 - 1.0 + 2.0 * G2;\n ivec2 ii = ivec2(i);\n float n = 0.0;\n float t0 = 0.5 - dot(x0, x0);\n if (t0 > 0.0) { t0 *= t0; n += t0 * t0 * dot(pcgGrad2(ii), x0); }\n float t1 = 0.5 - dot(x1, x1);\n if (t1 > 0.0) { t1 *= t1; n += t1 * t1 * dot(pcgGrad2(ii + i1), x1); }\n float t2 = 0.5 - dot(x2, x2);\n if (t2 > 0.0) { t2 *= t2; n += t2 * t2 * dot(pcgGrad2(ii + ivec2(1, 1)), x2); }\n return 70.0 * n; // normalize to ~[-1, 1]\n}", O = "\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}", k = "const FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);", A = "\n// value.js LINEAR_SRGB_TO_LMS, row-major → WGSL columns (= the transpose).\nconst LINEAR_SRGB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS→OKLab coefficients, row-major → WGSL columns.\nconst LMS_TO_OKLAB: mat3x3<f32> = mat3x3<f32>(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF, row-major → WGSL columns.\nconst OKLAB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB, row-major → WGSL columns.\nconst LMS_TO_LINEAR_SRGB: mat3x3<f32> = mat3x3<f32>(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\nfn cbrt3(v: vec3<f32>) -> vec3<f32> {\n return sign(v) * pow(abs(v), vec3<f32>(1.0 / 3.0));\n}\n\n// Gamma sRGB → raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nfn srgbToOklab(c: vec3<f32>) -> vec3<f32> {\n let lin = srgbToLinear(c);\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\n// Raw OKLab (L, a, b) → linear sRGB. Mirrors value.js oklabToLinearSRGB.\nfn oklabToLinearSrgb(lab: vec3<f32>) -> vec3<f32> {\n let lms_ = OKLAB_TO_LMS * lab;\n let lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab → OKLCh: H in RADIANS, folded to [0, 2pi). Mirrors value.js rawOklabToOklch.\nfn oklabToOklch(lab: vec3<f32>) -> vec3<f32> {\n let C = length(lab.yz);\n var H = atan2(lab.z, lab.y);\n if (H < 0.0) { H = H + 2.0 * PI; }\n return vec3<f32>(lab.x, C, H);\n}\n\n// OKLCh (H radians) → OKLab. Mirrors value.js rawOklchToOklab.\nfn oklchToOklab(lch: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}", j = "\n// value.js interpolateHue in the NORMALIZED-TURNS domain. methods: 0 shorter,\n// 1 longer, 2 increasing, 3 decreasing.\nfn interpolateHueTurns(h0: f32, h1: f32, t: f32, method: i32) -> f32 {\n let TAU = 2.0 * PI;\n var a = h0 / TAU;\n var b = h1 / TAU;\n let i = b - a;\n if (method == 0) { // shorter\n if (i > 0.5) { a = a + 1.0; } else if (i < -0.5) { b = b + 1.0; }\n } else if (method == 1) { // longer\n if (i > 0.0 && i < 0.5) { a = a + 1.0; } else if (i > -0.5 && i <= 0.0) { b = b + 1.0; }\n } else if (method == 2) { // increasing\n if (i < 0.0) { b = b + 1.0; }\n } else { // decreasing\n if (i > 0.0) { a = a + 1.0; }\n }\n var r = a + t * (b - a);\n r = fract(r); // fract is non-negative in WGSL\n return r * TAU; // back to radians\n}\n\n// Linear-sRGB endpoint pair → OKLab-rectangular interpolation → linear sRGB.\nfn mixPaletteOklab(linA: vec3<f32>, linB: vec3<f32>, t: f32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lab = mix(labA, labB, t);\n return oklabToLinearSrgb(lab);\n}\n\n// Linear-sRGB endpoint pair → OKLCh hue-arc interpolation → linear sRGB.\nfn mixPaletteOklchArc(linA: vec3<f32>, linB: vec3<f32>, t: f32, method: i32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lchA = oklabToOklch(labA);\n let lchB = oklabToOklch(labB);\n let L = mix(lchA.x, lchB.x, t);\n let C = mix(lchA.y, lchB.y, t);\n let H = interpolateHueTurns(lchA.z, lchB.z, t, method);\n return oklabToLinearSrgb(oklchToOklab(vec3<f32>(L, C, H)));\n}\n\n// The ramp dispatcher (the samplePalette splices it). tRaw is the raw inter-stop\n// parameter [0,1]; the smoothstep ease + the huePath branch live here so the ramp is\n// one source. increasing(2)/decreasing(3) take the OKLCh hue-arc; every other method\n// takes the OKLab-rectangular straight line.\nfn samplePaletteRamp(a: vec3<f32>, b: vec3<f32>, tRaw: f32, huePath: i32) -> vec3<f32> {\n let t = smoothstep(0.0, 1.0, tRaw);\n if (huePath == 2 || huePath == 3) {\n return mixPaletteOklchArc(a, b, t, huePath);\n }\n return mixPaletteOklab(a, b, t);\n}";
|
|
411
|
-
//#endregion
|
|
412
|
-
export { w as a, E as c, d, c as f, j as i, D as l, l as m, O as n, C as o, u as p, A as r, T as s, k as t, S as u };
|
package/dist/compile-D7VYG3gi.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region src/composables/glass/webgl/compile.ts
|
|
2
|
-
function e(e, t, n, r = "[glass-ui:webgl]") {
|
|
3
|
-
let i = e.createShader(t);
|
|
4
|
-
if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
|
|
5
|
-
let t = e.getShaderInfoLog(i) ?? "unknown";
|
|
6
|
-
throw e.deleteShader(i), Error(`${r} shader compile failed:\n${t}`);
|
|
7
|
-
}
|
|
8
|
-
return i;
|
|
9
|
-
}
|
|
10
|
-
function t(e, t, n, r = "[glass-ui:webgl]") {
|
|
11
|
-
let i = e.createProgram();
|
|
12
|
-
if (e.attachShader(i, t), e.attachShader(i, n), e.linkProgram(i), !e.getProgramParameter(i, e.LINK_STATUS)) {
|
|
13
|
-
let t = e.getProgramInfoLog(i) ?? "unknown";
|
|
14
|
-
throw e.deleteProgram(i), Error(`${r} program link failed:\n${t}`);
|
|
15
|
-
}
|
|
16
|
-
return i;
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { t as n, e as t };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Ref } from "vue";
|
|
2
|
-
/**
|
|
3
|
-
* useDockOverflowFit resolves fits-vs-scrollable mode for the dock's native scroll
|
|
4
|
-
* track. It toggles `[data-dock-overflow]` on the dock root
|
|
5
|
-
* when content exceeds the horizontal full-layer port or vertical root scroll host.
|
|
6
|
-
* The overflow.css scroll track + FadingScroll edge mask engage ONLY under that attr, so
|
|
7
|
-
* at rest (fits) the mask is `none`.
|
|
8
|
-
*
|
|
9
|
-
* The measure is resize- and content-driven, with no scroll listener (a
|
|
10
|
-
* `ResizeObserver` on the dock + the port, plus a narrowly filtered `MutationObserver`
|
|
11
|
-
* on dock content). It never listens to `scroll` — the traveling indicator (`useSelectionIndicator`)
|
|
12
|
-
* lives inside the scroll port and travels WITH scroll in content coordinates, needing no
|
|
13
|
-
* scroll listener; this fit measure adds none either.
|
|
14
|
-
*
|
|
15
|
-
* The scroll port is discovered from the dock root (`.dock-layer--full`) so the composable
|
|
16
|
-
* needs only the dock element — no extra template ref threads through GlassDock.
|
|
17
|
-
*/
|
|
18
|
-
export declare function useDockOverflowFit(dockEl: Ref<HTMLElement | null>): {
|
|
19
|
-
measure: () => void;
|
|
20
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Ref } from "vue";
|
|
2
|
-
/**
|
|
3
|
-
* Own collapsed-pill tap/scroll discrimination and collapse-on-deactivate state.
|
|
4
|
-
* Morph scalars remain owned by the Dock orchestrator.
|
|
5
|
-
*
|
|
6
|
-
* The gate distinguishes a tap from vertical scrolling without preventing the
|
|
7
|
-
* browser's compatibility click. A single tap can expand the Dock and activate its
|
|
8
|
-
* control; a scroll cancels the pending tap. No hit-test lookup or synthetic
|
|
9
|
-
* dispatch is used. The same behavior applies to both orientations.
|
|
10
|
-
*/
|
|
11
|
-
export interface UseDockTouchGateOptions {
|
|
12
|
-
/** The dock's auto-collapse delay (ms) — the gate's deactivation timer. */
|
|
13
|
-
collapseDelay: number;
|
|
14
|
-
/** The dock body root — the tap discrimination anchors on it. */
|
|
15
|
-
rootEl: Ref<HTMLElement | null>;
|
|
16
|
-
/**
|
|
17
|
-
* True when every environmental writer is suppressed — an always-expanded dock
|
|
18
|
-
* (force-pinned) OR a manual dock (the consumer owns posture). The gate no-ops:
|
|
19
|
-
* no tap-to-expand, no collapse-on-deactivate. Without folding `manual` in here
|
|
20
|
-
* the gate would leak a `collapse()` on deactivate (in manual `isPinned` is
|
|
21
|
-
* false and `alwaysExpanded` is false, so the collapse guard would fire).
|
|
22
|
-
*/
|
|
23
|
-
quiet: Readonly<Ref<boolean>>;
|
|
24
|
-
/** The painted expand state (`alwaysExpanded || expanded`). */
|
|
25
|
-
visualExpanded: Readonly<Ref<boolean>>;
|
|
26
|
-
/** The raw expand ref (the collapse-on-deactivate guard reads it). */
|
|
27
|
-
expanded: Ref<boolean>;
|
|
28
|
-
/** True while a hold token keeps the dock open (suppresses the deactivate collapse). */
|
|
29
|
-
isPinned: Readonly<Ref<boolean>>;
|
|
30
|
-
/** Expand the dock (fired on a resolved tap). */
|
|
31
|
-
expand: () => void;
|
|
32
|
-
/** Collapse the dock (fired when the gate deactivates with no hold). */
|
|
33
|
-
collapse: () => void;
|
|
34
|
-
}
|
|
35
|
-
export interface UseDockTouchGateReturn {
|
|
36
|
-
onTouchStart(event: TouchEvent): void;
|
|
37
|
-
onTouchMove(event: TouchEvent): void;
|
|
38
|
-
onTouchEnd(): void;
|
|
39
|
-
/** Force the gate to rest (a collapse flip clears any pending tap). */
|
|
40
|
-
deactivate(): void;
|
|
41
|
-
}
|
|
42
|
-
export declare function useDockTouchGate(options: UseDockTouchGateOptions): UseDockTouchGateReturn;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer components{.glass-dock.dock-scroll-x:not(.dock-overflow-wrap) .dock-layer--full{min-width: 0;overflow-x: visible;overflow-y: visible;mask-image: none;}.glass-dock.dock-scroll-x[data-dock-overflow]:not(.dock-overflow-wrap) .dock-layer--full{overflow-x: auto;overflow-y: visible;padding: var(--dock-scroll-safe-inset);margin: calc(-1 * var(--dock-scroll-safe-inset));scroll-padding-inline: var(--dock-scroll-gutter);scrollbar-width: none;overscroll-behavior-x: contain;mask-image: linear-gradient( to right,transparent 0,black var(--fade-start,0px),black calc(100% - var(--fade-end,0px)),transparent 100% );animation: gl-fade-start-in linear both,gl-fade-end-out linear both;animation-timeline: scroll(self inline),scroll(self inline);animation-range: 0 var(--fade-scroll-width),calc(100% - var(--fade-scroll-width)) 100%;}.glass-dock.dock-scroll-x[data-dock-overflow]:not(.dock-overflow-wrap) .dock-layer--full::-webkit-scrollbar{display: none;}.glass-dock.dock-overflow-wrap{white-space: normal;max-inline-size: var(--dock-max-inline-size);padding: var(--dock-wrap-padding-block,var(--dock-padding-block,0.375rem)) var(--dock-wrap-padding-inline,0.625rem);border-radius: calc( var(--radius-pill) + (var(--dock-card-radius) - var(--radius-pill)) * var(--dock-expand-t) );--dock-wrap-elev: calc(var(--dock-expand-t) * 100%);box-shadow: var(--glass-edge-light),var(--shadow-dock-override,var(--shadow-dock)),0 8px 24px color-mix( in srgb,var(--shadow-color) calc(0.14 * var(--dock-wrap-elev)),transparent ),0 0 0 0.5px color-mix( in srgb,var(--shadow-color) calc(0.05 * var(--dock-wrap-elev)),transparent ),calc(8px * var(--glass-key-direction)) 8px 32px -4px color-mix( in srgb,oklch(0 0 0 / 0.12) var(--dock-wrap-elev),transparent );}.glass-dock.dock-overflow-wrap .dock-layer--full{flex-wrap: wrap;justify-content: center;height: auto;min-height: var(--dock-wrap-layer-min-height,var(--dock-layer-height,2rem));gap: var(--dock-wrap-row-gap,0.25rem) var(--dock-wrap-column-gap,var(--dock-layer-gap,0.375rem));}.glass-dock.dock-overflow-wrap .dock-layer--summary{height: auto;min-height: var(--dock-wrap-layer-min-height,var(--dock-layer-height,2rem));}.glass-dock.dock-overflow-wrap .dock-separator{display: none;}.glass-dock.dock-overflow-wrap.collapsed{white-space: nowrap;}@media (pointer: coarse){.glass-dock[data-size]{--dock-local-scale: var( --dock-mobile-scale,var(--dock-coarse-scale,0.78) );--dock-scale: calc(var(--ui-scale) * var(--dock-local-scale,1));--dock-control-floor: var(--dock-touch-target,2.75rem);--size-icon-btn: var(--dock-touch-target,2.75rem);--dock-icon-glyph: max( calc( var(--dock-layer-height,calc(2.5rem * var(--dock-scale))) * var(--dock-icon-glyph-ratio) ),var(--dock-icon-glyph-floor) );--dock-control-glyph-size: var(--dock-icon-glyph);--dock-collapsed-padding: calc(0.25rem * var(--dock-scale));--dock-layer-tab-size: calc(1.75rem * var(--dock-scale));--dock-collapsed-summary-min-size: calc( var(--dock-layer-height,2.5rem) * 0.85 );}}}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { WebGLCanvasFrame } from "../../../composables/glass/webgl/useWebGLCanvas.js";
|
|
2
|
-
import type { OklchStop } from "../../../composables/color/index.js";
|
|
3
|
-
import { type FourierFieldConfig } from "../constants.js";
|
|
4
|
-
import { type BasisComponent } from "../math.js";
|
|
5
|
-
export interface FourierGLSetupDeps {
|
|
6
|
-
canvas: HTMLCanvasElement;
|
|
7
|
-
config: FourierFieldConfig;
|
|
8
|
-
getSpectrum: () => readonly BasisComponent[];
|
|
9
|
-
getPalette: () => OklchStop[];
|
|
10
|
-
getHeadT: () => number;
|
|
11
|
-
shouldContinue: () => boolean;
|
|
12
|
-
onFrame?: (timeSec: number) => void;
|
|
13
|
-
/**
|
|
14
|
-
* B3 — the 2-D cursor FOLLOW (model-space center lean). Mirrors the
|
|
15
|
-
* WGSL arm exactly (both read the SAME uFit center) — parity-safe by construction.
|
|
16
|
-
* `{x:0,y:0}` (ambient/PRM) is byte-identical to today.
|
|
17
|
-
*/
|
|
18
|
-
getPointerLean?: () => {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/** Build the `setupGL(gl)` callback the `createGpuSubstrate` WebGL2 path invokes. */
|
|
24
|
-
export declare function createFourierGLSetup(deps: FourierGLSetupDeps): (gl: WebGL2RenderingContext) => WebGLCanvasFrame;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { WebGPUCanvasFrame } from "../../../composables/glass/webgpu/useWebGPUCanvas.js";
|
|
2
|
-
import type { OklchStop } from "../../../composables/color/index.js";
|
|
3
|
-
import { type FourierFieldConfig } from "../constants.js";
|
|
4
|
-
import type { BasisComponent } from "../math.js";
|
|
5
|
-
export interface FourierWGPUSetupDeps {
|
|
6
|
-
canvas: HTMLCanvasElement;
|
|
7
|
-
config: FourierFieldConfig;
|
|
8
|
-
/** The CPU-minted spectrum (re-read each frame so a source-swap reaches the buffer). */
|
|
9
|
-
getSpectrum: () => readonly BasisComponent[];
|
|
10
|
-
/** The resolved (ColorResolver) palette stops as OKLCh — re-read each frame so a live edit reaches the buffer. */
|
|
11
|
-
getPalette: () => OklchStop[];
|
|
12
|
-
/** The single loop parameter `head_t ∈ [0,1)` (the ONE keyframes.js clock). */
|
|
13
|
-
getHeadT: () => number;
|
|
14
|
-
/** Demand-gate (the renderer's quiescence layer — substrate-agnostic). */
|
|
15
|
-
shouldContinue: () => boolean;
|
|
16
|
-
/** The per-frame pointer hook — useFourierField advances the shared pointer field here. */
|
|
17
|
-
onFrame?: (timeSec: number) => void;
|
|
18
|
-
/**
|
|
19
|
-
* D6b — the 2-D cursor FOLLOW: a small MODEL-space offset added to
|
|
20
|
-
* the view-fit center so the whole reconstruction LEANS toward the cursor (the spatial
|
|
21
|
-
* "follow" beside D6a's velocity scrub). Reuses the EXISTING uFit center uniform (NO new
|
|
22
|
-
* uniform, NO shader/bridge edit — parity-safe by construction, both arms read the same
|
|
23
|
-
* fit). `{x:0,y:0}` (the ambient/PRM register) is byte-identical to today.
|
|
24
|
-
*/
|
|
25
|
-
getPointerLean?: () => {
|
|
26
|
-
x: number;
|
|
27
|
-
y: number;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/** Build the fourier-field `setupWGPU(device, context, format)` callback. */
|
|
31
|
-
export declare function createFourierWGPUSetup(deps: FourierWGPUSetupDeps): (device: GPUDevice, context: GPUCanvasContext, format: GPUTextureFormat) => WebGPUCanvasFrame;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { OklchStop } from "../../../composables/color/index.js";
|
|
2
|
-
import { type BasisComponent } from "../math.js";
|
|
3
|
-
/** One phasor lane in the storage buffer: (re, im, index, _pad). */
|
|
4
|
-
export declare const FOURIER_PHASOR_BYTES = 16;
|
|
5
|
-
export interface FourierUniformScratch {
|
|
6
|
-
buffer: ArrayBuffer;
|
|
7
|
-
f32: Float32Array;
|
|
8
|
-
i32: Int32Array;
|
|
9
|
-
}
|
|
10
|
-
export declare function createFourierComputeScratch(): FourierUniformScratch;
|
|
11
|
-
/** Pack the compute uniforms in place. */
|
|
12
|
-
export declare function packFourierComputeUniforms(scratch: FourierUniformScratch, headT: number, trailArc: number, harmonicN: number, epicycleArmN: number, sampleCount: number, phasorCount: number): FourierUniformScratch;
|
|
13
|
-
export declare function createFourierRenderScratch(): FourierUniformScratch;
|
|
14
|
-
/** The model→clip fit transform (center + uniform scale) — computed once per spectrum. */
|
|
15
|
-
export interface FourierFit {
|
|
16
|
-
centerX: number;
|
|
17
|
-
centerY: number;
|
|
18
|
-
/** The uniform scale s such that (model − center)·s maps the curve into clip [-1,1] with margin. */
|
|
19
|
-
scale: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Stable view-fit: sample the FULL reconstruction once over the period, bound its bbox,
|
|
23
|
-
* and derive the center + a margin-padded uniform scale. The render's fullscreen pass
|
|
24
|
-
* inverts this transform per fragment so the curve never clips and the scale is fixed.
|
|
25
|
-
*/
|
|
26
|
-
export declare function computeFourierFit(spectrum: readonly BasisComponent[]): FourierFit;
|
|
27
|
-
/**
|
|
28
|
-
* Convert a CSS-px stroke width to MODEL units (the shader's space). The fit `scale` maps
|
|
29
|
-
* model → clip; clip spans [-1,1] over the min CSS dimension → cssPx-per-clip = canvasCssMin/2.
|
|
30
|
-
* model-per-cssPx = (1/scale)·(2/canvasCssMin).
|
|
31
|
-
*/
|
|
32
|
-
export declare function trailWidthToModel(trailWidthPx: number, scale: number, canvasCssMin: number): number;
|
|
33
|
-
/** Pack the render uniforms in place. */
|
|
34
|
-
export declare function packFourierRenderUniforms(scratch: FourierUniformScratch, fit: FourierFit, aspect: number, trailWidthModel: number, peakAlpha: number, headGlowAlpha: number, trailFadeExp: number, trailFloor: number, intensity: number, showEpicycles: boolean, rainbowChain: boolean, squashGain: number, celGain: number, edgeMargin: number, sampleCount: number, armCount: number, palette: OklchStop[]): FourierUniformScratch;
|
|
35
|
-
/**
|
|
36
|
-
* Pack the phasor storage table (re, im, index, _pad) from the CPU-minted spectrum. The
|
|
37
|
-
* WGSL SUMS this per frame — it is the ONLY spectrum upload (no WGSL-side mint).
|
|
38
|
-
*/
|
|
39
|
-
export declare function packPhasorTable(spectrum: readonly BasisComponent[]): Float32Array;
|