@spatial-elements/core 1.0.0-beta.11 → 1.0.0-beta.13
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/catalog/stagedDockGeometry.js +2 -2
- package/dist/catalog/stagedDockGeometry.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts +1 -2
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +13 -31
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/SpatialElementHeaderFields.d.ts +18 -0
- package/dist/spatial-element/SpatialElementHeaderFields.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementHeaderFields.js +100 -0
- package/dist/spatial-element/SpatialElementHeaderFields.js.map +1 -0
- package/dist/spatial-element/SpatialElementPaneController.d.ts +0 -1
- package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementPaneController.js +3 -7
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +1 -0
- package/dist/spatial-element/messages.d.ts.map +1 -1
- package/dist/spatial-element/messages.js +2 -1
- package/dist/spatial-element/messages.js.map +1 -1
- package/dist/spatial-element/spatialElementDock.d.ts +1 -1
- package/dist/spatial-element/spatialElementDock.js +1 -1
- package/dist/spatial-element/spatialElementDock.js.map +1 -1
- package/dist/stage/DetailWheelGesture.d.ts +9 -0
- package/dist/stage/DetailWheelGesture.d.ts.map +1 -0
- package/dist/stage/DetailWheelGesture.js +16 -0
- package/dist/stage/DetailWheelGesture.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +2 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +24 -17
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +1 -0
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +10 -4
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +18 -1
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +21 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +185 -16
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/SpatialElementPresentationController.js +4 -4
- package/dist/stage/SpatialElementPresentationController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +8 -0
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +37 -21
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +4 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +37 -3
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/browserPinch.d.ts +5 -0
- package/dist/stage/browserPinch.d.ts.map +1 -0
- package/dist/stage/browserPinch.js +29 -0
- package/dist/stage/browserPinch.js.map +1 -0
- package/dist/stage/minimap/MinimapModelGeometry.d.ts +2 -0
- package/dist/stage/minimap/MinimapModelGeometry.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapModelGeometry.js +28 -0
- package/dist/stage/minimap/MinimapModelGeometry.js.map +1 -1
- package/dist/stage/panelContext.d.ts +3 -1
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/panelFocusMath.d.ts +8 -0
- package/dist/stage/panelFocusMath.d.ts.map +1 -1
- package/dist/stage/panelFocusMath.js +12 -0
- package/dist/stage/panelFocusMath.js.map +1 -1
- package/dist/stage/spaceMousePermission.d.ts +2 -0
- package/dist/stage/spaceMousePermission.d.ts.map +1 -1
- package/dist/stage/spaceMousePermission.js +10 -4
- package/dist/stage/spaceMousePermission.js.map +1 -1
- package/dist/stage/spaceMousePlatform.d.ts +1 -1
- package/dist/stage/spaceMousePlatform.d.ts.map +1 -1
- package/dist/stage/spaceMousePlatform.js +7 -1
- package/dist/stage/spaceMousePlatform.js.map +1 -1
- package/dist/stage/stageMath.d.ts +2 -7
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +4 -9
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +1 -0
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +1 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ const DEFAULT_OPTIONS = {
|
|
|
8
8
|
width: 360,
|
|
9
9
|
height: 230,
|
|
10
10
|
radius: 42,
|
|
11
|
+
squareBottom: false,
|
|
11
12
|
position: { x: 0, y: 42 },
|
|
12
13
|
backdropBlur: 5,
|
|
13
14
|
refraction: 12,
|
|
@@ -34,6 +35,7 @@ export function resolveLiquidGlassPanelOptions(options = {}) {
|
|
|
34
35
|
...merged,
|
|
35
36
|
width,
|
|
36
37
|
height,
|
|
38
|
+
squareBottom: options.squareBottom === true,
|
|
37
39
|
radius: clampFinite(merged.radius, 0, Math.min(width, height) * 0.5, DEFAULT_OPTIONS.radius),
|
|
38
40
|
position: {
|
|
39
41
|
x: finiteOr(merged.position.x, DEFAULT_OPTIONS.position.x),
|
|
@@ -87,11 +89,11 @@ export class LiquidGlassPanel {
|
|
|
87
89
|
};
|
|
88
90
|
this.backdropProjection = createBackdropProjectionUniforms(this.options);
|
|
89
91
|
this.group.position.set(this.options.position.x, this.options.position.y, 0);
|
|
90
|
-
this.backdropGeometry = createRoundedGridGeometry(this.geometryOptions.width, this.geometryOptions.height, this.geometryOptions.radius, 128, 82);
|
|
91
|
-
this.bezelGeometry = createRoundedBandGeometry(this.geometryOptions.width, this.geometryOptions.height, this.geometryOptions.radius, -this.geometryOptions.bezel, 14, 1.7);
|
|
92
|
+
this.backdropGeometry = createRoundedGridGeometry(this.geometryOptions.width, this.geometryOptions.height, this.geometryOptions.radius, 128, 82, undefined, this.options.squareBottom);
|
|
93
|
+
this.bezelGeometry = createRoundedBandGeometry(this.geometryOptions.width, this.geometryOptions.height, this.geometryOptions.radius, -this.geometryOptions.bezel, 14, 1.7, this.options.squareBottom);
|
|
92
94
|
this.shadowLayers = PANEL_SHADOW_RECIPE.map((layer, index) => {
|
|
93
95
|
const shadowStrength = resolvePanelShadowStrength(this.options.shadowIntensity);
|
|
94
|
-
const geometry = createRoundedBandGeometry(this.geometryOptions.width, this.geometryOptions.height, this.geometryOptions.radius, layer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR, Math.max(8, Math.round(layer.blur)), 2.1);
|
|
96
|
+
const geometry = createRoundedBandGeometry(this.geometryOptions.width, this.geometryOptions.height, this.geometryOptions.radius, layer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR, Math.max(8, Math.round(layer.blur)), 2.1, this.options.squareBottom);
|
|
95
97
|
const material = createVertexAlphaMaterial(0x000000, shadowStrength * layer.alphaScale * WEBGPU_SHADOW_EDGE_COMPENSATION);
|
|
96
98
|
const mesh = new THREE.Mesh(geometry, material);
|
|
97
99
|
mesh.position.set(0, -layer.offsetY, 0);
|
|
@@ -172,11 +174,11 @@ export class LiquidGlassPanel {
|
|
|
172
174
|
this.backdropProjection.panelSize.value.set(nextWidth, nextHeight);
|
|
173
175
|
this.backdropProjection.radius.value = nextRadius;
|
|
174
176
|
this.backdropProjection.bezel.value = nextBezel;
|
|
175
|
-
createRoundedGridGeometry(nextWidth, nextHeight, nextRadius, 128, 82, this.backdropGeometry);
|
|
176
|
-
copyGeometry(this.bezelGeometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, -nextBezel, 14, 1.7));
|
|
177
|
+
createRoundedGridGeometry(nextWidth, nextHeight, nextRadius, 128, 82, this.backdropGeometry, this.options.squareBottom);
|
|
178
|
+
copyGeometry(this.bezelGeometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, -nextBezel, 14, 1.7, this.options.squareBottom));
|
|
177
179
|
this.shadowLayers.forEach(({ geometry }, index) => {
|
|
178
180
|
const layer = PANEL_SHADOW_RECIPE[index];
|
|
179
|
-
copyGeometry(geometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, layer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR, Math.max(8, Math.round(layer.blur)), 2.1));
|
|
181
|
+
copyGeometry(geometry, createRoundedBandGeometry(nextWidth, nextHeight, nextRadius, layer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR, Math.max(8, Math.round(layer.blur)), 2.1, this.options.squareBottom));
|
|
180
182
|
});
|
|
181
183
|
}
|
|
182
184
|
dispose() {
|
|
@@ -246,6 +248,7 @@ function createBackdropProjectionUniforms(options) {
|
|
|
246
248
|
uvScale: uniform(new THREE.Vector2(1, 1)),
|
|
247
249
|
panelSize: uniform(new THREE.Vector2(options.width, options.height)),
|
|
248
250
|
radius: uniform(options.radius),
|
|
251
|
+
squareBottom: uniform(options.squareBottom ? 1 : 0),
|
|
249
252
|
bezel: uniform(options.bezel),
|
|
250
253
|
refraction: uniform(options.refraction)
|
|
251
254
|
};
|
|
@@ -258,7 +261,8 @@ function createBackdropProjectionUniforms(options) {
|
|
|
258
261
|
function createBackdropUvNode(projection) {
|
|
259
262
|
const localPosition = positionLocal.xy;
|
|
260
263
|
const halfSize = projection.panelSize.mul(0.5);
|
|
261
|
-
const radius = tslMin(projection.radius, tslMin(halfSize.x, halfSize.y))
|
|
264
|
+
const radius = tslMin(projection.radius, tslMin(halfSize.x, halfSize.y))
|
|
265
|
+
.mul(oneMinus(projection.squareBottom.mul(oneMinus(step(0, localPosition.y)))));
|
|
262
266
|
const signedDistance = roundedRectSdfNode(localPosition, halfSize, radius);
|
|
263
267
|
const insideDistance = tslMax(signedDistance.negate(), 0);
|
|
264
268
|
const edge = oneMinus(smoothstep(0, tslMax(projection.bezel, 0.0001), insideDistance)).mul(step(0.0001, projection.bezel));
|
|
@@ -334,7 +338,7 @@ function createVertexAlphaMaterial(color, opacity, blending = THREE.NormalBlendi
|
|
|
334
338
|
return material;
|
|
335
339
|
}
|
|
336
340
|
const roundedGridVertices = new WeakMap();
|
|
337
|
-
function createRoundedGridGeometry(width, height, radius, columns, rows, geometry = new THREE.BufferGeometry()) {
|
|
341
|
+
function createRoundedGridGeometry(width, height, radius, columns, rows, geometry = new THREE.BufferGeometry(), squareBottom = false) {
|
|
338
342
|
const halfWidth = width * 0.5;
|
|
339
343
|
const halfHeight = height * 0.5;
|
|
340
344
|
const r = Math.min(radius, halfWidth, halfHeight);
|
|
@@ -365,9 +369,10 @@ function createRoundedGridGeometry(width, height, radius, columns, rows, geometr
|
|
|
365
369
|
return existing;
|
|
366
370
|
let x = -halfWidth + (gridX / columns) * width;
|
|
367
371
|
let y = -halfHeight + (gridY / rows) * height;
|
|
368
|
-
const
|
|
372
|
+
const cornerRadius = squareBottom && y < 0 ? 0 : r;
|
|
373
|
+
const distance = roundedRectSdf(x, y, halfWidth, halfHeight, cornerRadius);
|
|
369
374
|
if (distance > 0) {
|
|
370
|
-
const gradient = roundedRectGradient(x, y, halfWidth, halfHeight,
|
|
375
|
+
const gradient = roundedRectGradient(x, y, halfWidth, halfHeight, cornerRadius);
|
|
371
376
|
x -= gradient.x * distance;
|
|
372
377
|
y -= gradient.y * distance;
|
|
373
378
|
}
|
|
@@ -386,7 +391,8 @@ function createRoundedGridGeometry(width, height, radius, columns, rows, geometr
|
|
|
386
391
|
const y1 = -halfHeight + ((y + 1) / rows) * height;
|
|
387
392
|
const centerX = -halfWidth + ((x + 0.5) / columns) * width;
|
|
388
393
|
const centerY = -halfHeight + ((y + 0.5) / rows) * height;
|
|
389
|
-
const inside =
|
|
394
|
+
const inside = (squareBottom && centerY < 0) ||
|
|
395
|
+
roundedRectSdf(centerX, centerY, halfWidth, halfHeight, r) <= 0 ||
|
|
390
396
|
roundedRectSdf(x0, y0, halfWidth, halfHeight, r) <= 0 ||
|
|
391
397
|
roundedRectSdf(x1, y0, halfWidth, halfHeight, r) <= 0 ||
|
|
392
398
|
roundedRectSdf(x0, y1, halfWidth, halfHeight, r) <= 0 ||
|
|
@@ -415,7 +421,7 @@ function createRoundedGridGeometry(width, height, radius, columns, rows, geometr
|
|
|
415
421
|
geometry.computeBoundingSphere();
|
|
416
422
|
return geometry;
|
|
417
423
|
}
|
|
418
|
-
function createRoundedBandGeometry(width, height, radius, spread, rings, alphaPower) {
|
|
424
|
+
function createRoundedBandGeometry(width, height, radius, spread, rings, alphaPower, squareBottom = false) {
|
|
419
425
|
const positions = [];
|
|
420
426
|
const colors = [];
|
|
421
427
|
const indices = [];
|
|
@@ -427,7 +433,7 @@ function createRoundedBandGeometry(width, height, radius, spread, rings, alphaPo
|
|
|
427
433
|
const ringHeight = Math.max(1, height + offset * 2);
|
|
428
434
|
const ringRadius = Math.max(0, Math.min(radius + offset, ringWidth * 0.5, ringHeight * 0.5));
|
|
429
435
|
const alpha = Math.pow(1 - t, alphaPower);
|
|
430
|
-
const points = createRoundedRectPoints(ringWidth, ringHeight, ringRadius, pointsPerRing / 4);
|
|
436
|
+
const points = createRoundedRectPoints(ringWidth, ringHeight, ringRadius, pointsPerRing / 4, squareBottom);
|
|
431
437
|
points.forEach(({ x, y }) => {
|
|
432
438
|
positions.push(x, y, 0);
|
|
433
439
|
colors.push(1, 1, 1, alpha);
|
|
@@ -451,7 +457,7 @@ function createRoundedBandGeometry(width, height, radius, spread, rings, alphaPo
|
|
|
451
457
|
geometry.computeVertexNormals();
|
|
452
458
|
return geometry;
|
|
453
459
|
}
|
|
454
|
-
function createRoundedRectPoints(width, height, radius, segmentsPerCorner) {
|
|
460
|
+
function createRoundedRectPoints(width, height, radius, segmentsPerCorner, squareBottom = false) {
|
|
455
461
|
const halfWidth = width * 0.5;
|
|
456
462
|
const halfHeight = height * 0.5;
|
|
457
463
|
const r = Math.min(radius, halfWidth, halfHeight);
|
|
@@ -462,13 +468,14 @@ function createRoundedRectPoints(width, height, radius, segmentsPerCorner) {
|
|
|
462
468
|
{ x: -halfWidth + r, y: halfHeight - r, start: Math.PI, end: Math.PI * 0.5 }
|
|
463
469
|
];
|
|
464
470
|
const points = [];
|
|
465
|
-
corners.forEach((corner) => {
|
|
471
|
+
corners.forEach((corner, index) => {
|
|
472
|
+
const square = squareBottom && (index === 1 || index === 2);
|
|
466
473
|
for (let step = 0; step < segmentsPerCorner; step += 1) {
|
|
467
474
|
const t = step / segmentsPerCorner;
|
|
468
475
|
const angle = THREE.MathUtils.lerp(corner.start, corner.end, t);
|
|
469
476
|
points.push({
|
|
470
|
-
x: corner.x + Math.cos(angle) * r,
|
|
471
|
-
y: corner.y + Math.sin(angle) * r
|
|
477
|
+
x: square ? (index === 1 ? halfWidth : -halfWidth) : corner.x + Math.cos(angle) * r,
|
|
478
|
+
y: square ? -halfHeight : corner.y + Math.sin(angle) * r
|
|
472
479
|
});
|
|
473
480
|
}
|
|
474
481
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiquidGlassPanel.js","sourceRoot":"","sources":["../../src/stage/LiquidGlassPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EACN,GAAG,EACH,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,GAAG,IAAI,MAAM,EACb,GAAG,IAAI,MAAM,EACb,GAAG,EACH,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,MAAM,WAAW,CAAC;AAGnB,OAAO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AK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAC9F,CAAC;AAED,SAAS,mBAAmB,CAC3B,CAAS,EACT,CAAS,EACT,SAAiB,EACjB,UAAkB,EAClB,MAAc;IAEd,MAAM,GAAG,GAAG,GAAG,CAAC;IAChB,MAAM,EAAE,GACP,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC;QACzD,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,EAAE,GACP,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC;QACzD,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport {\n\tabs,\n\tacesFilmicToneMapping,\n\tcameraProjectionMatrix,\n\tcameraViewMatrix,\n\tclamp,\n\tcolor,\n\tfloat,\n\tinverse,\n\tlength,\n\tmat3,\n\tmax as tslMax,\n\tmin as tslMin,\n\tmix,\n\tmodelWorldMatrix,\n\toneMinus,\n\tpositionLocal,\n\tsqrt,\n\tsRGBTransferEOTF,\n\tsRGBTransferOETF,\n\tsmoothstep,\n\tstep,\n\ttexture,\n\tuniform,\n\tvarying,\n\tvec2,\n\tvec4\n} from 'three/tsl';\nimport type { ColorRepresentation } from 'three';\nimport type { Node } from 'three/webgpu';\nimport { PANEL_SHADOW_RECIPE, resolvePanelShadowStrength } from './panelShadow.js';\n\n/** A CSS Gaussian shadow reaches roughly half its declared alpha at an unspread edge. */\nconst WEBGPU_SHADOW_EDGE_COMPENSATION = 0.5;\nconst WEBGPU_SHADOW_EXTENT_PER_BLUR = 1.5;\n\nexport interface LiquidGlassPanelOptions {\n\twidth?: number;\n\theight?: number;\n\tradius?: number;\n\tposition?: { x: number; y: number };\n\t/** Blur radius of the sampled stage backdrop, in CSS pixels. */\n\tbackdropBlur?: number;\n\t/** Maximum displacement of the sampled backdrop near the glass edge, in CSS pixels. */\n\trefraction?: number;\n\ttint?: ColorRepresentation;\n\t/** Direct opacity of the tint over the sampled backdrop, from zero to one. */\n\ttintOpacity?: number;\n\t/** Width of the refractive/specular edge, in CSS pixels. */\n\tbezel?: number;\n\t/** Optical edge weight, from zero (flat) to one (thick glass). */\n\tthickness?: number;\n\tspecularOpacity?: number;\n\t/** Normalized strength of the panel shadow, from zero to one. */\n\tshadowIntensity?: number;\n\topacity?: number;\n}\n\nconst DEFAULT_OPTIONS = {\n\twidth: 360,\n\theight: 230,\n\tradius: 42,\n\tposition: { x: 0, y: 42 },\n\tbackdropBlur: 5,\n\trefraction: 12,\n\ttint: 0xffffff,\n\ttintOpacity: 0.28,\n\tbezel: 18,\n\tthickness: 0.35,\n\tspecularOpacity: 0.18,\n\tshadowIntensity: 0.28,\n\topacity: 1\n} satisfies Required<LiquidGlassPanelOptions>;\n\n/** Exposure shared by the stage renderer and CSS-color compensation for panel tints. */\nexport const STAGE_TONE_MAPPING_EXPOSURE = 1.15;\n\n/** Applies stable defaults and keeps public visual controls inside their documented ranges. */\nexport function resolveLiquidGlassPanelOptions(\n\toptions: LiquidGlassPanelOptions = {}\n): Required<LiquidGlassPanelOptions> {\n\tconst merged = {\n\t\t...DEFAULT_OPTIONS,\n\t\t...options,\n\t\tposition: { ...DEFAULT_OPTIONS.position, ...options.position }\n\t};\n\tconst width = clampFinite(merged.width, 1, Number.MAX_SAFE_INTEGER, DEFAULT_OPTIONS.width);\n\tconst height = clampFinite(merged.height, 1, Number.MAX_SAFE_INTEGER, DEFAULT_OPTIONS.height);\n\n\treturn {\n\t\t...merged,\n\t\twidth,\n\t\theight,\n\t\tradius: clampFinite(merged.radius, 0, Math.min(width, height) * 0.5, DEFAULT_OPTIONS.radius),\n\t\tposition: {\n\t\t\tx: finiteOr(merged.position.x, DEFAULT_OPTIONS.position.x),\n\t\t\ty: finiteOr(merged.position.y, DEFAULT_OPTIONS.position.y)\n\t\t},\n\t\tbackdropBlur: clampFinite(merged.backdropBlur, 0, 100, DEFAULT_OPTIONS.backdropBlur),\n\t\trefraction: clampFinite(merged.refraction, 0, 100, DEFAULT_OPTIONS.refraction),\n\t\ttintOpacity: clampFinite(merged.tintOpacity, 0, 1, DEFAULT_OPTIONS.tintOpacity),\n\t\tbezel: clampFinite(merged.bezel, 0, Math.min(width, height) * 0.5, DEFAULT_OPTIONS.bezel),\n\t\tthickness: clampFinite(merged.thickness, 0, 1, DEFAULT_OPTIONS.thickness),\n\t\tspecularOpacity: clampFinite(merged.specularOpacity, 0, 1, DEFAULT_OPTIONS.specularOpacity),\n\t\tshadowIntensity: clampFinite(merged.shadowIntensity, 0, 1, DEFAULT_OPTIONS.shadowIntensity),\n\t\topacity: clampFinite(merged.opacity, 0, 1, DEFAULT_OPTIONS.opacity)\n\t};\n}\n\nfunction finiteOr(value: number, fallback: number) {\n\treturn Number.isFinite(value) ? value : fallback;\n}\n\nfunction clampFinite(value: number, min: number, max: number, fallback: number) {\n\treturn THREE.MathUtils.clamp(finiteOr(value, fallback), min, max);\n}\n\nexport class LiquidGlassPanel {\n\t/** Preserve full-backdrop coordinates while a cropped camera captures this surface. */\n\tsetBackdropUvTransform(x: number, y: number, width: number, height: number) {\n\t\tthis.backdropProjection.uvOffset.value.set(x, y);\n\t\tthis.backdropProjection.uvScale.value.set(width, height);\n\t}\n\treadonly group = new THREE.Group();\n\treadonly options: Required<LiquidGlassPanelOptions>;\n\n\tprivate readonly geometryOptions: Required<LiquidGlassPanelOptions>;\n\tprivate readonly authoredBezel: number;\n\tprivate readonly authoredRadius: number;\n\tprivate readonly backdropGeometry: THREE.BufferGeometry;\n\tprivate readonly bezelGeometry: THREE.BufferGeometry;\n\tprivate readonly shadowLayers: {\n\t\tgeometry: THREE.BufferGeometry;\n\t\tmaterial: THREE.MeshBasicMaterial;\n\t\tmesh: THREE.Mesh;\n\t\talphaScale: number;\n\t}[];\n\tprivate readonly backdropMaterial: THREE.MeshBasicNodeMaterial;\n\tprivate readonly backdropTextureNode: ReturnType<typeof texture>;\n\tprivate readonly depthMaterial: THREE.MeshBasicMaterial;\n\tprivate readonly sheenMaterial: THREE.MeshBasicMaterial;\n\tprivate readonly backdropProjection: ReturnType<typeof createBackdropProjectionUniforms>;\n\tprivate readonly ownedRenderGraph: () => boolean;\n\n\tconstructor(backdropTexture: THREE.Texture, options: LiquidGlassPanelOptions = {}) {\n\t\tthis.options = resolveLiquidGlassPanelOptions(options);\n\t\t// Hidden native popovers initially measure 1px. Keep the authored optical\n\t\t// dimensions so opening/resizing does not permanently flatten their glass edge.\n\t\tthis.authoredBezel = Math.max(0, finiteOr(options.bezel ?? DEFAULT_OPTIONS.bezel, DEFAULT_OPTIONS.bezel));\n\t\tthis.authoredRadius = Math.max(0, finiteOr(options.radius ?? DEFAULT_OPTIONS.radius, DEFAULT_OPTIONS.radius));\n\t\tthis.geometryOptions = {\n\t\t\t...this.options,\n\t\t\tposition: { ...this.options.position }\n\t\t};\n\t\tthis.backdropProjection = createBackdropProjectionUniforms(this.options);\n\n\t\tthis.group.position.set(this.options.position.x, this.options.position.y, 0);\n\t\tthis.backdropGeometry = createRoundedGridGeometry(\n\t\t\tthis.geometryOptions.width,\n\t\t\tthis.geometryOptions.height,\n\t\t\tthis.geometryOptions.radius,\n\t\t\t128,\n\t\t\t82\n\t\t);\n\t\tthis.bezelGeometry = createRoundedBandGeometry(\n\t\t\tthis.geometryOptions.width,\n\t\t\tthis.geometryOptions.height,\n\t\t\tthis.geometryOptions.radius,\n\t\t\t-this.geometryOptions.bezel,\n\t\t\t14,\n\t\t\t1.7\n\t\t);\n\t\tthis.shadowLayers = PANEL_SHADOW_RECIPE.map((layer, index) => {\n\t\t\tconst shadowStrength = resolvePanelShadowStrength(this.options.shadowIntensity);\n\t\t\tconst geometry = createRoundedBandGeometry(\n\t\t\t\tthis.geometryOptions.width,\n\t\t\t\tthis.geometryOptions.height,\n\t\t\t\tthis.geometryOptions.radius,\n\t\t\t\tlayer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR,\n\t\t\t\tMath.max(8, Math.round(layer.blur)),\n\t\t\t\t2.1\n\t\t\t);\n\t\t\tconst material = createVertexAlphaMaterial(\n\t\t\t\t0x000000,\n\t\t\t\tshadowStrength * layer.alphaScale * WEBGPU_SHADOW_EDGE_COMPENSATION\n\t\t\t);\n\t\t\tconst mesh = new THREE.Mesh(geometry, material);\n\t\t\tmesh.position.set(0, -layer.offsetY, 0);\n\t\t\tmesh.renderOrder = PANEL_SHADOW_RECIPE.length - index;\n\t\t\treturn { geometry, material, mesh, alphaScale: layer.alphaScale };\n\t\t});\n\t\tthis.depthMaterial = createVertexAlphaMaterial(\n\t\t\tgetDepthColor(this.options.tint),\n\t\t\tgetDepthOpacity(this.options.thickness)\n\t\t);\n\t\tthis.sheenMaterial = createVertexAlphaMaterial(\n\t\t\tgetSpecularColor(this.options.tint, this.options.tintOpacity),\n\t\t\tthis.options.specularOpacity,\n\t\t\tTHREE.AdditiveBlending\n\t\t);\n\t\tconst backdropShader = createBackdropMaterial(\n\t\t\tbackdropTexture,\n\t\t\tthis.options.tint,\n\t\t\tthis.options.tintOpacity,\n\t\t\tthis.backdropProjection\n\t\t);\n\t\tthis.backdropMaterial = backdropShader.material;\n\t\tthis.backdropTextureNode = backdropShader.textureNode;\n\n\t\tconst backdrop = new THREE.Mesh(this.backdropGeometry, this.backdropMaterial);\n\t\tbackdrop.position.z = 0;\n\t\tbackdrop.renderOrder = 3;\n\n\t\tconst depthTint = new THREE.Mesh(this.bezelGeometry, this.depthMaterial);\n\t\tdepthTint.position.z = 0;\n\t\tdepthTint.renderOrder = 4;\n\n\t\tconst sheen = new THREE.Mesh(this.bezelGeometry, this.sheenMaterial);\n\t\tsheen.position.z = 0;\n\t\tsheen.renderOrder = 6;\n\n\t\tthis.group.add(...this.shadowLayers.map(({ mesh }) => mesh), backdrop, depthTint, sheen);\n\t\tthis.setVisibilityAlpha(1);\n\t\t// Capture only our final constructor-owned graph. Public group customizations\n\t\t// remain supported by normal rendering, but conservatively reject reuse of\n\t\t// completed Full preparation for the inactive Scroll warmup.\n\t\tconst nodes: { node: THREE.Object3D; children: THREE.Object3D[]; before: THREE.Object3D['onBeforeRender']; after: THREE.Object3D['onAfterRender'] }[] = [];\n\t\tconst materials: { mesh: THREE.Mesh; material: THREE.Material; version: number;\n\t\t\tbefore: THREE.Material['onBeforeRender']; compile: THREE.Material['onBeforeCompile']; roots: [string, unknown][] }[] = [];\n\t\tthis.group.traverse(node => {\n\t\t\tnodes.push({ node, children: [...node.children], before: node.onBeforeRender, after: node.onAfterRender });\n\t\t\tif (!(node instanceof THREE.Mesh)) return;\n\t\t\tconst material = node.material as THREE.Material;\n\t\t\tconst values = material as unknown as Record<string, unknown>;\n\t\t\tmaterials.push({ mesh: node, material, version: material.version, before: material.onBeforeRender,\n\t\t\t\tcompile: material.onBeforeCompile, roots: Object.keys(values).filter(key => key.endsWith('Node')).map(key => [key, values[key]]) });\n\t\t});\n\t\tthis.ownedRenderGraph = () => nodes.every(({ node, children, before, after }) =>\n\t\t\tnode.onBeforeRender === before && node.onAfterRender === after && node.children.length === children.length &&\n\t\t\tchildren.every((child, i) => node.children[i] === child)) &&\n\t\t\tmaterials.every(({ mesh, material, version, before, compile, roots }) => mesh.material === material &&\n\t\t\t\tmaterial.version === version && material.onBeforeRender === before && material.onBeforeCompile === compile &&\n\t\t\t\troots.every(([key, value]) => (material as unknown as Record<string, unknown>)[key] === value));\n\t}\n\n\t/** Internal warmup eligibility; normal rendering still accepts customized groups. */\n\thasOwnedRenderGraph() { return this.ownedRenderGraph(); }\n\n\tsetVisibilityAlpha(alpha: number) {\n\t\tconst scale = THREE.MathUtils.clamp(alpha * this.options.opacity, 0, 1);\n\t\tthis.group.visible = scale > 0.01;\n\t\tthis.backdropMaterial.opacity = scale;\n\t\tthis.depthMaterial.opacity = getDepthOpacity(this.options.thickness) * scale;\n\t\tthis.sheenMaterial.opacity = this.options.specularOpacity * scale;\n\t\tthis.shadowLayers.forEach(({ material, alphaScale }) => {\n\t\t\tmaterial.opacity =\n\t\t\t\tresolvePanelShadowStrength(this.options.shadowIntensity) *\n\t\t\t\talphaScale *\n\t\t\t\tWEBGPU_SHADOW_EDGE_COMPENSATION *\n\t\t\t\tscale;\n\t\t});\n\t}\n\n\tsetBackdropTexture(backdropTexture: THREE.Texture) {\n\t\tif (this.backdropTextureNode.value === backdropTexture) return;\n\t\tthis.backdropTextureNode.value = backdropTexture;\n\t}\n\n\tsetVisualSize(width: number, height: number, radius = this.authoredRadius) {\n\t\tconst nextWidth = Math.max(width, 1);\n\t\tconst nextHeight = Math.max(height, 1);\n\t\tconst nextRadius = Math.min(Math.max(radius, 0), nextWidth * 0.5, nextHeight * 0.5);\n\t\tconst nextBezel = Math.min(this.authoredBezel, nextWidth * 0.5, nextHeight * 0.5);\n\n\t\tif (\n\t\t\tMath.abs(this.geometryOptions.width - nextWidth) < 0.01 &&\n\t\t\tMath.abs(this.geometryOptions.height - nextHeight) < 0.01 &&\n\t\t\tMath.abs(this.geometryOptions.radius - nextRadius) < 0.01\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.geometryOptions.width = nextWidth;\n\t\tthis.geometryOptions.height = nextHeight;\n\t\tthis.geometryOptions.radius = nextRadius;\n\t\tthis.geometryOptions.bezel = nextBezel;\n\t\tthis.backdropProjection.panelSize.value.set(nextWidth, nextHeight);\n\t\tthis.backdropProjection.radius.value = nextRadius;\n\t\tthis.backdropProjection.bezel.value = nextBezel;\n\t\tcreateRoundedGridGeometry(nextWidth, nextHeight, nextRadius, 128, 82, this.backdropGeometry);\n\t\tcopyGeometry(\n\t\t\tthis.bezelGeometry,\n\t\t\tcreateRoundedBandGeometry(nextWidth, nextHeight, nextRadius, -nextBezel, 14, 1.7)\n\t\t);\n\t\tthis.shadowLayers.forEach(({ geometry }, index) => {\n\t\t\tconst layer = PANEL_SHADOW_RECIPE[index];\n\t\t\tcopyGeometry(\n\t\t\t\tgeometry,\n\t\t\t\tcreateRoundedBandGeometry(\n\t\t\t\t\tnextWidth,\n\t\t\t\t\tnextHeight,\n\t\t\t\t\tnextRadius,\n\t\t\t\t\tlayer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR,\n\t\t\t\t\tMath.max(8, Math.round(layer.blur)),\n\t\t\t\t\t2.1\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\t}\n\n\tdispose() {\n\t\tthis.backdropGeometry.dispose();\n\t\tthis.bezelGeometry.dispose();\n\t\tthis.shadowLayers.forEach(({ geometry, material }) => {\n\t\t\tgeometry.dispose();\n\t\t\tmaterial.dispose();\n\t\t});\n\t\tthis.backdropMaterial.dispose();\n\t\tthis.depthMaterial.dispose();\n\t\tthis.sheenMaterial.dispose();\n\t}\n}\n\nfunction copyGeometry(target: THREE.BufferGeometry, source: THREE.BufferGeometry) {\n\tconst names = Object.keys(source.attributes);\n\tconst reusable =\n\t\tnames.length === Object.keys(target.attributes).length &&\n\t\tnames.every((name) => {\n\t\t\tconst before = target.getAttribute(name);\n\t\t\tconst after = source.getAttribute(name);\n\t\t\treturn (\n\t\t\t\tbefore instanceof THREE.BufferAttribute &&\n\t\t\t\tafter instanceof THREE.BufferAttribute &&\n\t\t\t\tbefore.itemSize === after.itemSize &&\n\t\t\t\tbefore.array.constructor === after.array.constructor &&\n\t\t\t\tbefore.array.length === after.array.length\n\t\t\t);\n\t\t}) &&\n\t\ttarget.index?.count === source.index?.count;\n\tif (reusable) {\n\t\tfor (const name of names) {\n\t\t\tconst attribute = target.getAttribute(name) as THREE.BufferAttribute;\n\t\t\tattribute.array.set((source.getAttribute(name) as THREE.BufferAttribute).array);\n\t\t\tattribute.needsUpdate = true;\n\t\t}\n\t\tif (target.index && source.index) {\n\t\t\ttarget.index.array.set(source.index.array);\n\t\t\ttarget.index.needsUpdate = true;\n\t\t}\n\t\ttarget.computeBoundingBox();\n\t\ttarget.computeBoundingSphere();\n\t} else {\n\t\t// Preserve the authored band if a future recipe changes its buffer layout.\n\t\ttarget.dispose();\n\t\ttarget.copy(source);\n\t}\n\tsource.dispose();\n}\n\nfunction createBackdropMaterial(\n\tbackdropTexture: THREE.Texture,\n\ttint: ColorRepresentation,\n\ttintOpacity: number,\n\tprojection: ReturnType<typeof createBackdropProjectionUniforms>\n) {\n\tconst material = new THREE.MeshBasicNodeMaterial({\n\t\tdepthTest: false,\n\t\tdepthWrite: false,\n\t\ttransparent: true\n\t});\n\tconst displayTintValue = new THREE.Color(tint);\n\tTHREE.ColorManagement.workingToColorSpace(displayTintValue, THREE.SRGBColorSpace);\n\tconst textureNode = texture(backdropTexture, createBackdropUvNode(projection));\n\tconst backdropLinear = textureNode.rgb;\n\tconst backdropDisplay = sRGBTransferOETF(\n\t\tacesFilmicToneMapping(backdropLinear, float(STAGE_TONE_MAPPING_EXPOSURE))\n\t) as Node<'vec3'>;\n\tconst compositeDisplay = mix(backdropDisplay, color(displayTintValue), float(tintOpacity));\n\tmaterial.colorNode = inverseAcesToneMapping(sRGBTransferEOTF(compositeDisplay) as Node<'vec3'>);\n\tmaterial.toneMapped = false;\n\n\treturn { material, textureNode };\n}\n\nfunction createBackdropProjectionUniforms(options: Required<LiquidGlassPanelOptions>) {\n\treturn {\n\t\tuvOffset: uniform(new THREE.Vector2()),\n\t\tuvScale: uniform(new THREE.Vector2(1, 1)),\n\t\tpanelSize: uniform(new THREE.Vector2(options.width, options.height)),\n\t\tradius: uniform(options.radius),\n\t\tbezel: uniform(options.bezel),\n\t\trefraction: uniform(options.refraction)\n\t};\n}\n\n/**\n * Computes the refracted backdrop coordinate once per vertex. The resulting\n * varying is interpolated by the rasterizer, so panel movement and camera\n * changes no longer require rewriting and uploading the complete UV buffer.\n */\nfunction createBackdropUvNode(projection: ReturnType<typeof createBackdropProjectionUniforms>) {\n\tconst localPosition = positionLocal.xy;\n\tconst halfSize = projection.panelSize.mul(0.5);\n\tconst radius = tslMin(projection.radius, tslMin(halfSize.x, halfSize.y));\n\tconst signedDistance = roundedRectSdfNode(localPosition, halfSize, radius);\n\tconst insideDistance = tslMax(signedDistance.negate(), 0);\n\tconst edge = oneMinus(smoothstep(0, tslMax(projection.bezel, 0.0001), insideDistance)).mul(\n\t\tstep(0.0001, projection.bezel)\n\t);\n\tconst normalizedPosition = localPosition.div(tslMax(halfSize, 1));\n\tconst centerLens = oneMinus(tslMin(1, length(normalizedPosition)));\n\tconst gradient = roundedRectGradientNode(localPosition, halfSize, radius);\n\tconst refractionOffset = projection.refraction.mul(edge.mul(1.15).add(centerLens.mul(0.04)));\n\tconst samplePosition = localPosition.add(gradient.mul(refractionOffset));\n\tconst clipPosition = cameraProjectionMatrix\n\t\t.mul(cameraViewMatrix)\n\t\t.mul(modelWorldMatrix)\n\t\t.mul(vec4(samplePosition, 0, 1));\n\tconst ndc = clipPosition.xy.div(clipPosition.w);\n\tconst projectedUv = vec2(ndc.x.mul(0.5).add(0.5), ndc.y.mul(-0.5).add(0.5));\n\n\treturn varying(clamp(projectedUv.mul(projection.uvScale).add(projection.uvOffset), 0, 1), 'vLiquidGlassBackdropUv');\n}\n\nfunction roundedRectSdfNode(point: Node<'vec2'>, halfSize: Node<'vec2'>, radius: Node<'float'>) {\n\tconst q = abs(point).sub(halfSize).add(radius);\n\treturn tslMin(tslMax(q.x, q.y), 0)\n\t\t.add(length(tslMax(q, 0)))\n\t\t.sub(radius) as Node<'float'>;\n}\n\nfunction roundedRectGradientNode(\n\tpoint: Node<'vec2'>,\n\thalfSize: Node<'vec2'>,\n\tradius: Node<'float'>\n) {\n\tconst epsilon = 0.5;\n\tconst dx = roundedRectSdfNode(point.add(vec2(epsilon, 0)), halfSize, radius).sub(\n\t\troundedRectSdfNode(point.sub(vec2(epsilon, 0)), halfSize, radius)\n\t);\n\tconst dy = roundedRectSdfNode(point.add(vec2(0, epsilon)), halfSize, radius).sub(\n\t\troundedRectSdfNode(point.sub(vec2(0, epsilon)), halfSize, radius)\n\t);\n\tconst gradient = vec2(dx, dy);\n\n\treturn gradient.div(tslMax(length(gradient), 0.00001));\n}\n\nfunction getDepthOpacity(thickness: number) {\n\treturn THREE.MathUtils.clamp(thickness, 0, 1) * 0.12;\n}\n\n/**\n * Inverts the stage's ACES curve so the final global output pass preserves a\n * CSS-style tint composite instead of tone-mapping it a second time.\n */\nexport function inverseAcesToneMapping(target: Node<'vec3'>) {\n\tconst inputMatrix = mat3(\n\t\t0.59719,\n\t\t0.35458,\n\t\t0.04823,\n\t\t0.076,\n\t\t0.90834,\n\t\t0.01566,\n\t\t0.0284,\n\t\t0.13383,\n\t\t0.83777\n\t);\n\tconst outputMatrix = mat3(\n\t\t1.60475,\n\t\t-0.53108,\n\t\t-0.07367,\n\t\t-0.10208,\n\t\t1.10813,\n\t\t-0.00605,\n\t\t-0.00327,\n\t\t-0.07276,\n\t\t1.07602\n\t);\n\tconst fittedTarget = tslMax(inverse(outputMatrix).mul(target), 0) as Node<'vec3'>;\n\tconst a = float(1).sub(fittedTarget.mul(0.983729));\n\tconst b = float(0.0245786).sub(fittedTarget.mul(0.983729 * 0.432951));\n\tconst c = float(-0.000090537).sub(fittedTarget.mul(0.238081));\n\tconst discriminant = tslMax(b.mul(b).sub(a.mul(c).mul(4)), 0);\n\tconst fittedInput = b.negate().add(sqrt(discriminant)).div(a.mul(2)) as Node<'vec3'>;\n\tconst transformedInput = inverse(inputMatrix).mul(fittedInput) as Node<'vec3'>;\n\n\t// Saturated UI colors can require a negative scene-linear channel before\n\t// ACES. Clamping it here changes the hue (notably blue -> lavender). The\n\t// output transform clamps only after reversing the matrix/curve, as intended.\n\treturn transformedInput.mul(0.6 / STAGE_TONE_MAPPING_EXPOSURE) as Node<'vec3'>;\n}\n\nfunction getDepthColor(tint: ColorRepresentation) {\n\treturn new THREE.Color(tint).lerp(new THREE.Color(0x101820), 0.72);\n}\n\nfunction getSpecularColor(tint: ColorRepresentation, tintOpacity: number) {\n\tconst tintColor = new THREE.Color(tint);\n\tconst tintDarkness = 1 - Math.max(tintColor.r, tintColor.g, tintColor.b);\n\tconst tintInfluence = THREE.MathUtils.clamp(tintOpacity + tintDarkness * 0.55, 0, 1);\n\n\treturn new THREE.Color(0xffffff).lerp(tintColor, tintInfluence);\n}\n\nfunction createVertexAlphaMaterial(\n\tcolor: ColorRepresentation,\n\topacity: number,\n\tblending: typeof THREE.NormalBlending | typeof THREE.AdditiveBlending = THREE.NormalBlending\n) {\n\tconst material = new THREE.MeshBasicMaterial({\n\t\tblending,\n\t\tcolor,\n\t\tdepthTest: false,\n\t\tdepthWrite: false,\n\t\topacity,\n\t\tside: THREE.DoubleSide,\n\t\ttransparent: true,\n\t\tvertexColors: true\n\t});\n\tmaterial.toneMapped = false;\n\n\treturn material;\n}\n\nconst roundedGridVertices = new WeakMap<THREE.BufferGeometry, Int32Array>();\n\nfunction createRoundedGridGeometry(\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tcolumns: number,\n\trows: number,\n\tgeometry = new THREE.BufferGeometry()\n) {\n\tconst halfWidth = width * 0.5;\n\tconst halfHeight = height * 0.5;\n\tconst r = Math.min(radius, halfWidth, halfHeight);\n\t// Corner cells enter/leave the surface as its size changes. Reserve the full grid\n\t// once, keeping GPU buffer identity while drawRange selects the exact authored mesh.\n\tlet vertexIndex = roundedGridVertices.get(geometry);\n\tif (!vertexIndex) {\n\t\tconst capacity = (columns + 1) * (rows + 1);\n\t\tvertexIndex = new Int32Array(capacity);\n\t\troundedGridVertices.set(geometry, vertexIndex);\n\t\tgeometry.setAttribute(\n\t\t\t'position',\n\t\t\tnew THREE.BufferAttribute(new Float32Array(capacity * 3), 3)\n\t\t);\n\t\tgeometry.setIndex(new THREE.BufferAttribute(new Uint16Array(columns * rows * 6), 1));\n\t\t// Three's WebGPU attribute manager uploads DynamicDrawUsage on every render,\n\t\t// even without a version change. Keep uploads version-driven: actual shape\n\t\t// changes below mark these retained buffers with needsUpdate.\n\t}\n\tvertexIndex.fill(-1);\n\tconst position = geometry.getAttribute('position') as THREE.BufferAttribute;\n\tconst positions = position.array;\n\tconst indexAttribute = geometry.index!;\n\tconst indices = indexAttribute.array;\n\tlet vertexCount = 0;\n\tlet indexCount = 0;\n\n\tconst addVertex = (gridX: number, gridY: number) => {\n\t\tconst key = gridY * (columns + 1) + gridX;\n\t\tconst existing = vertexIndex[key];\n\t\tif (existing !== -1) return existing;\n\n\t\tlet x = -halfWidth + (gridX / columns) * width;\n\t\tlet y = -halfHeight + (gridY / rows) * height;\n\t\tconst distance = roundedRectSdf(x, y, halfWidth, halfHeight, r);\n\n\t\tif (distance > 0) {\n\t\t\tconst gradient = roundedRectGradient(x, y, halfWidth, halfHeight, r);\n\t\t\tx -= gradient.x * distance;\n\t\t\ty -= gradient.y * distance;\n\t\t}\n\n\t\tconst index = vertexCount++;\n\t\tpositions[index * 3] = x;\n\t\tpositions[index * 3 + 1] = y;\n\t\tpositions[index * 3 + 2] = 0;\n\t\tvertexIndex[key] = index;\n\n\t\treturn index;\n\t};\n\n\tfor (let y = 0; y < rows; y += 1) {\n\t\tfor (let x = 0; x < columns; x += 1) {\n\t\t\tconst x0 = -halfWidth + (x / columns) * width;\n\t\t\tconst x1 = -halfWidth + ((x + 1) / columns) * width;\n\t\t\tconst y0 = -halfHeight + (y / rows) * height;\n\t\t\tconst y1 = -halfHeight + ((y + 1) / rows) * height;\n\t\t\tconst centerX = -halfWidth + ((x + 0.5) / columns) * width;\n\t\t\tconst centerY = -halfHeight + ((y + 0.5) / rows) * height;\n\t\t\tconst inside =\n\t\t\t\troundedRectSdf(centerX, centerY, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x0, y0, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x1, y0, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x0, y1, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x1, y1, halfWidth, halfHeight, r) <= 0;\n\n\t\t\tif (!inside) continue;\n\n\t\t\tconst a = addVertex(x, y);\n\t\t\tconst b = addVertex(x + 1, y);\n\t\t\tconst c = addVertex(x, y + 1);\n\t\t\tconst d = addVertex(x + 1, y + 1);\n\t\t\tindices[indexCount++] = a;\n\t\t\tindices[indexCount++] = b;\n\t\t\tindices[indexCount++] = c;\n\t\t\tindices[indexCount++] = b;\n\t\t\tindices[indexCount++] = d;\n\t\t\tindices[indexCount++] = c;\n\t\t}\n\t}\n\n\tpositions.fill(0, vertexCount * 3);\n\tindices.fill(0, indexCount);\n\tgeometry.setDrawRange(0, indexCount);\n\tposition.needsUpdate = true;\n\tindexAttribute.needsUpdate = true;\n\tgeometry.computeVertexNormals();\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n\n\treturn geometry;\n}\n\nfunction createRoundedBandGeometry(\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tspread: number,\n\trings: number,\n\talphaPower: number\n) {\n\tconst positions: number[] = [];\n\tconst colors: number[] = [];\n\tconst indices: number[] = [];\n\tconst pointsPerRing = 96;\n\n\tfor (let ring = 0; ring <= rings; ring += 1) {\n\t\tconst t = ring / rings;\n\t\tconst offset = spread * t;\n\t\tconst ringWidth = Math.max(1, width + offset * 2);\n\t\tconst ringHeight = Math.max(1, height + offset * 2);\n\t\tconst ringRadius = Math.max(0, Math.min(radius + offset, ringWidth * 0.5, ringHeight * 0.5));\n\t\tconst alpha = Math.pow(1 - t, alphaPower);\n\t\tconst points = createRoundedRectPoints(ringWidth, ringHeight, ringRadius, pointsPerRing / 4);\n\n\t\tpoints.forEach(({ x, y }) => {\n\t\t\tpositions.push(x, y, 0);\n\t\t\tcolors.push(1, 1, 1, alpha);\n\t\t});\n\t}\n\n\tfor (let ring = 0; ring < rings; ring += 1) {\n\t\tconst current = ring * pointsPerRing;\n\t\tconst next = (ring + 1) * pointsPerRing;\n\n\t\tfor (let index = 0; index < pointsPerRing; index += 1) {\n\t\t\tconst a = current + index;\n\t\t\tconst b = current + ((index + 1) % pointsPerRing);\n\t\t\tconst c = next + index;\n\t\t\tconst d = next + ((index + 1) % pointsPerRing);\n\t\t\tindices.push(a, b, c, b, d, c);\n\t\t}\n\t}\n\n\tconst geometry = new THREE.BufferGeometry();\n\tgeometry.setIndex(indices);\n\tgeometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3));\n\tgeometry.setAttribute('color', new THREE.Float32BufferAttribute(colors, 4));\n\tgeometry.computeVertexNormals();\n\n\treturn geometry;\n}\n\nfunction createRoundedRectPoints(\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tsegmentsPerCorner: number\n) {\n\tconst halfWidth = width * 0.5;\n\tconst halfHeight = height * 0.5;\n\tconst r = Math.min(radius, halfWidth, halfHeight);\n\tconst corners = [\n\t\t{ x: halfWidth - r, y: halfHeight - r, start: Math.PI * 0.5, end: 0 },\n\t\t{ x: halfWidth - r, y: -halfHeight + r, start: 0, end: -Math.PI * 0.5 },\n\t\t{ x: -halfWidth + r, y: -halfHeight + r, start: -Math.PI * 0.5, end: -Math.PI },\n\t\t{ x: -halfWidth + r, y: halfHeight - r, start: Math.PI, end: Math.PI * 0.5 }\n\t];\n\tconst points: { x: number; y: number }[] = [];\n\n\tcorners.forEach((corner) => {\n\t\tfor (let step = 0; step < segmentsPerCorner; step += 1) {\n\t\t\tconst t = step / segmentsPerCorner;\n\t\t\tconst angle = THREE.MathUtils.lerp(corner.start, corner.end, t);\n\t\t\tpoints.push({\n\t\t\t\tx: corner.x + Math.cos(angle) * r,\n\t\t\t\ty: corner.y + Math.sin(angle) * r\n\t\t\t});\n\t\t}\n\t});\n\n\treturn points;\n}\n\nfunction roundedRectSdf(\n\tx: number,\n\ty: number,\n\thalfWidth: number,\n\thalfHeight: number,\n\tradius: number\n) {\n\tconst qx = Math.abs(x) - halfWidth + radius;\n\tconst qy = Math.abs(y) - halfHeight + radius;\n\treturn Math.min(Math.max(qx, qy), 0) + Math.hypot(Math.max(qx, 0), Math.max(qy, 0)) - radius;\n}\n\nfunction roundedRectGradient(\n\tx: number,\n\ty: number,\n\thalfWidth: number,\n\thalfHeight: number,\n\tradius: number\n) {\n\tconst eps = 0.5;\n\tconst dx =\n\t\troundedRectSdf(x + eps, y, halfWidth, halfHeight, radius) -\n\t\troundedRectSdf(x - eps, y, halfWidth, halfHeight, radius);\n\tconst dy =\n\t\troundedRectSdf(x, y + eps, halfWidth, halfHeight, radius) -\n\t\troundedRectSdf(x, y - eps, halfWidth, halfHeight, radius);\n\tconst length = Math.hypot(dx, dy) || 1;\n\n\treturn { x: dx / length, y: dy / length };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LiquidGlassPanel.js","sourceRoot":"","sources":["../../src/stage/LiquidGlassPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EACN,GAAG,EACH,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,GAAG,IAAI,MAAM,EACb,GAAG,IAAI,MAAM,EACb,GAAG,EACH,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAA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3B,CAAS,EACT,CAAS,EACT,SAAiB,EACjB,UAAkB,EAClB,MAAc;IAEd,MAAM,GAAG,GAAG,GAAG,CAAC;IAChB,MAAM,EAAE,GACP,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC;QACzD,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,EAAE,GACP,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC;QACzD,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport {\n\tabs,\n\tacesFilmicToneMapping,\n\tcameraProjectionMatrix,\n\tcameraViewMatrix,\n\tclamp,\n\tcolor,\n\tfloat,\n\tinverse,\n\tlength,\n\tmat3,\n\tmax as tslMax,\n\tmin as tslMin,\n\tmix,\n\tmodelWorldMatrix,\n\toneMinus,\n\tpositionLocal,\n\tsqrt,\n\tsRGBTransferEOTF,\n\tsRGBTransferOETF,\n\tsmoothstep,\n\tstep,\n\ttexture,\n\tuniform,\n\tvarying,\n\tvec2,\n\tvec4\n} from 'three/tsl';\nimport type { ColorRepresentation } from 'three';\nimport type { Node } from 'three/webgpu';\nimport { PANEL_SHADOW_RECIPE, resolvePanelShadowStrength } from './panelShadow.js';\n\n/** A CSS Gaussian shadow reaches roughly half its declared alpha at an unspread edge. */\nconst WEBGPU_SHADOW_EDGE_COMPENSATION = 0.5;\nconst WEBGPU_SHADOW_EXTENT_PER_BLUR = 1.5;\n\nexport interface LiquidGlassPanelOptions {\n\twidth?: number;\n\theight?: number;\n\tradius?: number;\n\t/** Keep the lower corners square when a panel joins the content below it. */\n\tsquareBottom?: boolean;\n\tposition?: { x: number; y: number };\n\t/** Blur radius of the sampled stage backdrop, in CSS pixels. */\n\tbackdropBlur?: number;\n\t/** Maximum displacement of the sampled backdrop near the glass edge, in CSS pixels. */\n\trefraction?: number;\n\ttint?: ColorRepresentation;\n\t/** Direct opacity of the tint over the sampled backdrop, from zero to one. */\n\ttintOpacity?: number;\n\t/** Width of the refractive/specular edge, in CSS pixels. */\n\tbezel?: number;\n\t/** Optical edge weight, from zero (flat) to one (thick glass). */\n\tthickness?: number;\n\tspecularOpacity?: number;\n\t/** Normalized strength of the panel shadow, from zero to one. */\n\tshadowIntensity?: number;\n\topacity?: number;\n}\n\nconst DEFAULT_OPTIONS = {\n\twidth: 360,\n\theight: 230,\n\tradius: 42,\n\tsquareBottom: false,\n\tposition: { x: 0, y: 42 },\n\tbackdropBlur: 5,\n\trefraction: 12,\n\ttint: 0xffffff,\n\ttintOpacity: 0.28,\n\tbezel: 18,\n\tthickness: 0.35,\n\tspecularOpacity: 0.18,\n\tshadowIntensity: 0.28,\n\topacity: 1\n} satisfies Required<LiquidGlassPanelOptions>;\n\n/** Exposure shared by the stage renderer and CSS-color compensation for panel tints. */\nexport const STAGE_TONE_MAPPING_EXPOSURE = 1.15;\n\n/** Applies stable defaults and keeps public visual controls inside their documented ranges. */\nexport function resolveLiquidGlassPanelOptions(\n\toptions: LiquidGlassPanelOptions = {}\n): Required<LiquidGlassPanelOptions> {\n\tconst merged = {\n\t\t...DEFAULT_OPTIONS,\n\t\t...options,\n\t\tposition: { ...DEFAULT_OPTIONS.position, ...options.position }\n\t};\n\tconst width = clampFinite(merged.width, 1, Number.MAX_SAFE_INTEGER, DEFAULT_OPTIONS.width);\n\tconst height = clampFinite(merged.height, 1, Number.MAX_SAFE_INTEGER, DEFAULT_OPTIONS.height);\n\n\treturn {\n\t\t...merged,\n\t\twidth,\n\t\theight,\n\t\tsquareBottom: options.squareBottom === true,\n\t\tradius: clampFinite(merged.radius, 0, Math.min(width, height) * 0.5, DEFAULT_OPTIONS.radius),\n\t\tposition: {\n\t\t\tx: finiteOr(merged.position.x, DEFAULT_OPTIONS.position.x),\n\t\t\ty: finiteOr(merged.position.y, DEFAULT_OPTIONS.position.y)\n\t\t},\n\t\tbackdropBlur: clampFinite(merged.backdropBlur, 0, 100, DEFAULT_OPTIONS.backdropBlur),\n\t\trefraction: clampFinite(merged.refraction, 0, 100, DEFAULT_OPTIONS.refraction),\n\t\ttintOpacity: clampFinite(merged.tintOpacity, 0, 1, DEFAULT_OPTIONS.tintOpacity),\n\t\tbezel: clampFinite(merged.bezel, 0, Math.min(width, height) * 0.5, DEFAULT_OPTIONS.bezel),\n\t\tthickness: clampFinite(merged.thickness, 0, 1, DEFAULT_OPTIONS.thickness),\n\t\tspecularOpacity: clampFinite(merged.specularOpacity, 0, 1, DEFAULT_OPTIONS.specularOpacity),\n\t\tshadowIntensity: clampFinite(merged.shadowIntensity, 0, 1, DEFAULT_OPTIONS.shadowIntensity),\n\t\topacity: clampFinite(merged.opacity, 0, 1, DEFAULT_OPTIONS.opacity)\n\t};\n}\n\nfunction finiteOr(value: number, fallback: number) {\n\treturn Number.isFinite(value) ? value : fallback;\n}\n\nfunction clampFinite(value: number, min: number, max: number, fallback: number) {\n\treturn THREE.MathUtils.clamp(finiteOr(value, fallback), min, max);\n}\n\nexport class LiquidGlassPanel {\n\t/** Preserve full-backdrop coordinates while a cropped camera captures this surface. */\n\tsetBackdropUvTransform(x: number, y: number, width: number, height: number) {\n\t\tthis.backdropProjection.uvOffset.value.set(x, y);\n\t\tthis.backdropProjection.uvScale.value.set(width, height);\n\t}\n\treadonly group = new THREE.Group();\n\treadonly options: Required<LiquidGlassPanelOptions>;\n\n\tprivate readonly geometryOptions: Required<LiquidGlassPanelOptions>;\n\tprivate readonly authoredBezel: number;\n\tprivate readonly authoredRadius: number;\n\tprivate readonly backdropGeometry: THREE.BufferGeometry;\n\tprivate readonly bezelGeometry: THREE.BufferGeometry;\n\tprivate readonly shadowLayers: {\n\t\tgeometry: THREE.BufferGeometry;\n\t\tmaterial: THREE.MeshBasicMaterial;\n\t\tmesh: THREE.Mesh;\n\t\talphaScale: number;\n\t}[];\n\tprivate readonly backdropMaterial: THREE.MeshBasicNodeMaterial;\n\tprivate readonly backdropTextureNode: ReturnType<typeof texture>;\n\tprivate readonly depthMaterial: THREE.MeshBasicMaterial;\n\tprivate readonly sheenMaterial: THREE.MeshBasicMaterial;\n\tprivate readonly backdropProjection: ReturnType<typeof createBackdropProjectionUniforms>;\n\tprivate readonly ownedRenderGraph: () => boolean;\n\n\tconstructor(backdropTexture: THREE.Texture, options: LiquidGlassPanelOptions = {}) {\n\t\tthis.options = resolveLiquidGlassPanelOptions(options);\n\t\t// Hidden native popovers initially measure 1px. Keep the authored optical\n\t\t// dimensions so opening/resizing does not permanently flatten their glass edge.\n\t\tthis.authoredBezel = Math.max(0, finiteOr(options.bezel ?? DEFAULT_OPTIONS.bezel, DEFAULT_OPTIONS.bezel));\n\t\tthis.authoredRadius = Math.max(0, finiteOr(options.radius ?? DEFAULT_OPTIONS.radius, DEFAULT_OPTIONS.radius));\n\t\tthis.geometryOptions = {\n\t\t\t...this.options,\n\t\t\tposition: { ...this.options.position }\n\t\t};\n\t\tthis.backdropProjection = createBackdropProjectionUniforms(this.options);\n\n\t\tthis.group.position.set(this.options.position.x, this.options.position.y, 0);\n\t\tthis.backdropGeometry = createRoundedGridGeometry(\n\t\t\tthis.geometryOptions.width,\n\t\t\tthis.geometryOptions.height,\n\t\t\tthis.geometryOptions.radius,\n\t\t\t128,\n\t\t\t82, undefined, this.options.squareBottom\n\t\t);\n\t\tthis.bezelGeometry = createRoundedBandGeometry(\n\t\t\tthis.geometryOptions.width,\n\t\t\tthis.geometryOptions.height,\n\t\t\tthis.geometryOptions.radius,\n\t\t\t-this.geometryOptions.bezel,\n\t\t\t14,\n\t\t\t1.7, this.options.squareBottom\n\t\t);\n\t\tthis.shadowLayers = PANEL_SHADOW_RECIPE.map((layer, index) => {\n\t\t\tconst shadowStrength = resolvePanelShadowStrength(this.options.shadowIntensity);\n\t\t\tconst geometry = createRoundedBandGeometry(\n\t\t\t\tthis.geometryOptions.width,\n\t\t\t\tthis.geometryOptions.height,\n\t\t\t\tthis.geometryOptions.radius,\n\t\t\t\tlayer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR,\n\t\t\t\tMath.max(8, Math.round(layer.blur)),\n\t\t\t\t2.1, this.options.squareBottom\n\t\t\t);\n\t\t\tconst material = createVertexAlphaMaterial(\n\t\t\t\t0x000000,\n\t\t\t\tshadowStrength * layer.alphaScale * WEBGPU_SHADOW_EDGE_COMPENSATION\n\t\t\t);\n\t\t\tconst mesh = new THREE.Mesh(geometry, material);\n\t\t\tmesh.position.set(0, -layer.offsetY, 0);\n\t\t\tmesh.renderOrder = PANEL_SHADOW_RECIPE.length - index;\n\t\t\treturn { geometry, material, mesh, alphaScale: layer.alphaScale };\n\t\t});\n\t\tthis.depthMaterial = createVertexAlphaMaterial(\n\t\t\tgetDepthColor(this.options.tint),\n\t\t\tgetDepthOpacity(this.options.thickness)\n\t\t);\n\t\tthis.sheenMaterial = createVertexAlphaMaterial(\n\t\t\tgetSpecularColor(this.options.tint, this.options.tintOpacity),\n\t\t\tthis.options.specularOpacity,\n\t\t\tTHREE.AdditiveBlending\n\t\t);\n\t\tconst backdropShader = createBackdropMaterial(\n\t\t\tbackdropTexture,\n\t\t\tthis.options.tint,\n\t\t\tthis.options.tintOpacity,\n\t\t\tthis.backdropProjection\n\t\t);\n\t\tthis.backdropMaterial = backdropShader.material;\n\t\tthis.backdropTextureNode = backdropShader.textureNode;\n\n\t\tconst backdrop = new THREE.Mesh(this.backdropGeometry, this.backdropMaterial);\n\t\tbackdrop.position.z = 0;\n\t\tbackdrop.renderOrder = 3;\n\n\t\tconst depthTint = new THREE.Mesh(this.bezelGeometry, this.depthMaterial);\n\t\tdepthTint.position.z = 0;\n\t\tdepthTint.renderOrder = 4;\n\n\t\tconst sheen = new THREE.Mesh(this.bezelGeometry, this.sheenMaterial);\n\t\tsheen.position.z = 0;\n\t\tsheen.renderOrder = 6;\n\n\t\tthis.group.add(...this.shadowLayers.map(({ mesh }) => mesh), backdrop, depthTint, sheen);\n\t\tthis.setVisibilityAlpha(1);\n\t\t// Capture only our final constructor-owned graph. Public group customizations\n\t\t// remain supported by normal rendering, but conservatively reject reuse of\n\t\t// completed Full preparation for the inactive Scroll warmup.\n\t\tconst nodes: { node: THREE.Object3D; children: THREE.Object3D[]; before: THREE.Object3D['onBeforeRender']; after: THREE.Object3D['onAfterRender'] }[] = [];\n\t\tconst materials: { mesh: THREE.Mesh; material: THREE.Material; version: number;\n\t\t\tbefore: THREE.Material['onBeforeRender']; compile: THREE.Material['onBeforeCompile']; roots: [string, unknown][] }[] = [];\n\t\tthis.group.traverse(node => {\n\t\t\tnodes.push({ node, children: [...node.children], before: node.onBeforeRender, after: node.onAfterRender });\n\t\t\tif (!(node instanceof THREE.Mesh)) return;\n\t\t\tconst material = node.material as THREE.Material;\n\t\t\tconst values = material as unknown as Record<string, unknown>;\n\t\t\tmaterials.push({ mesh: node, material, version: material.version, before: material.onBeforeRender,\n\t\t\t\tcompile: material.onBeforeCompile, roots: Object.keys(values).filter(key => key.endsWith('Node')).map(key => [key, values[key]]) });\n\t\t});\n\t\tthis.ownedRenderGraph = () => nodes.every(({ node, children, before, after }) =>\n\t\t\tnode.onBeforeRender === before && node.onAfterRender === after && node.children.length === children.length &&\n\t\t\tchildren.every((child, i) => node.children[i] === child)) &&\n\t\t\tmaterials.every(({ mesh, material, version, before, compile, roots }) => mesh.material === material &&\n\t\t\t\tmaterial.version === version && material.onBeforeRender === before && material.onBeforeCompile === compile &&\n\t\t\t\troots.every(([key, value]) => (material as unknown as Record<string, unknown>)[key] === value));\n\t}\n\n\t/** Internal warmup eligibility; normal rendering still accepts customized groups. */\n\thasOwnedRenderGraph() { return this.ownedRenderGraph(); }\n\n\tsetVisibilityAlpha(alpha: number) {\n\t\tconst scale = THREE.MathUtils.clamp(alpha * this.options.opacity, 0, 1);\n\t\tthis.group.visible = scale > 0.01;\n\t\tthis.backdropMaterial.opacity = scale;\n\t\tthis.depthMaterial.opacity = getDepthOpacity(this.options.thickness) * scale;\n\t\tthis.sheenMaterial.opacity = this.options.specularOpacity * scale;\n\t\tthis.shadowLayers.forEach(({ material, alphaScale }) => {\n\t\t\tmaterial.opacity =\n\t\t\t\tresolvePanelShadowStrength(this.options.shadowIntensity) *\n\t\t\t\talphaScale *\n\t\t\t\tWEBGPU_SHADOW_EDGE_COMPENSATION *\n\t\t\t\tscale;\n\t\t});\n\t}\n\n\tsetBackdropTexture(backdropTexture: THREE.Texture) {\n\t\tif (this.backdropTextureNode.value === backdropTexture) return;\n\t\tthis.backdropTextureNode.value = backdropTexture;\n\t}\n\n\tsetVisualSize(width: number, height: number, radius = this.authoredRadius) {\n\t\tconst nextWidth = Math.max(width, 1);\n\t\tconst nextHeight = Math.max(height, 1);\n\t\tconst nextRadius = Math.min(Math.max(radius, 0), nextWidth * 0.5, nextHeight * 0.5);\n\t\tconst nextBezel = Math.min(this.authoredBezel, nextWidth * 0.5, nextHeight * 0.5);\n\n\t\tif (\n\t\t\tMath.abs(this.geometryOptions.width - nextWidth) < 0.01 &&\n\t\t\tMath.abs(this.geometryOptions.height - nextHeight) < 0.01 &&\n\t\t\tMath.abs(this.geometryOptions.radius - nextRadius) < 0.01\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.geometryOptions.width = nextWidth;\n\t\tthis.geometryOptions.height = nextHeight;\n\t\tthis.geometryOptions.radius = nextRadius;\n\t\tthis.geometryOptions.bezel = nextBezel;\n\t\tthis.backdropProjection.panelSize.value.set(nextWidth, nextHeight);\n\t\tthis.backdropProjection.radius.value = nextRadius;\n\t\tthis.backdropProjection.bezel.value = nextBezel;\n\t\tcreateRoundedGridGeometry(nextWidth, nextHeight, nextRadius, 128, 82, this.backdropGeometry, this.options.squareBottom);\n\t\tcopyGeometry(\n\t\t\tthis.bezelGeometry,\n\t\t\tcreateRoundedBandGeometry(nextWidth, nextHeight, nextRadius, -nextBezel, 14, 1.7, this.options.squareBottom)\n\t\t);\n\t\tthis.shadowLayers.forEach(({ geometry }, index) => {\n\t\t\tconst layer = PANEL_SHADOW_RECIPE[index];\n\t\t\tcopyGeometry(\n\t\t\t\tgeometry,\n\t\t\t\tcreateRoundedBandGeometry(\n\t\t\t\t\tnextWidth,\n\t\t\t\t\tnextHeight,\n\t\t\t\t\tnextRadius,\n\t\t\t\t\tlayer.blur * WEBGPU_SHADOW_EXTENT_PER_BLUR,\n\t\t\t\t\tMath.max(8, Math.round(layer.blur)),\n\t\t\t\t\t2.1, this.options.squareBottom\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\t}\n\n\tdispose() {\n\t\tthis.backdropGeometry.dispose();\n\t\tthis.bezelGeometry.dispose();\n\t\tthis.shadowLayers.forEach(({ geometry, material }) => {\n\t\t\tgeometry.dispose();\n\t\t\tmaterial.dispose();\n\t\t});\n\t\tthis.backdropMaterial.dispose();\n\t\tthis.depthMaterial.dispose();\n\t\tthis.sheenMaterial.dispose();\n\t}\n}\n\nfunction copyGeometry(target: THREE.BufferGeometry, source: THREE.BufferGeometry) {\n\tconst names = Object.keys(source.attributes);\n\tconst reusable =\n\t\tnames.length === Object.keys(target.attributes).length &&\n\t\tnames.every((name) => {\n\t\t\tconst before = target.getAttribute(name);\n\t\t\tconst after = source.getAttribute(name);\n\t\t\treturn (\n\t\t\t\tbefore instanceof THREE.BufferAttribute &&\n\t\t\t\tafter instanceof THREE.BufferAttribute &&\n\t\t\t\tbefore.itemSize === after.itemSize &&\n\t\t\t\tbefore.array.constructor === after.array.constructor &&\n\t\t\t\tbefore.array.length === after.array.length\n\t\t\t);\n\t\t}) &&\n\t\ttarget.index?.count === source.index?.count;\n\tif (reusable) {\n\t\tfor (const name of names) {\n\t\t\tconst attribute = target.getAttribute(name) as THREE.BufferAttribute;\n\t\t\tattribute.array.set((source.getAttribute(name) as THREE.BufferAttribute).array);\n\t\t\tattribute.needsUpdate = true;\n\t\t}\n\t\tif (target.index && source.index) {\n\t\t\ttarget.index.array.set(source.index.array);\n\t\t\ttarget.index.needsUpdate = true;\n\t\t}\n\t\ttarget.computeBoundingBox();\n\t\ttarget.computeBoundingSphere();\n\t} else {\n\t\t// Preserve the authored band if a future recipe changes its buffer layout.\n\t\ttarget.dispose();\n\t\ttarget.copy(source);\n\t}\n\tsource.dispose();\n}\n\nfunction createBackdropMaterial(\n\tbackdropTexture: THREE.Texture,\n\ttint: ColorRepresentation,\n\ttintOpacity: number,\n\tprojection: ReturnType<typeof createBackdropProjectionUniforms>\n) {\n\tconst material = new THREE.MeshBasicNodeMaterial({\n\t\tdepthTest: false,\n\t\tdepthWrite: false,\n\t\ttransparent: true\n\t});\n\tconst displayTintValue = new THREE.Color(tint);\n\tTHREE.ColorManagement.workingToColorSpace(displayTintValue, THREE.SRGBColorSpace);\n\tconst textureNode = texture(backdropTexture, createBackdropUvNode(projection));\n\tconst backdropLinear = textureNode.rgb;\n\tconst backdropDisplay = sRGBTransferOETF(\n\t\tacesFilmicToneMapping(backdropLinear, float(STAGE_TONE_MAPPING_EXPOSURE))\n\t) as Node<'vec3'>;\n\tconst compositeDisplay = mix(backdropDisplay, color(displayTintValue), float(tintOpacity));\n\tmaterial.colorNode = inverseAcesToneMapping(sRGBTransferEOTF(compositeDisplay) as Node<'vec3'>);\n\tmaterial.toneMapped = false;\n\n\treturn { material, textureNode };\n}\n\nfunction createBackdropProjectionUniforms(options: Required<LiquidGlassPanelOptions>) {\n\treturn {\n\t\tuvOffset: uniform(new THREE.Vector2()),\n\t\tuvScale: uniform(new THREE.Vector2(1, 1)),\n\t\tpanelSize: uniform(new THREE.Vector2(options.width, options.height)),\n\t\tradius: uniform(options.radius),\n\t\tsquareBottom: uniform(options.squareBottom ? 1 : 0),\n\t\tbezel: uniform(options.bezel),\n\t\trefraction: uniform(options.refraction)\n\t};\n}\n\n/**\n * Computes the refracted backdrop coordinate once per vertex. The resulting\n * varying is interpolated by the rasterizer, so panel movement and camera\n * changes no longer require rewriting and uploading the complete UV buffer.\n */\nfunction createBackdropUvNode(projection: ReturnType<typeof createBackdropProjectionUniforms>) {\n\tconst localPosition = positionLocal.xy;\n\tconst halfSize = projection.panelSize.mul(0.5);\n\tconst radius = tslMin(projection.radius, tslMin(halfSize.x, halfSize.y))\n\t\t.mul(oneMinus(projection.squareBottom.mul(oneMinus(step(0, localPosition.y)))));\n\tconst signedDistance = roundedRectSdfNode(localPosition, halfSize, radius);\n\tconst insideDistance = tslMax(signedDistance.negate(), 0);\n\tconst edge = oneMinus(smoothstep(0, tslMax(projection.bezel, 0.0001), insideDistance)).mul(\n\t\tstep(0.0001, projection.bezel)\n\t);\n\tconst normalizedPosition = localPosition.div(tslMax(halfSize, 1));\n\tconst centerLens = oneMinus(tslMin(1, length(normalizedPosition)));\n\tconst gradient = roundedRectGradientNode(localPosition, halfSize, radius);\n\tconst refractionOffset = projection.refraction.mul(edge.mul(1.15).add(centerLens.mul(0.04)));\n\tconst samplePosition = localPosition.add(gradient.mul(refractionOffset));\n\tconst clipPosition = cameraProjectionMatrix\n\t\t.mul(cameraViewMatrix)\n\t\t.mul(modelWorldMatrix)\n\t\t.mul(vec4(samplePosition, 0, 1));\n\tconst ndc = clipPosition.xy.div(clipPosition.w);\n\tconst projectedUv = vec2(ndc.x.mul(0.5).add(0.5), ndc.y.mul(-0.5).add(0.5));\n\n\treturn varying(clamp(projectedUv.mul(projection.uvScale).add(projection.uvOffset), 0, 1), 'vLiquidGlassBackdropUv');\n}\n\nfunction roundedRectSdfNode(point: Node<'vec2'>, halfSize: Node<'vec2'>, radius: Node<'float'>) {\n\tconst q = abs(point).sub(halfSize).add(radius);\n\treturn tslMin(tslMax(q.x, q.y), 0)\n\t\t.add(length(tslMax(q, 0)))\n\t\t.sub(radius) as Node<'float'>;\n}\n\nfunction roundedRectGradientNode(\n\tpoint: Node<'vec2'>,\n\thalfSize: Node<'vec2'>,\n\tradius: Node<'float'>\n) {\n\tconst epsilon = 0.5;\n\tconst dx = roundedRectSdfNode(point.add(vec2(epsilon, 0)), halfSize, radius).sub(\n\t\troundedRectSdfNode(point.sub(vec2(epsilon, 0)), halfSize, radius)\n\t);\n\tconst dy = roundedRectSdfNode(point.add(vec2(0, epsilon)), halfSize, radius).sub(\n\t\troundedRectSdfNode(point.sub(vec2(0, epsilon)), halfSize, radius)\n\t);\n\tconst gradient = vec2(dx, dy);\n\n\treturn gradient.div(tslMax(length(gradient), 0.00001));\n}\n\nfunction getDepthOpacity(thickness: number) {\n\treturn THREE.MathUtils.clamp(thickness, 0, 1) * 0.12;\n}\n\n/**\n * Inverts the stage's ACES curve so the final global output pass preserves a\n * CSS-style tint composite instead of tone-mapping it a second time.\n */\nexport function inverseAcesToneMapping(target: Node<'vec3'>) {\n\tconst inputMatrix = mat3(\n\t\t0.59719,\n\t\t0.35458,\n\t\t0.04823,\n\t\t0.076,\n\t\t0.90834,\n\t\t0.01566,\n\t\t0.0284,\n\t\t0.13383,\n\t\t0.83777\n\t);\n\tconst outputMatrix = mat3(\n\t\t1.60475,\n\t\t-0.53108,\n\t\t-0.07367,\n\t\t-0.10208,\n\t\t1.10813,\n\t\t-0.00605,\n\t\t-0.00327,\n\t\t-0.07276,\n\t\t1.07602\n\t);\n\tconst fittedTarget = tslMax(inverse(outputMatrix).mul(target), 0) as Node<'vec3'>;\n\tconst a = float(1).sub(fittedTarget.mul(0.983729));\n\tconst b = float(0.0245786).sub(fittedTarget.mul(0.983729 * 0.432951));\n\tconst c = float(-0.000090537).sub(fittedTarget.mul(0.238081));\n\tconst discriminant = tslMax(b.mul(b).sub(a.mul(c).mul(4)), 0);\n\tconst fittedInput = b.negate().add(sqrt(discriminant)).div(a.mul(2)) as Node<'vec3'>;\n\tconst transformedInput = inverse(inputMatrix).mul(fittedInput) as Node<'vec3'>;\n\n\t// Saturated UI colors can require a negative scene-linear channel before\n\t// ACES. Clamping it here changes the hue (notably blue -> lavender). The\n\t// output transform clamps only after reversing the matrix/curve, as intended.\n\treturn transformedInput.mul(0.6 / STAGE_TONE_MAPPING_EXPOSURE) as Node<'vec3'>;\n}\n\nfunction getDepthColor(tint: ColorRepresentation) {\n\treturn new THREE.Color(tint).lerp(new THREE.Color(0x101820), 0.72);\n}\n\nfunction getSpecularColor(tint: ColorRepresentation, tintOpacity: number) {\n\tconst tintColor = new THREE.Color(tint);\n\tconst tintDarkness = 1 - Math.max(tintColor.r, tintColor.g, tintColor.b);\n\tconst tintInfluence = THREE.MathUtils.clamp(tintOpacity + tintDarkness * 0.55, 0, 1);\n\n\treturn new THREE.Color(0xffffff).lerp(tintColor, tintInfluence);\n}\n\nfunction createVertexAlphaMaterial(\n\tcolor: ColorRepresentation,\n\topacity: number,\n\tblending: typeof THREE.NormalBlending | typeof THREE.AdditiveBlending = THREE.NormalBlending\n) {\n\tconst material = new THREE.MeshBasicMaterial({\n\t\tblending,\n\t\tcolor,\n\t\tdepthTest: false,\n\t\tdepthWrite: false,\n\t\topacity,\n\t\tside: THREE.DoubleSide,\n\t\ttransparent: true,\n\t\tvertexColors: true\n\t});\n\tmaterial.toneMapped = false;\n\n\treturn material;\n}\n\nconst roundedGridVertices = new WeakMap<THREE.BufferGeometry, Int32Array>();\n\nfunction createRoundedGridGeometry(\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tcolumns: number,\n\trows: number,\n\tgeometry = new THREE.BufferGeometry(), squareBottom = false\n) {\n\tconst halfWidth = width * 0.5;\n\tconst halfHeight = height * 0.5;\n\tconst r = Math.min(radius, halfWidth, halfHeight);\n\t// Corner cells enter/leave the surface as its size changes. Reserve the full grid\n\t// once, keeping GPU buffer identity while drawRange selects the exact authored mesh.\n\tlet vertexIndex = roundedGridVertices.get(geometry);\n\tif (!vertexIndex) {\n\t\tconst capacity = (columns + 1) * (rows + 1);\n\t\tvertexIndex = new Int32Array(capacity);\n\t\troundedGridVertices.set(geometry, vertexIndex);\n\t\tgeometry.setAttribute(\n\t\t\t'position',\n\t\t\tnew THREE.BufferAttribute(new Float32Array(capacity * 3), 3)\n\t\t);\n\t\tgeometry.setIndex(new THREE.BufferAttribute(new Uint16Array(columns * rows * 6), 1));\n\t\t// Three's WebGPU attribute manager uploads DynamicDrawUsage on every render,\n\t\t// even without a version change. Keep uploads version-driven: actual shape\n\t\t// changes below mark these retained buffers with needsUpdate.\n\t}\n\tvertexIndex.fill(-1);\n\tconst position = geometry.getAttribute('position') as THREE.BufferAttribute;\n\tconst positions = position.array;\n\tconst indexAttribute = geometry.index!;\n\tconst indices = indexAttribute.array;\n\tlet vertexCount = 0;\n\tlet indexCount = 0;\n\n\tconst addVertex = (gridX: number, gridY: number) => {\n\t\tconst key = gridY * (columns + 1) + gridX;\n\t\tconst existing = vertexIndex[key];\n\t\tif (existing !== -1) return existing;\n\n\t\tlet x = -halfWidth + (gridX / columns) * width;\n\t\tlet y = -halfHeight + (gridY / rows) * height;\n\t\tconst cornerRadius = squareBottom && y < 0 ? 0 : r;\n\t\tconst distance = roundedRectSdf(x, y, halfWidth, halfHeight, cornerRadius);\n\n\t\tif (distance > 0) {\n\t\t\tconst gradient = roundedRectGradient(x, y, halfWidth, halfHeight, cornerRadius);\n\t\t\tx -= gradient.x * distance;\n\t\t\ty -= gradient.y * distance;\n\t\t}\n\n\t\tconst index = vertexCount++;\n\t\tpositions[index * 3] = x;\n\t\tpositions[index * 3 + 1] = y;\n\t\tpositions[index * 3 + 2] = 0;\n\t\tvertexIndex[key] = index;\n\n\t\treturn index;\n\t};\n\n\tfor (let y = 0; y < rows; y += 1) {\n\t\tfor (let x = 0; x < columns; x += 1) {\n\t\t\tconst x0 = -halfWidth + (x / columns) * width;\n\t\t\tconst x1 = -halfWidth + ((x + 1) / columns) * width;\n\t\t\tconst y0 = -halfHeight + (y / rows) * height;\n\t\t\tconst y1 = -halfHeight + ((y + 1) / rows) * height;\n\t\t\tconst centerX = -halfWidth + ((x + 0.5) / columns) * width;\n\t\t\tconst centerY = -halfHeight + ((y + 0.5) / rows) * height;\n\t\t\tconst inside = (squareBottom && centerY < 0) ||\n\t\t\t\troundedRectSdf(centerX, centerY, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x0, y0, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x1, y0, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x0, y1, halfWidth, halfHeight, r) <= 0 ||\n\t\t\t\troundedRectSdf(x1, y1, halfWidth, halfHeight, r) <= 0;\n\n\t\t\tif (!inside) continue;\n\n\t\t\tconst a = addVertex(x, y);\n\t\t\tconst b = addVertex(x + 1, y);\n\t\t\tconst c = addVertex(x, y + 1);\n\t\t\tconst d = addVertex(x + 1, y + 1);\n\t\t\tindices[indexCount++] = a;\n\t\t\tindices[indexCount++] = b;\n\t\t\tindices[indexCount++] = c;\n\t\t\tindices[indexCount++] = b;\n\t\t\tindices[indexCount++] = d;\n\t\t\tindices[indexCount++] = c;\n\t\t}\n\t}\n\n\tpositions.fill(0, vertexCount * 3);\n\tindices.fill(0, indexCount);\n\tgeometry.setDrawRange(0, indexCount);\n\tposition.needsUpdate = true;\n\tindexAttribute.needsUpdate = true;\n\tgeometry.computeVertexNormals();\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n\n\treturn geometry;\n}\n\nfunction createRoundedBandGeometry(\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tspread: number,\n\trings: number,\n\talphaPower: number, squareBottom = false\n) {\n\tconst positions: number[] = [];\n\tconst colors: number[] = [];\n\tconst indices: number[] = [];\n\tconst pointsPerRing = 96;\n\n\tfor (let ring = 0; ring <= rings; ring += 1) {\n\t\tconst t = ring / rings;\n\t\tconst offset = spread * t;\n\t\tconst ringWidth = Math.max(1, width + offset * 2);\n\t\tconst ringHeight = Math.max(1, height + offset * 2);\n\t\tconst ringRadius = Math.max(0, Math.min(radius + offset, ringWidth * 0.5, ringHeight * 0.5));\n\t\tconst alpha = Math.pow(1 - t, alphaPower);\n\t\tconst points = createRoundedRectPoints(ringWidth, ringHeight, ringRadius, pointsPerRing / 4, squareBottom);\n\n\t\tpoints.forEach(({ x, y }) => {\n\t\t\tpositions.push(x, y, 0);\n\t\t\tcolors.push(1, 1, 1, alpha);\n\t\t});\n\t}\n\n\tfor (let ring = 0; ring < rings; ring += 1) {\n\t\tconst current = ring * pointsPerRing;\n\t\tconst next = (ring + 1) * pointsPerRing;\n\n\t\tfor (let index = 0; index < pointsPerRing; index += 1) {\n\t\t\tconst a = current + index;\n\t\t\tconst b = current + ((index + 1) % pointsPerRing);\n\t\t\tconst c = next + index;\n\t\t\tconst d = next + ((index + 1) % pointsPerRing);\n\t\t\tindices.push(a, b, c, b, d, c);\n\t\t}\n\t}\n\n\tconst geometry = new THREE.BufferGeometry();\n\tgeometry.setIndex(indices);\n\tgeometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3));\n\tgeometry.setAttribute('color', new THREE.Float32BufferAttribute(colors, 4));\n\tgeometry.computeVertexNormals();\n\n\treturn geometry;\n}\n\nfunction createRoundedRectPoints(\n\twidth: number,\n\theight: number,\n\tradius: number,\n\tsegmentsPerCorner: number, squareBottom = false\n) {\n\tconst halfWidth = width * 0.5;\n\tconst halfHeight = height * 0.5;\n\tconst r = Math.min(radius, halfWidth, halfHeight);\n\tconst corners = [\n\t\t{ x: halfWidth - r, y: halfHeight - r, start: Math.PI * 0.5, end: 0 },\n\t\t{ x: halfWidth - r, y: -halfHeight + r, start: 0, end: -Math.PI * 0.5 },\n\t\t{ x: -halfWidth + r, y: -halfHeight + r, start: -Math.PI * 0.5, end: -Math.PI },\n\t\t{ x: -halfWidth + r, y: halfHeight - r, start: Math.PI, end: Math.PI * 0.5 }\n\t];\n\tconst points: { x: number; y: number }[] = [];\n\n\tcorners.forEach((corner, index) => {\n\t\tconst square = squareBottom && (index === 1 || index === 2);\n\t\tfor (let step = 0; step < segmentsPerCorner; step += 1) {\n\t\t\tconst t = step / segmentsPerCorner;\n\t\t\tconst angle = THREE.MathUtils.lerp(corner.start, corner.end, t);\n\t\t\tpoints.push({\n\t\t\t\tx: square ? (index === 1 ? halfWidth : -halfWidth) : corner.x + Math.cos(angle) * r,\n\t\t\t\ty: square ? -halfHeight : corner.y + Math.sin(angle) * r\n\t\t\t});\n\t\t}\n\t});\n\n\treturn points;\n}\n\nfunction roundedRectSdf(\n\tx: number,\n\ty: number,\n\thalfWidth: number,\n\thalfHeight: number,\n\tradius: number\n) {\n\tconst qx = Math.abs(x) - halfWidth + radius;\n\tconst qy = Math.abs(y) - halfHeight + radius;\n\treturn Math.min(Math.max(qx, qy), 0) + Math.hypot(Math.max(qx, 0), Math.max(qy, 0)) - radius;\n}\n\nfunction roundedRectGradient(\n\tx: number,\n\ty: number,\n\thalfWidth: number,\n\thalfHeight: number,\n\tradius: number\n) {\n\tconst eps = 0.5;\n\tconst dx =\n\t\troundedRectSdf(x + eps, y, halfWidth, halfHeight, radius) -\n\t\troundedRectSdf(x - eps, y, halfWidth, halfHeight, radius);\n\tconst dy =\n\t\troundedRectSdf(x, y + eps, halfWidth, halfHeight, radius) -\n\t\troundedRectSdf(x, y - eps, halfWidth, halfHeight, radius);\n\tconst length = Math.hypot(dx, dy) || 1;\n\n\treturn { x: dx / length, y: dy / length };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapController.d.ts","sourceRoot":"","sources":["../../src/stage/MinimapController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAyBtC,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,OAAO,CAAC;AAC5C,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,uBAAuB,CAAC;AAqC/B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EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAkHzF,qBAAqB,CACpB,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM;IAwCd,uBAAuB,CACtB,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,kBAAkB,EAC/B,eAAe,EAAE,MAAM;IAkDxB,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;IAgCzD,6BAA6B,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM;IASzE,iBAAiB,CAAC,OAAO,EAAE,iBAAiB;IA8B5C,yBAAyB,CAAC,OAAO,EAAE,iBAAiB;IAsBpD,2BAA2B,CAAC,OAAO,EAAE,iBAAiB;CAkBtD"}
|
|
@@ -6,7 +6,7 @@ import { inverseAcesToneMapping, STAGE_TONE_MAPPING_EXPOSURE } from './LiquidGla
|
|
|
6
6
|
import { MinimapBlurPipeline } from './MinimapBlurPipeline.js';
|
|
7
7
|
import { MINIMAP_DEFAULT_CONTEXT_COLOR, MINIMAP_DEFAULT_CONTEXT_OPACITY, MINIMAP_DEFAULT_EXPANDED_HEIGHT, MINIMAP_DEFAULT_HOVER_MODEL_SCALE, MINIMAP_DEFAULT_OVERLAY_BLUR, MINIMAP_MIN_BLUR_GUARD, MINIMAP_MODEL_RENDER_ORDER, MINIMAP_OVERLAY_Z, MINIMAP_PANEL_Z, MINIMAP_POINTER_MODEL_LIFT, MINIMAP_VIEWPORT_BORDER_THICKNESS, PANEL_CAMERA_FOV } from './stageConstants.js';
|
|
8
8
|
import { getMinimapHoverScale, resolveMinimapModelScale, smoothstep } from './stageMath.js';
|
|
9
|
-
import { getMinimapDockedQuaternion, getMinimapModelFitScale, getMinimapModelRadius, getMinimapRestQuaternion, getMinimapTopAlignmentOffset, getMinimapLeftAlignmentOffset } from './minimap/MinimapModelGeometry.js';
|
|
9
|
+
import { getMinimapDockedQuaternion, getMinimapModelFitScale, getMinimapModelRadius, getMinimapRestQuaternion, getMinimapTopAlignmentOffset, getMinimapDockAlignmentOffset, getMinimapLeftAlignmentOffset } from './minimap/MinimapModelGeometry.js';
|
|
10
10
|
import { addMinimapBlurLights, disposeMinimapModelMaterials, prepareMinimapModel } from './minimap/MinimapModel.js';
|
|
11
11
|
import { createMinimapPanelGeometry, createMinimapViewportRingGeometry, getMinimapViewportCornerRadii, updateMinimapPanelGeometry, updateMinimapViewportRingGeometry } from './minimap/MinimapGeometry.js';
|
|
12
12
|
import { getMinimapDepthRange, getMinimapCssBlurRadius, getMinimapViewportRect, clipMinimapViewportRect, getPanelLocalCameraFov } from './minimap/MinimapProjection.js';
|
|
@@ -524,7 +524,9 @@ export class MinimapController {
|
|
|
524
524
|
minimap.displayModel.position.set(0, 0, modelZ);
|
|
525
525
|
}
|
|
526
526
|
alignMinimapModelToDockTop(minimap) {
|
|
527
|
-
|
|
527
|
+
// Zoom moves the complete minimap panel. Never pull its model back toward
|
|
528
|
+
// the scroll dock while the panel is travelling to its zoom destination.
|
|
529
|
+
if (this.ports.frame().fullscreen || (this.ports.frame().minimapFocus ?? 0) > 0)
|
|
528
530
|
return;
|
|
529
531
|
const targetTop = this.ports.target(minimap.panelIndex)?.getMinimapModelTop?.();
|
|
530
532
|
if (targetTop === undefined || !Number.isFinite(targetTop))
|
|
@@ -537,8 +539,12 @@ export class MinimapController {
|
|
|
537
539
|
return;
|
|
538
540
|
// Blend from the ordinary rail pose throughout the existing scroll morph.
|
|
539
541
|
// Once the model reaches the viewport edge, do not let any corner cross it.
|
|
540
|
-
const
|
|
541
|
-
minimap.displayModel.position.y +=
|
|
542
|
+
const centerY = this.ports.target(minimap.panelIndex)?.getMinimapModelCenterY?.() ?? targetTop;
|
|
543
|
+
minimap.displayModel.position.y += getMinimapDockAlignmentOffset(minimap.modelBoundsPoints, minimap.displayModel.matrixWorld, minimap.screenCamera, window.innerHeight, targetTop, centerY, minimap.layer.matrixWorld) * progress;
|
|
544
|
+
minimap.displayModel.updateWorldMatrix(true, true);
|
|
545
|
+
if ((this.getProjectedMinimapModelRect(minimap)?.y ?? targetTop) < targetTop) {
|
|
546
|
+
minimap.displayModel.position.y += getMinimapTopAlignmentOffset(minimap.modelBoundsPoints, minimap.displayModel.matrixWorld, minimap.screenCamera, window.innerHeight, targetTop, minimap.layer.matrixWorld);
|
|
547
|
+
}
|
|
542
548
|
minimap.displayModel.updateWorldMatrix(true, true);
|
|
543
549
|
const safeLeft = this.ports.target(minimap.panelIndex)?.getMinimapModelLeft?.() ?? 0;
|
|
544
550
|
const shift = getMinimapLeftAlignmentOffset(minimap.modelBoundsPoints, minimap.displayModel.matrixWorld, minimap.screenCamera, window.innerWidth, safeLeft);
|