@mkbabb/glass-ui 8.0.0 → 9.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/dist/aurora.js +371 -349
- package/dist/blob.js +42 -42
- package/dist/{checkbox-BnXuGgJ3.js → checkbox-B1qn65se.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/color.glsl-DTJhdekG.js +34 -0
- package/dist/color.wgsl-BTszLY39.js +398 -0
- package/dist/{command-BuBnYpxF.js → command-tEzAaVY_.js} +1 -1
- package/dist/command.js +1 -1
- package/dist/components/_shared/control.d.ts +0 -1
- package/dist/components/_shared/index.d.ts +0 -1
- package/dist/components/aurora/Aurora.vue.d.ts +1 -0
- package/dist/components/aurora/composables/frameLoop.d.ts +6 -5
- package/dist/components/aurora/composables/runtime.d.ts +26 -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 +44 -5
- package/dist/components/aurora/index.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/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/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 +28 -25
- package/dist/components/fourier-field/clock.d.ts +35 -0
- package/dist/components/fourier-field/constants.d.ts +78 -103
- 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/composables/dark/darkModeSyncScript.d.ts +19 -0
- 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/configurator-BHJymdrF.js +339 -0
- package/dist/configurator.js +1 -1
- package/dist/constellation.js +2 -2
- package/dist/control-DJp15L4U.js +7 -0
- package/dist/{dark-z_P5QwqI.js → dark-CLlmo7dD.js} +2 -2
- package/dist/dark-mode-toggle.js +1 -1
- package/dist/dark.js +1 -1
- package/dist/dock.js +712 -486
- package/dist/dom.js +90 -8
- package/dist/easing.js +3 -3
- package/dist/expandable-container-BY1hQXi4.js +142 -0
- package/dist/expandable-container.js +2 -142
- package/dist/fourier-field.js +643 -855
- package/dist/fourier-math.js +6 -6
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +85 -72
- package/dist/handmark.js +330 -718
- package/dist/index.d.ts +1 -1
- package/dist/labeled-field.js +2 -2
- package/dist/{menu-wLu1XGKn.js → menu-TDMNtZjG.js} +1 -1
- package/dist/menu.js +1 -1
- package/dist/motion-core.js +34 -34
- package/dist/{participation-B0hdsIRo.js → participation-Di4UHbzk.js} +8 -8
- package/dist/{pointerFieldMappings-DP5tla5z.js → pointerFieldMappings-DXwlU5uj.js} +7 -23
- package/dist/{popover-DBMKTPkL.js → popover-C04Rrdcz.js} +1 -1
- package/dist/popover.js +1 -1
- package/dist/{radio-group-Ci8o-pDx.js → radio-group-BNV7PN1O.js} +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{select-CDgwGH_P.js → select-COox45Kv.js} +1 -1
- package/dist/select.js +1 -1
- package/dist/{slider-gsc8jDIo.js → slider-5ChjjWSR.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/material.css +1 -1
- package/dist/styles/glass/overlay-plate.css +1 -1
- package/dist/{switch-DxZzDrmV.js → switch-lLkbREB-.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CYscnq5H.js → tabs-DSJMd1Et.js} +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{toggle-group-11aPGMfE.js → toggle-group-DUcmKnDw.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/{tooltip-DqKMZ4dn.js → tooltip-BKk2qVDn.js} +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{resolveCanvasColor-6MCrswTB.js → useCanvas2D-CQRElMyE.js} +1 -11
- package/dist/useResolveTokenColor-B2FfJnd9.js +24 -0
- package/package.json +2 -20
- 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/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
package/dist/blob.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as e } from "./useResolveTokenColor-
|
|
1
|
+
import { t as e } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
2
2
|
import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
3
|
import { t as n } from "./usePointerVelocityField-DsIf7yyq.js";
|
|
4
4
|
import { a as r, i, n as a, o, r as s, t as c } from "./presets-5myqNv59.js";
|
|
5
5
|
import { cssToOklch as l, oklchToGammaRgb as u } from "./color.js";
|
|
6
|
-
import {
|
|
7
|
-
import { a as y } from "./
|
|
8
|
-
import {
|
|
6
|
+
import { n as d, o as f, r as p, s as m, t as h, u as g } from "./color.glsl-DTJhdekG.js";
|
|
7
|
+
import { a as _, n as v, r as y, t as b } from "./color.wgsl-BTszLY39.js";
|
|
8
|
+
import { a as x } from "./rendererStatus-BxUlBLVy.js";
|
|
9
9
|
import { n as S, t as C } from "./prng-2uS6J_A1.js";
|
|
10
10
|
import { computed as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, defineComponent as O, inject as k, normalizeStyle as A, onScopeDispose as j, onUnmounted as M, openBlock as N, readonly as P, ref as F, shallowRef as I, useTemplateRef as L, watch as R } from "vue";
|
|
11
11
|
import { SpringProgress as z } from "@mkbabb/keyframes.js";
|
|
@@ -502,7 +502,7 @@ vec3 fbmWarpedG(vec2 p, int octaves, float warpAmp) {
|
|
|
502
502
|
return fbmG(p + warpAmp * (q - 0.5), octaves);
|
|
503
503
|
}
|
|
504
504
|
`, Oe = "// Edit #4's gamut step — hue-preserving inward chroma clamp. If the linear result\n// is out of [0,1], bisect chroma toward 0 (L + h fixed) until in gamut. Preserves\n// hue exactly (only C shrinks). 16 steps resolve C to < 2^-16 of its span.\nbool inGamut(vec3 lin) {\n return all(greaterThanEqual(lin, vec3(0.0))) && all(lessThanEqual(lin, vec3(1.0)));\n}\nvec3 gamutClampOklch(vec3 lch) {\n vec3 lin = oklabToLinearSrgb(oklchToOklab(lch));\n if (inGamut(lin)) return lch;\n float lo = 0.0;\n float hi = lch.y;\n for (int i = 0; i < 16; i++) {\n float mid = 0.5 * (lo + hi);\n vec3 test = vec3(lch.x, mid, lch.z);\n if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return vec3(lch.x, lo, lch.z);\n}", ke = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette — 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// The stripped-surface gate. 1.0 = the flat shadowless fill-only floor; 0.0 = the\n// dressed pipeline. It is derived from the single uMorphT surface scalar.\nuniform float uStage;\n\n// The blob-to-meatball shading-morph scalar. 0.0 = the flat blob\n// fill (byte-identical to the STAGE-1 floor), 1.0 = the fully-dressed lit meatball; the\n// in-between LERPS the surface shading (NOT the geometry — the smin field is shared). The\n// renderer clamps it from config.morphT. Animating 0 to 1 gets the live morph.\nuniform float uMorphT;\n\n// The pre-FBM bounding-discard radius in UV space. main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane — domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface — gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// The procedural 2D SDF soft-shadow march, the GLSL twin of\n// the WGSL res.z/res.w lanes). uShadow gates the IQ rmshadows soft contact shadow that\n// FOLLOWS the irregular silhouette; uShadowSoftness is the penumbra hardness (4-48).\nuniform float uShadow; // 0 = no shadow, 1 = the soft contact shadow ON\nuniform float uShadowSoftness; // penumbra hardness (inverse light-source size, 4-48)\n\n// Iridescence + fake subsurface — translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform — OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// The per-satellite explicit-shade seam widens the GL color contract for the hero blob.\n// uSatColorActive == 0 is the default (the derived\n// palette shade, UNCHANGED): blendSatColor() early-returns and touches\n// nothing. When a consumer supplies explicit per-satellite shades (uSatColor[i], GAMMA\n// sRGB, at uSatColorAmt[i] weight — typically 1) the fragment blends the base palette\n// OKLCh toward each satellite's shade, weighted by that satellite's smin-field proximity\n// at this pixel. The body keeps the derived base (the ask is per-SATELLITE).\nuniform int uSatColorActive;\nuniform vec3 uSatColor[MAX_SATS];\nuniform float uSatColorAmt[MAX_SATS];\n\n// Pointer trail — a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch.\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n", Ae = "\n", je = ke + Ae + we + `
|
|
505
|
-
${
|
|
505
|
+
${h}
|
|
506
506
|
|
|
507
507
|
` + De + Ae + Ce + `
|
|
508
508
|
|
|
@@ -514,12 +514,12 @@ ${d}
|
|
|
514
514
|
// ONCE so the OETF can never diverge from aurora's; the line-for-line TS port
|
|
515
515
|
// (__tests__/metaball-color.glsl-port.ts) mirrors that chunk. The gamut-clamp
|
|
516
516
|
// below stays blob-local (aurora has no in-shader OKLCh path).
|
|
517
|
-
${
|
|
518
|
-
${
|
|
517
|
+
${d}
|
|
518
|
+
${p}
|
|
519
519
|
|
|
520
520
|
` + Oe + "\n\n// De-synced breath. The body throb was a single sin(uPulsePhase), a\n// mechanical pulse that re-syncs every cycle. Three DETUNED sines at IRRATIONAL\n// frequency ratios (1, 0.13/0.09 ≈ 1.444, 0.31) never re-phase, so the membrane\n// breathes like a living creature (an asymmetric slower-exhale calm band) rather\n// than a metronome. Normalized so the composite stays in ~[-1, 1].\nfloat breath(float phase) {\n return (sin(phase)\n + 0.5 * sin(phase * 1.4444 + 1.7)\n + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n\n// The composite SDF field with its analytic gradient, returned as\n// vec3(dist, ∂d/∂x, ∂d/∂y). The domain-warped body membrane smin-merged with the\n// satellites + trail; the gradient propagates through sminG's mix(a.yz, b.yz, h)\n// so the surface normal reads the field gradient DIRECTLY (the 4-tap finite\n// difference is DELETED — its 4 full evals per lit pixel are gone).\n//\n// The ANISOTROPIC SQUASH (volume-preserving stretch) is a linear map\n// bodyUv = D·R·uv (R rotates world→(motion-axis, perp); D = diag(1/sa, sa)). The\n// body field's gradient is computed in bodyUv space, so it MUST be transformed back\n// to uv space by M^T = R^T·D (the inverse-transpose handling the SOTA-deepening [2]\n// warns the 4-tap did implicitly by sampling in screen space).\nvec3 sceneDistG(vec2 uv) {\n // De-synced pulsing body radius.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Velocity-driven, volume-preserving squash-and-stretch with saturated amplitude.\n // sa is the stretch along motion, exactly 1/sa perpendicular (area-preserving).\n // The basis (ax, perp) is captured so the gradient can be transformed back below.\n //\n // The form sa = 1 + speed*uStretch rode an UNBOUNDED critically-damped spring\n // velocity (O(5-8)/s on a fast flick) -> sa ~ 1.78-2.25x elongation, a violent\n // taffy-pull. A tanh saturation sa = 1 + tanh(speed*k)*uStretch caps the elongation\n // at 1 + uStretch (~1.5x at the default stretch 0.5) no matter how fast the flick —\n // the fastest flick reads as a lively bounce, never a rubber-band snap (the standard\n // volume-preserving squash-and-stretch restraint). k = 1.6 keeps the tanh in its\n // near-linear regime for a slow drag (the gentle squash still reads) and saturates\n // only the fast flick.\n vec2 bodyUv = uv;\n vec2 ax = vec2(1.0, 0.0);\n vec2 perp = vec2(0.0, 1.0);\n float sa = 1.0;\n float speed = length(uVelocity);\n bool squashed = uStretch > 0.0 && speed > 1e-4;\n if (squashed) {\n ax = uVelocity / speed;\n perp = vec2(-ax.y, ax.x);\n sa = 1.0 + tanh(speed * 1.6) * uStretch;\n bodyUv = vec2(dot(uv, ax) / sa, dot(uv, perp) * sa);\n }\n\n // Domain-warped FBM displacement WITH its analytic gradient (the warp-Jacobian\n // approximation per [2]). disp = (noiseVal - 0.5) · uNoiseAmp; its gradient in\n // bodyUv space is uNoiseAmp · uNoiseFreq · fbmGrad (the uNoiseFreq chain factor\n // from the bodyUv·uNoiseFreq argument).\n vec3 fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);\n float bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;\n vec2 dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;\n\n // Body circle WITH gradient (in bodyUv space). The displaced radius subtracts\n // the displacement, so the body gradient is circleGrad - dispGrad (sign per\n // [2]: d = circleDist - displacement ⇒ grad = circleGrad - dispGrad).\n vec3 bodyG = sdgCircle(bodyUv, vec2(0.0), bodyR + bodyDisplacement);\n vec2 bodyGradBody = bodyG.yz - dispGradBody;\n\n // Transform the body gradient back to uv space: g_uv = R^T · D · g_body, i.e.\n // scale by D = diag(1/sa, sa) in the (ax, perp) frame then reconstruct in world.\n vec2 bodyGradUv;\n if (squashed) {\n vec2 scaled = vec2(bodyGradBody.x / sa, bodyGradBody.y * sa);\n bodyGradUv = scaled.x * ax + scaled.y * perp;\n } else {\n bodyGradUv = bodyGradBody;\n }\n vec3 d = vec3(bodyG.x, bodyGradUv);\n\n // Satellites — smin-merged into the body (uMerge selects quadratic/circular).\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n vec3 satG = sdgCircle(uv, uSatPos[i], uSatRadius[i]);\n satG.x += (1.0 - uSatOpacity[i]) * 0.3;\n d = sminG(d, satG, uSmoothK);\n }\n\n // Pointer trail — a decaying-radius pseudopod reaching toward the cursor,\n // smin-merged so it stretches an elastic limb and snaps back.\n for (int i = 0; i < TRAIL_N; i++) {\n if (i >= uTrailCount) break;\n vec3 trailG = sdgCircle(uv, uTrailPos[i], uTrailRadius[i]);\n d = sminG(d, trailG, uSmoothK);\n }\n return d;\n}\n\n// The analytic surface normal. The field gradient grad2d arrives\n// DIRECTLY from sceneDistG (no 4-tap). The smin field is sub-unit (the CD family\n// |grad| ≤ 1) so the gradient is NOT unit-length — normalize() before the dome\n// lift (the unit contract is on the FINAL lifted normal N, not the raw field\n// gradient). The Z dome: 'interior' is the normalized depth inward from the rim\n// (-d/bodyR); z = sqrt(1 - (1 - interior)^2) is the unit half-sphere profile (flat\n// centre, steep rim). N tilts outward along the field gradient near the rim and\n// points at the viewer deep inside.\nvec3 surfaceNormalFromGrad(vec2 grad2d, float d, float bodyR) {\n vec2 g = normalize(grad2d + vec2(1e-6));\n float interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);\n float z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));\n return normalize(vec3(g * (1.0 - z), z) + vec3(0.0, 0.0, 1e-6));\n}\n\n// The 2D SDF soft-shadow march (IQ rmshadows improved penumbra,\n// research/viz/goo-blob.md §2.3, §5). The GLSL twin of the WGSL softShadow2D — a procedural\n// soft contact shadow FOLLOWING the irregular metaball silhouette (NOT a hard disc/box\n// shadow). Marches from ro along rd (the in-plane projection of uLightDir),\n// accumulating the closest miss via the Aaltonen penumbra (y = h*h/(2*ph) + d =\n// sqrt(h*h - y*y)) that kills the banding the naive res = min(res, h/(w*t)) shows. CHEAP:\n// 24 steps, re-uses the SAME sceneDistG().x field (NO separate field re-eval, NO FBO/\n// multi-pass — the procedural field needs none). w is the penumbra hardness (inverse\n// light-source size -> uShadowSoftness). Derivative-FREE. Returns 1.0 (lit) -> 0.0 (occluded).\nfloat softShadow2D(vec2 ro, vec2 rd, float mint, float maxt, float w) {\n float res = 1.0;\n float ph = 1e20;\n float t = mint;\n for (int i = 0; i < 24; i++) {\n if (t >= maxt) break;\n float h = sceneDistG(ro + rd * t).x;\n if (h < 0.001) return 0.0;\n float y = h * h / (2.0 * ph);\n float dd = sqrt(max(h * h - y * y, 0.0));\n res = min(res, dd / (w * max(0.001, t - y)));\n ph = h;\n t += h;\n }\n return clamp(res, 0.0, 1.0);\n}\n\n// Sample the multi-stop palette at t in [0,1], interpolating adjacent\n// stops in OKLab with a MIDPOINT CHROMA-BUMP (a linear OKLab mix of a vivid pair\n// dips chroma through grey; the bump lifts it back). Falls back to uBaseColor when\n// uStopCount <= 1. Returns an OKLCh stop [L, C, h(rad)].\nvec3 samplePaletteOklch(float t) {\n if (uStopCount <= 1) return oklabToOklch(srgbToOklab(uBaseColor));\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n // Fetch adjacent stops (uPalette is gamma sRGB) → OKLab.\n vec3 labA = srgbToOklab(uPalette[i0]);\n vec3 labB = srgbToOklab(uPalette[i1]);\n vec3 lab = mix(labA, labB, f);\n vec3 lch = oklabToOklch(lab);\n // Midpoint chroma-bump: a bell (peaks at f=0.5) lifts C off the grey midpoint.\n lch.y += 0.03 * sin(PI * f);\n return lch;\n}\n\n// The per-satellite explicit-shade blend widens the GL color contract for the hero blob.\n// It is off by default: uSatColorActive == 0 returns oklch\n// UNCHANGED (uniform control flow, zero cost). When ON, each\n// satellite carrying a positive uSatColorAmt tints the fragments in its smin-field\n// neighbourhood toward its explicit shade — mixed in OKLab (the samplePaletteOklch\n// convention; no hue wrap). The proximity weight rides the SAME opacity-inflated distance\n// the sceneDistG satellite term uses, so a fading satellite's tint fades with it. The\n// body keeps the derived palette base (no uBodyColor fork — the ask is per-SATELLITE).\nvec3 blendSatColor(vec3 oklch, vec2 uv) {\n if (uSatColorActive == 0) return oklch;\n vec3 lab = oklchToOklab(oklch);\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n float amt = clamp(uSatColorAmt[i], 0.0, 1.0);\n if (amt <= 0.0) continue;\n // Proximity: 1 well inside satellite i, fading to 0 across the smin band. The\n // opacity-inflated distance matches sceneDistG's satellite term.\n float di = sdCircle(uv, uSatPos[i], uSatRadius[i]) + (1.0 - uSatOpacity[i]) * 0.3;\n float w = (1.0 - smoothstep(-uSatRadius[i], uSmoothK, di)) * amt;\n lab = mix(lab, srgbToOklab(uSatColor[i]), clamp(w, 0.0, 1.0));\n }\n return oklabToOklch(lab);\n}\n\nvoid main() {\n vec2 uv = vUv - 0.5;\n\n // Pre-FBM bounding early-out. The oversized canvas (1.6x the\n // wrapper) runs the full fragment ALU — two 3-octave FBM evals + the OKLCh\n // round-trip + the lit/iridescence/SSS block — on a large transparent border\n // otherwise (~60% of the canvas is outside the droplet reach). Any fragment beyond\n // uMaxReach (the PADDED worst-case painted reach, uploaded so it never clips the\n // wet meniscus) writes transparent and returns BEFORE any of that work. This is a\n // transparent WRITE, NOT a GLSL discard: the pass is a pure premultiplied blend\n // with no depth, and discard disables the tiled-renderer fast path on mobile GPUs.\n // No fwidth is computed before the return, so there is no\n // derivative-in-non-uniform-control-flow hazard (the kept pixels compute their own\n // fwidth normally below). The pad covers the pointer-lean uv shift, so testing the\n // pre-deform uv is safe.\n if (dot(uv, uv) > uMaxReach * uMaxReach) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Pointer deformation — honor the SIGN of uPointerAttraction: a positive\n // attraction leans the body IN toward the cursor, a negative shies it AWAY. The\n // signed influence flows straight into the UV shift (no hardcoded repulsion).\n //\n // The sign was inverted in the rendered result. The\n // sample-shift sign here was uv -= dir*influence; the live readback (an attraction\n // sweep over a HELD pointer) measured the body shifting MORE toward the cursor as\n // attraction went MORE NEGATIVE (a=-1 -> +0.081, a=0 -> +0.063, a=+1 -> +0.042) —\n // exactly inverted: a shy-away -1 LUNGED at the cursor, a lean-in +1 pulled back.\n // pointerDir = uPointer - uv is the toward-pointer direction in SAMPLE space; to\n // MOVE the rendered body TOWARD the pointer the sample must shift ALONG pointerDir\n // (sample the field from where the pointer is), so the sign is uv += dir*influence.\n // A positive attraction now shifts the body toward the cursor (leans in), a negative\n // shifts it away (shies) — the sign the comment + the demo slider always promised,\n // now true in the render.\n //\n // The falloff radius narrows from 0.65 to 0.5 for a calmer lean.\n // The REDRESS widened it to 0.65 to clear a synthetic floor; the live π-lane\n // read the result as a LUNGE. The drama lives in the STRENGTH (pointerStrength,\n // dropped to 0.18 in types.ts), NOT the falloff — the falloff's job is purely to keep\n // the lean COHERENT across the creature so the body, satellites and trail all tilt\n // toward the cursor as ONE. At 0.5 the body (sitting ≈0.2 uv from the cursor on a\n // hover-flick) is still well inside the cutoff, so the whole creature tilts as one —\n // a gentle, coherent \"it notices you\" lean rather than the body lunging a body-width.\n if (uPointerActive > 0.5) {\n vec2 pointerDir = uPointer - uv;\n float pointerDist = length(pointerDir);\n float influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;\n uv += normalize(pointerDir + 1e-6) * influence;\n }\n\n // The de-synced pulsing body radius — also reused below for the inner-glow scale.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Composite domain-warped membrane field with its analytic gradient.\n vec3 scene = sceneDistG(uv);\n float d = scene.x;\n vec2 fieldGrad = scene.yz;\n\n // Edit #1 — fwidth-based anti-aliased edge: derive the smoothstep half-width\n // from the SDF screen-space gradient so the edge stays ~1px regardless of zoom.\n float aa = max(fwidth(d), 1e-6);\n float alpha = 1.0 - smoothstep(-aa, aa, d);\n\n if (alpha < 0.001) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Edit #4 — perceptually-uniform OKLCh variation. Gamma base → linear → OKLab\n // → OKLCh; perturb L/C/h; OKLCh → OKLab → linear; hue-preserving gamut clamp.\n // The base is the multi-stop palette sample — distributed across the\n // body/satellites by the color noise field — or uBaseColor when single-stop.\n float colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);\n vec3 oklch = samplePaletteOklch(colorNoise);\n // per-satellite explicit shade (default no-op at uSatColorActive == 0).\n oklch = blendSatColor(oklch, uv);\n\n oklch.z += (colorNoise - 0.5) * uHueRange * (PI / 180.0); // hue swing, radians\n oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0); // chroma swing\n oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0); // lightness bias\n\n // ── Blob-to-meatball shading morph (uMorphT) ────────────────────────────\n // The user #1 ask: the goo should MORPH BLOB and MEATBALL from one to another\n // with a continuous in-between, not a hard cut. The key fact: the body\n // GEOMETRY is IDENTICAL across blob/meatball (the smin SDF field, the satellites,\n // the fwidth-AA — all computed ABOVE, before this gate). ONLY the SURFACE shading\n // (flat fill vs lit/shadow/iridescence/SSS) differs. So the morph is a uMorphT\n // scalar LERPING the SHADING — NOT a geometry rebuild, NOT a path interpolation.\n //\n // uMorphT = 0 -> the flat warm-cream blob (the STAGE-1 floor);\n // uMorphT = 1 -> the lit meatball (the full STAGE-2 dressing);\n // 0 < uMorphT < 1 -> the CONTINUOUS in-between (the morph the user asked for).\n //\n // uMorphT is the single clamped config surface axis; a consumer ANIMATING\n // config.morphT 0..1 gets the live morph. The smin field is\n // byte-UNTOUCHED (the geometry is shared — that is the whole point).\n //\n // The flat color is computed ALWAYS (cheap); the EXPENSIVE dressing (the soft-shadow\n // secondary march) is gated uMorphT > 0.0 so a pure blob pays ZERO shadow-march\n // cost (the SLOW-fix discipline — a flat blob is as cheap as an early-return).\n float morphT = clamp(uMorphT, 0.0, 1.0);\n\n // STAGE-1 flat fill — the warm-cream blob color, off the PRE-dressing oklch (the\n // dressing mutates oklch below, so the flat read must snapshot it here).\n vec3 flatOkl = gamutClampOklch(oklch);\n vec3 flatLin = oklabToLinearSrgb(oklchToOklab(flatOkl));\n vec3 flatRgb = clamp(linearToSrgb(flatLin), 0.0, 1.0);\n\n // If we are fully flat (a pure blob, morphT == 0), emit the flat fill + dither and\n // return — the byte-identical STAGE-1 floor, zero dressing cost.\n if (morphT <= 0.0) {\n float ign1 = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n flatRgb = clamp(flatRgb + (ign1 - 0.5) / 255.0, 0.0, 1.0);\n fragColor = vec4(flatRgb * alpha, alpha);\n return;\n }\n\n // Surface normal from the analytic field gradient; the 4-tap is\n // deleted. Computed once here and reused by the iridescence, the\n // fake-SSS, and the lit glass block.\n vec3 N = surfaceNormalFromGrad(fieldGrad, d, bodyR);\n vec3 V = vec3(0.0, 0.0, 1.0);\n float thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0); // 0 at rim, ~1 deep in\n float fres = pow(1.0 - max(dot(N, V), 0.0), 2.5); // rim-weighted angle\n\n // ── iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──\n //\n // A thin-film-like sheen on the RIM (fres-weighted), NOT the cold-blue default:\n // an IQ cosine palette (a + b*cos(2pi(c*t + d))) maps the Fresnel/edge angle +\n // the FBM color field + an animated thickness onto a HUE OFFSET biased to the\n // warm arc (uIridHue), with the chroma clamped to a warm-pearl band so the rim\n // reads cream/gold (congruent with the warm-cream-glass identity). Mixed into\n // OKLCh BEFORE the gamut clamp. Default LOW.\n if (uIridescence > 0.0) {\n float t = fres + 0.3 * colorNoise + uTime * uIridSpeed;\n // Cosine palette in HUE space, centred on the warm uIridHue (~0.18 turn of\n // warm sweep so the sheen shimmers gold→peach, never swinging to cold blue).\n float iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);\n float w = fres * uIridescence; // rim-weighted blend\n oklch.z = mix(oklch.z, iridHue, w);\n // Warm-pearl chroma cap: lift chroma toward a pale-pearl band, clamped.\n oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);\n oklch.x = min(oklch.x + 0.05 * w, 1.0); // a touch brighter at the sheen\n }\n\n // ── fake subsurface translucency — thickness inner-glow + back-light ──\n //\n // A bright translucent CORE fading to a light-leaking EDGE (the -d ramp) plus\n // the fast-SSS back-light (light wrapping through the thin rim). Both lift OKLCh\n // L and warm the hue, consuming the normal. In OKLCh before the gamut clamp.\n if (uCoreGlow > 0.0 || uSssScale > 0.0) {\n // Beer-Lambert inner luminosity uses a saturating 1 - exp(-k·thickness)\n // curve — a flat thick core with a fast warm rim falloff — NOT the linear\n // coreGlow·thickness ramp (which over-brightens deep interiors). k ≈ 3 reads\n // as glass depth.\n oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);\n // Fast-SSS back-light: light wrapping through the thin (low-thickness) rim.\n vec3 L = normalize(uLightDir + vec3(1e-6));\n float back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);\n float sss = back * uSssScale * (1.0 - thickness);\n oklch.x = min(oklch.x + sss, 1.0);\n // Warm the THIN leaking rim only (scale by 1 - thickness): the SSS hue-warm\n // shift rides the rim, not the core; only the thin rim warms.\n oklch.z += sss * 0.1 * (1.0 - thickness);\n }\n\n // ── Soft contact shadow (the GLSL twin) ─────────────────────────────────\n // A procedural\n // soft shadow FOLLOWING the irregular silhouette: march from this fragment's uv\n // toward the in-plane projection of uLightDir; where the metaball field occludes the\n // light, DARKEN the OKLCh L — a soft grounded contact band under the dome\n // (PROCEDURAL, silhouette-following, unlike the static CSS gel-dome drop-shadow).\n // Rim-weighted (1 - thickness) so the lit interior stays bright. Gated uShadow > 0.5;\n // morphT=0 ships shadowless via the uStage early-return above. ──\n if (uShadow > 0.5) {\n vec2 L2 = normalize(uLightDir.xy + vec2(1e-6));\n float sh = softShadow2D(uv, L2, max(aa, 0.004), bodyR * 1.5, max(uShadowSoftness, 4.0));\n // The contact band sits on the LOWER rim (the side AWAY from the light), gated by\n // the away-facing rim weight + a thin-rim Gaussian band (peak thickness ≈ 0.18) so\n // the deep-lit interior + the light-facing edge stay BRIGHT (the warm-cream body\n // mean and floor hold). The 0.20 cap is a soft grounding.\n float away = clamp(-dot(normalize(fieldGrad + vec2(1e-6)), L2), 0.0, 1.0);\n float band = exp(-pow((thickness - 0.18) / 0.16, 2.0));\n float shadowDarken = (1.0 - sh) * away * band * 0.20;\n oklch.x = max(oklch.x - shadowDarken, 0.0);\n }\n\n oklch = gamutClampOklch(oklch);\n\n vec3 lin = oklabToLinearSrgb(oklchToOklab(oklch));\n\n // ── lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──\n //\n // The lit terms enter lin in LINEAR space BEFORE the OETF (linearToSrgb)\n // and BEFORE the * alpha premultiply — a post-OETF apply double-gammas the\n // highlight and fringes the premultiplied edge (the named A5/A2 trap). The\n // prior flat inner-glow lift is SUBSUMED by the Fresnel rim (the curvature\n // read now comes from the surface normal, not a flat smoothstep). Gated behind\n // uLit so the flat fill stays the default (zero regression).\n if (uLit > 0.5) {\n // N, V, thickness are already computed in main() (reused by iridescence/SSS).\n vec3 L = normalize(uLightDir + vec3(1e-6)); // light direction\n vec3 H = normalize(L + V); // Blinn-Phong half-vector\n\n // Warm-cream specular glint — a near-white OKLCh TINT (L~0.97, C~0.03,\n // hue~85°) routed through the SAME spliced OKLCh matrices, NOT hardcoded\n // sRGB white (pure white reads cheap-CG). Linearized for the linear add.\n vec3 warmCream = oklabToLinearSrgb(oklchToOklab(vec3(0.97, 0.03, radians(85.0))));\n\n // Energy-conserving Blinn-Phong: the (shininess+2)/8 factor\n // DECOUPLES shininess from strength (without it, raising shininess dims the\n // glint, so the two knobs fight). SPECULAR ANTIALIASING: the FBM membrane\n // makes the normal vary fast, so a tight glint (16-64) STROBES on small\n // dock-grid blobs. Widen the effective lobe where the normal varies\n // (Toksvig-style fwidth clamp) — drop shininess, NOT raise it. nVar reads\n // the screen-space normal derivative; a high-variance pixel softens the\n // exponent so the glint stays stable.\n float nVar = length(fwidth(N));\n float shininess = uSpecShininess / (1.0 + 24.0 * nVar);\n float energyNorm = (shininess + 2.0) / 8.0;\n float spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;\n\n // Fresnel/Schlick rim — fed uRimColor (the --foreground warm rim via the\n // /color leaf). Foreground-aware minimum-contrast guard:\n // a var(--primary) blob in dark mode resolves a rim near the BODY color, so\n // the rim washes out (no contrast). When the rim's luminance sits too close\n // to the body's, the guard CHROMA-REDUCES and L-LIFTS the rim stop (a\n // perceptual move, NOT a re-tint) so the curved rim always reads. Computed in\n // OKLCh so the lift is perceptual.\n vec3 rimOkl = oklabToOklch(srgbToOklab(uRimColor));\n float bodyL = oklch.x; // the post-perturb body lightness\n float dL = abs(rimOkl.x - bodyL);\n // If the rim is within 0.22 L of the body, push it AWAY (lift if the body is\n // dark, the dark-mode primary case; the chroma-reduce keeps it neutral-warm).\n float lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);\n rimOkl.x = clamp(mix(rimOkl.x, (bodyL < 0.5 ? 0.92 : 0.18), lack), 0.0, 1.0);\n rimOkl.y *= mix(1.0, 0.5, lack); // chroma-reduce toward a pale pearl\n vec3 rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));\n\n float rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);\n float rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);\n\n // Combine the two warm highlights and add in LINEAR. max(spec, rim*scale)\n // keeps the glint from stacking on the rim into a blown hotspot.\n //\n // Clamp the linear highlight below unity before the add (the\n // belt-and-braces guard the re-derived specStrength makes rarely-binding but\n // never lets a worst-case normal blow to a hard white spot). The energy-\n // conserving Blinn-Phong CAN still spike on a grazing normal where the Toksvig\n // widen has not kicked in; capping the highlight magnitude at 0.85 (a contained\n // warm gleam, sub-unity) means the OETF clamp below can never crush a\n // pure-white pixel over the dome. The cap is on the highlight ALONE (not the\n // composited lin), so the body color underneath is untouched — it caps only\n // the additive catch-light's energy.\n vec3 highlight = max(warmCream * spec, rimLin * rim);\n highlight = min(highlight, vec3(0.85));\n lin += highlight;\n }\n\n vec3 rgb = clamp(linearToSrgb(lin), 0.0, 1.0); // MANDATORY OETF — closes the seam\n\n // ── Compose the blob-to-meatball shading morph ─────────────────────────\n // rgb is the fully-dressed meatball surface; flatRgb (snapshotted before the\n // dressing) is the flat blob fill. The morph is a CONTINUOUS lerp between them on\n // morphT — at morphT==1 it is byte-identical to the dressed meatball, and the\n // morphT==0 case already returned the flat fill above. The geometry (alpha/silhouette)\n // is shared, so only the SURFACE shading interpolates (the morph from one to\n // another). The dither below applies to the composited result.\n rgb = mix(flatRgb, rgb, morphT);\n\n // IGN dither: the low-chroma warm-cream dome bands on 8-bit\n // panels (visible Mach steps in the smooth L roll). Interleaved-gradient noise at\n // 1/255, applied AFTER linearToSrgb and BEFORE the *alpha premultiply (aurora\n // ships the same splice). A triangular ±0.5 LSB dither decorrelates the steps.\n float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n rgb = clamp(rgb + (ign - 0.5) / 255.0, 0.0, 1.0);\n\n // Edit #8 — premultiply AFTER the OETF: straight-alpha gamma → premultiplied.\n fragColor = vec4(rgb * alpha, alpha);\n}", Me = "[GooBlob]";
|
|
521
521
|
function Ne(e) {
|
|
522
|
-
let t =
|
|
522
|
+
let t = f(e, e.VERTEX_SHADER, Se, Me), n = f(e, e.FRAGMENT_SHADER, je, Me), r = m(e, t, n, Me);
|
|
523
523
|
e.useProgram(r);
|
|
524
524
|
let i = e.createVertexArray();
|
|
525
525
|
e.bindVertexArray(i);
|
|
@@ -542,12 +542,12 @@ function Ne(e) {
|
|
|
542
542
|
e.enableVertexAttribArray(o), e.vertexAttribPointer(o, 2, e.FLOAT, !1, 0, 0);
|
|
543
543
|
let s = {};
|
|
544
544
|
for (let t of de) s[t] = e.getUniformLocation(r, t);
|
|
545
|
-
let c = [], l = [], u = [], d = [],
|
|
546
|
-
for (let t = 0; t < 4; t++) c.push(e.getUniformLocation(r, `uSatPos[${t}]`)), l.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), u.push(e.getUniformLocation(r, `uSatOpacity[${t}]`)), d.push(e.getUniformLocation(r, `uSatColor[${t}]`)),
|
|
547
|
-
let
|
|
548
|
-
for (let t = 0; t < 15; t++)
|
|
549
|
-
let
|
|
550
|
-
for (let t = 0; t < 4; t++)
|
|
545
|
+
let c = [], l = [], u = [], d = [], p = [];
|
|
546
|
+
for (let t = 0; t < 4; t++) c.push(e.getUniformLocation(r, `uSatPos[${t}]`)), l.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), u.push(e.getUniformLocation(r, `uSatOpacity[${t}]`)), d.push(e.getUniformLocation(r, `uSatColor[${t}]`)), p.push(e.getUniformLocation(r, `uSatColorAmt[${t}]`));
|
|
547
|
+
let h = [], g = [];
|
|
548
|
+
for (let t = 0; t < 15; t++) h.push(e.getUniformLocation(r, `uTrailPos[${t}]`)), g.push(e.getUniformLocation(r, `uTrailRadius[${t}]`));
|
|
549
|
+
let _ = [];
|
|
550
|
+
for (let t = 0; t < 4; t++) _.push(e.getUniformLocation(r, `uPalette[${t}]`));
|
|
551
551
|
return e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), {
|
|
552
552
|
prog: r,
|
|
553
553
|
vs: t,
|
|
@@ -560,10 +560,10 @@ function Ne(e) {
|
|
|
560
560
|
satRadLocs: l,
|
|
561
561
|
satOpLocs: u,
|
|
562
562
|
satColorLocs: d,
|
|
563
|
-
satColorAmtLocs:
|
|
564
|
-
trailPosLocs:
|
|
565
|
-
trailRadLocs:
|
|
566
|
-
paletteLocs:
|
|
563
|
+
satColorAmtLocs: p,
|
|
564
|
+
trailPosLocs: h,
|
|
565
|
+
trailRadLocs: g,
|
|
566
|
+
paletteLocs: _
|
|
567
567
|
}
|
|
568
568
|
};
|
|
569
569
|
}
|
|
@@ -686,7 +686,7 @@ struct Uniforms {
|
|
|
686
686
|
// below. NB: do NOT name the chunk with a template-interpolation form in a WGSL comment —
|
|
687
687
|
// it injects the whole multi-line chunk into this // comment line and breaks the parse
|
|
688
688
|
// at the first injected newline.
|
|
689
|
-
${
|
|
689
|
+
${b}
|
|
690
690
|
|
|
691
691
|
const FBM_LACUNARITY: f32 = 1.8;
|
|
692
692
|
const FBM_GAIN: f32 = 0.42;
|
|
@@ -808,8 +808,8 @@ fn sminG(a: vec3<f32>, b: vec3<f32>, k: f32) -> vec3<f32> {
|
|
|
808
808
|
return sminQuadraticG(a, b, k);
|
|
809
809
|
}
|
|
810
810
|
|
|
811
|
-
${
|
|
812
|
-
${
|
|
811
|
+
${v}
|
|
812
|
+
${y}
|
|
813
813
|
|
|
814
814
|
// OKLCh gamut clamp, palette sample, and breath from metaball-palette.wgsl,
|
|
815
815
|
// spliced AFTER the OKLCH_MATRICES_WGSL chunk above (its matrix source). NB: do NOT
|
|
@@ -1461,7 +1461,7 @@ function Ue(e) {
|
|
|
1461
1461
|
//#endregion
|
|
1462
1462
|
//#region src/components/blob/composables/useMetaballRenderer.ts
|
|
1463
1463
|
function We(e) {
|
|
1464
|
-
let { canvasRef: t, color: n, rimColor: r, paletteStops: i, satelliteColors: a, mood: o, pointer: s, satellites: c, config: l } = e, u = null, d = I(
|
|
1464
|
+
let { canvasRef: t, color: n, rimColor: r, paletteStops: i, satelliteColors: a, mood: o, pointer: s, satellites: c, config: l } = e, u = null, d = I(x("webgpu")), f = Ue({
|
|
1465
1465
|
color: n,
|
|
1466
1466
|
rimColor: r,
|
|
1467
1467
|
paletteStops: i,
|
|
@@ -1472,10 +1472,10 @@ function We(e) {
|
|
|
1472
1472
|
config: l,
|
|
1473
1473
|
getReducedMotion: () => u?.reducedMotion ?? !1,
|
|
1474
1474
|
wake: () => u?.wake()
|
|
1475
|
-
}),
|
|
1476
|
-
function
|
|
1477
|
-
u =
|
|
1478
|
-
dprPolicy:
|
|
1475
|
+
}), p = () => g() * (l.quality === "half" ? .5 : 1);
|
|
1476
|
+
function m(t) {
|
|
1477
|
+
u = _(t, {
|
|
1478
|
+
dprPolicy: p,
|
|
1479
1479
|
composeIntersectionPark: !0,
|
|
1480
1480
|
intersectionRootMargin: "200px",
|
|
1481
1481
|
revealBloom: e.revealBloom ?? !0,
|
|
@@ -1490,23 +1490,23 @@ function We(e) {
|
|
|
1490
1490
|
config: l,
|
|
1491
1491
|
pointer: s,
|
|
1492
1492
|
satellites: c,
|
|
1493
|
-
resolveFrame:
|
|
1494
|
-
shouldContinue:
|
|
1495
|
-
onResize:
|
|
1496
|
-
onDraw:
|
|
1493
|
+
resolveFrame: f.resolveFrame,
|
|
1494
|
+
shouldContinue: f.shouldContinue,
|
|
1495
|
+
onResize: f.recordBackingSize,
|
|
1496
|
+
onDraw: f.recordDraw
|
|
1497
1497
|
}),
|
|
1498
1498
|
setupGL: (e) => {
|
|
1499
1499
|
let { prog: n, vs: r, fs: i, vao: a, buf: o, locs: u } = Ne(e);
|
|
1500
1500
|
function d(t) {
|
|
1501
|
-
|
|
1501
|
+
f.recordBackingSize(t), e.viewport(0, 0, t.w, t.h);
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1504
|
-
let i =
|
|
1505
|
-
Fe(e, n, a, u, t, l, s, c, i),
|
|
1503
|
+
function p(r) {
|
|
1504
|
+
let i = f.resolveFrame(r);
|
|
1505
|
+
Fe(e, n, a, u, t, l, s, c, i), f.recordDraw(i);
|
|
1506
1506
|
}
|
|
1507
1507
|
return {
|
|
1508
|
-
frame:
|
|
1509
|
-
shouldContinue:
|
|
1508
|
+
frame: p,
|
|
1509
|
+
shouldContinue: f.shouldContinue,
|
|
1510
1510
|
resize: d,
|
|
1511
1511
|
teardown: () => {
|
|
1512
1512
|
e.deleteProgram(n), e.deleteShader(r), e.deleteShader(i), e.deleteBuffer(o), e.deleteVertexArray(a);
|
|
@@ -1517,19 +1517,19 @@ function We(e) {
|
|
|
1517
1517
|
}), u.armAsync().catch(() => void 0);
|
|
1518
1518
|
}
|
|
1519
1519
|
return R(t, (e) => {
|
|
1520
|
-
e && !u &&
|
|
1520
|
+
e && !u && m(e);
|
|
1521
1521
|
}, { immediate: !0 }), R(n, () => u?.wake()), R(r, () => u?.wake()), R(i, () => u?.wake(), { deep: !0 }), a && R(a, () => u?.wake(), { deep: !0 }), M(() => {
|
|
1522
|
-
|
|
1522
|
+
f.dispose(), u?.dispose(), u = null;
|
|
1523
1523
|
}), {
|
|
1524
1524
|
pause: () => {
|
|
1525
|
-
|
|
1525
|
+
f.pause(), u?.suspend("manual");
|
|
1526
1526
|
},
|
|
1527
1527
|
resume: () => {
|
|
1528
|
-
|
|
1528
|
+
f.resume(), u?.resume("manual");
|
|
1529
1529
|
},
|
|
1530
1530
|
wake: () => u?.wake(),
|
|
1531
|
-
settled:
|
|
1532
|
-
settledFrame:
|
|
1531
|
+
settled: f.settled,
|
|
1532
|
+
settledFrame: f.settledFrame,
|
|
1533
1533
|
rendererStatus: P(d)
|
|
1534
1534
|
};
|
|
1535
1535
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "./control-DJp15L4U.js";
|
|
2
2
|
import { computed as t, createBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, unref as l, withCtx as u } from "vue";
|
|
3
3
|
import { CheckboxIndicator as d, CheckboxRoot as f, useForwardPropsEmits as p } from "reka-ui";
|
|
4
4
|
import { Check as m, Minus as h } from "@lucide/vue";
|
package/dist/checkbox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./checkbox-
|
|
1
|
+
import { t as e } from "./checkbox-B1qn65se.js";
|
|
2
2
|
export { e as Checkbox };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function e(e, t, n) {
|
|
2
|
+
return Math.max(t, Math.min(n, e));
|
|
3
|
+
}
|
|
4
|
+
function t() {
|
|
5
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1;
|
|
6
|
+
return Math.min(e, 2);
|
|
7
|
+
}
|
|
8
|
+
function n() {
|
|
9
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1;
|
|
10
|
+
return Math.min(e, 1.5);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/composables/glass/webgl/compile.ts
|
|
14
|
+
function r(e, t, n, r = "[glass-ui:webgl]") {
|
|
15
|
+
let i = e.createShader(t);
|
|
16
|
+
if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
|
|
17
|
+
let t = e.getShaderInfoLog(i) ?? "unknown";
|
|
18
|
+
throw e.deleteShader(i), Error(`${r} shader compile failed:\n${t}`);
|
|
19
|
+
}
|
|
20
|
+
return i;
|
|
21
|
+
}
|
|
22
|
+
function i(e, t, n, r = "[glass-ui:webgl]") {
|
|
23
|
+
let i = e.createProgram();
|
|
24
|
+
if (e.attachShader(i, t), e.attachShader(i, n), e.linkProgram(i), !e.getProgramParameter(i, e.LINK_STATUS)) {
|
|
25
|
+
let t = e.getProgramInfoLog(i) ?? "unknown";
|
|
26
|
+
throw e.deleteProgram(i), Error(`${r} program link failed:\n${t}`);
|
|
27
|
+
}
|
|
28
|
+
return i;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/composables/glass/procedural/color.glsl.ts
|
|
32
|
+
var a = "\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}", o = "const mat2 FBM_ROT = mat2(0.8, 0.6, -0.6, 0.8);", s = "\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}", c = "\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}", l = "\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}";
|
|
33
|
+
//#endregion
|
|
34
|
+
export { l as a, e as c, c as i, n as l, a as n, r as o, s as r, i as s, o as t, t as u };
|