@spatial-elements/core 1.0.0-beta.4 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/catalog/CarouselGlassCompositor.d.ts +7 -2
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.js +85 -24
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
- package/dist/catalog/CarouselGround.d.ts +21 -0
- package/dist/catalog/CarouselGround.d.ts.map +1 -0
- package/dist/catalog/CarouselGround.js +107 -0
- package/dist/catalog/CarouselGround.js.map +1 -0
- package/dist/catalog/CatalogDepthBlur.d.ts +26 -0
- package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
- package/dist/catalog/CatalogDepthBlur.js +87 -0
- package/dist/catalog/CatalogDepthBlur.js.map +1 -0
- package/dist/catalog/CatalogModelOutline.d.ts +31 -0
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
- package/dist/catalog/CatalogModelOutline.js +127 -0
- package/dist/catalog/CatalogModelOutline.js.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +29 -2
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +170 -41
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +49 -4
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
- package/dist/catalog/SpatialGeometryCapture.js +11 -1
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
- package/dist/catalog/cardModelFit.d.ts +7 -0
- package/dist/catalog/cardModelFit.d.ts.map +1 -0
- package/dist/catalog/cardModelFit.js +16 -0
- package/dist/catalog/cardModelFit.js.map +1 -0
- package/dist/catalog/cardProjection.d.ts +8 -0
- package/dist/catalog/cardProjection.d.ts.map +1 -0
- package/dist/catalog/cardProjection.js +51 -0
- package/dist/catalog/cardProjection.js.map +1 -0
- package/dist/catalog/carouselMotion.d.ts +35 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -1
- package/dist/catalog/carouselMotion.js +85 -4
- package/dist/catalog/carouselMotion.js.map +1 -1
- package/dist/catalog/carouselProximity.d.ts +11 -0
- package/dist/catalog/carouselProximity.d.ts.map +1 -0
- package/dist/catalog/carouselProximity.js +13 -0
- package/dist/catalog/carouselProximity.js.map +1 -0
- package/dist/catalog/carouselSupport.d.ts +4 -0
- package/dist/catalog/carouselSupport.d.ts.map +1 -0
- package/dist/catalog/carouselSupport.js +30 -0
- package/dist/catalog/carouselSupport.js.map +1 -0
- package/dist/catalog/catalogPose.d.ts +36 -6
- package/dist/catalog/catalogPose.d.ts.map +1 -1
- package/dist/catalog/catalogPose.js +79 -23
- package/dist/catalog/catalogPose.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +29 -2
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +2 -0
- package/dist/spatial-element/messages.d.ts.map +1 -1
- package/dist/spatial-element/messages.js +1 -1
- package/dist/spatial-element/messages.js.map +1 -1
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -1
- package/dist/spatial-element/spatialTheme.js +1 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -1
- package/dist/spatial-element/types.d.ts +2 -0
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/LiquidGlassPanel.d.ts +2 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +8 -1
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +3 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +23 -20
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/PageBindingController.d.ts +4 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +15 -4
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +1 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +38 -7
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +2 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +23 -5
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +58 -1
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +112 -19
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageFullscreenController.d.ts +17 -0
- package/dist/stage/StageFullscreenController.d.ts.map +1 -0
- package/dist/stage/StageFullscreenController.js +90 -0
- package/dist/stage/StageFullscreenController.js.map +1 -0
- package/dist/stage/StageRenderPipeline.d.ts +6 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +46 -65
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +6 -0
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/interactionOutline.d.ts +14 -0
- package/dist/stage/interactionOutline.d.ts.map +1 -0
- package/dist/stage/interactionOutline.js +81 -0
- package/dist/stage/interactionOutline.js.map +1 -0
- package/dist/stage/minimap/MinimapProjection.d.ts +7 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapProjection.js +14 -13
- package/dist/stage/minimap/MinimapProjection.js.map +1 -1
- package/dist/stage/panelContext.d.ts +9 -0
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/stageDom.d.ts +2 -0
- package/dist/stage/stageDom.d.ts.map +1 -1
- package/dist/stage/stageDom.js +4 -0
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +2 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Keeps native fullscreen, browser Escape and the viewport fallback in sync. */
|
|
2
|
+
export declare class StageFullscreenController {
|
|
3
|
+
private readonly element;
|
|
4
|
+
private readonly changed;
|
|
5
|
+
private active;
|
|
6
|
+
private native;
|
|
7
|
+
private disposed;
|
|
8
|
+
private restore?;
|
|
9
|
+
private returnFocus?;
|
|
10
|
+
constructor(element: HTMLElement, changed: (active: boolean) => void);
|
|
11
|
+
setFullscreen(active: boolean): void;
|
|
12
|
+
private leave;
|
|
13
|
+
private readonly fullscreenChanged;
|
|
14
|
+
private readonly keydown;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=StageFullscreenController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageFullscreenController.d.ts","sourceRoot":"","sources":["../../src/stage/StageFullscreenController.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,qBAAa,yBAAyB;IAMzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAe,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL3E,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAC,CAAa;IAC7B,OAAO,CAAC,WAAW,CAAC,CAAc;gBACL,OAAO,EAAE,WAAW,EAAmB,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI;IAItG,aAAa,CAAC,MAAM,EAAE,OAAO;IAmC7B,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAGhC;IACF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAKtB;IACF,OAAO;CAMP"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Keeps native fullscreen, browser Escape and the viewport fallback in sync. */
|
|
2
|
+
export class StageFullscreenController {
|
|
3
|
+
element;
|
|
4
|
+
changed;
|
|
5
|
+
active = false;
|
|
6
|
+
native = false;
|
|
7
|
+
disposed = false;
|
|
8
|
+
restore;
|
|
9
|
+
returnFocus;
|
|
10
|
+
constructor(element, changed) {
|
|
11
|
+
this.element = element;
|
|
12
|
+
this.changed = changed;
|
|
13
|
+
document.addEventListener('fullscreenchange', this.fullscreenChanged);
|
|
14
|
+
window.addEventListener('keydown', this.keydown);
|
|
15
|
+
}
|
|
16
|
+
setFullscreen(active) {
|
|
17
|
+
if (this.disposed || active === this.active)
|
|
18
|
+
return;
|
|
19
|
+
if (!active) {
|
|
20
|
+
this.leave();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.returnFocus = document.activeElement instanceof HTMLElement ? document.activeElement : undefined;
|
|
24
|
+
const scroll = { left: window.scrollX, top: window.scrollY, behavior: 'instant' };
|
|
25
|
+
const roots = [document.documentElement, document.body];
|
|
26
|
+
const styles = roots.map((root) => [root.style.getPropertyValue('overflow'), root.style.getPropertyPriority('overflow')]);
|
|
27
|
+
roots.forEach((root) => root.style.setProperty('overflow', 'hidden', 'important'));
|
|
28
|
+
this.restore = () => {
|
|
29
|
+
roots.forEach((root, index) => {
|
|
30
|
+
const [value, priority] = styles[index];
|
|
31
|
+
if (value)
|
|
32
|
+
root.style.setProperty('overflow', value, priority);
|
|
33
|
+
else
|
|
34
|
+
root.style.removeProperty('overflow');
|
|
35
|
+
});
|
|
36
|
+
window.scrollTo(scroll);
|
|
37
|
+
};
|
|
38
|
+
this.active = true;
|
|
39
|
+
this.element.setAttribute('data-stage-fullscreen', '');
|
|
40
|
+
this.changed(true);
|
|
41
|
+
// Call within the click's user activation. Missing/denied APIs retain the
|
|
42
|
+
// same renderer and controls in the viewport fallback.
|
|
43
|
+
try {
|
|
44
|
+
if (!this.element.requestFullscreen || document.fullscreenEnabled === false)
|
|
45
|
+
return;
|
|
46
|
+
void this.element.requestFullscreen().then(() => {
|
|
47
|
+
if (this.disposed || !this.active) {
|
|
48
|
+
if (document.fullscreenElement === this.element)
|
|
49
|
+
void document.exitFullscreen().catch(() => { });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.native = document.fullscreenElement === this.element;
|
|
53
|
+
}).catch(() => { });
|
|
54
|
+
}
|
|
55
|
+
catch { /* Older implementations may throw synchronously. */ }
|
|
56
|
+
}
|
|
57
|
+
leave() {
|
|
58
|
+
if (!this.active)
|
|
59
|
+
return;
|
|
60
|
+
this.active = false;
|
|
61
|
+
this.native = false;
|
|
62
|
+
this.element.removeAttribute('data-stage-fullscreen');
|
|
63
|
+
this.restore?.();
|
|
64
|
+
this.restore = undefined;
|
|
65
|
+
this.changed(false);
|
|
66
|
+
if (document.fullscreenElement === this.element)
|
|
67
|
+
void document.exitFullscreen().catch(() => { });
|
|
68
|
+
if (!this.disposed && this.returnFocus?.isConnected)
|
|
69
|
+
this.returnFocus.focus({ preventScroll: true });
|
|
70
|
+
}
|
|
71
|
+
fullscreenChanged = () => {
|
|
72
|
+
if (document.fullscreenElement === this.element)
|
|
73
|
+
this.native = true;
|
|
74
|
+
else if (this.native)
|
|
75
|
+
this.setFullscreen(false);
|
|
76
|
+
};
|
|
77
|
+
keydown = (event) => {
|
|
78
|
+
if (event.key === 'Escape' && !event.defaultPrevented && this.active && !document.fullscreenElement) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
this.setFullscreen(false);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
dispose() {
|
|
84
|
+
this.disposed = true;
|
|
85
|
+
this.leave();
|
|
86
|
+
document.removeEventListener('fullscreenchange', this.fullscreenChanged);
|
|
87
|
+
window.removeEventListener('keydown', this.keydown);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=StageFullscreenController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageFullscreenController.js","sourceRoot":"","sources":["../../src/stage/StageFullscreenController.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,OAAO,yBAAyB;IAMR;IAAuC;IAL5D,MAAM,GAAG,KAAK,CAAC;IACf,MAAM,GAAG,KAAK,CAAC;IACf,QAAQ,GAAG,KAAK,CAAC;IACjB,OAAO,CAAc;IACrB,WAAW,CAAe;IAClC,YAA6B,OAAoB,EAAmB,OAAkC;QAAzE,YAAO,GAAP,OAAO,CAAa;QAAmB,YAAO,GAAP,OAAO,CAA2B;QACrG,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtE,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IACD,aAAa,CAAC,MAAe;QAC5B,IAAI,IAAI,CAAC,QAAQ,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO;QACpD,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,OAAO;QACR,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,aAAa,YAAY,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;QACtG,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EA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AAG,GAAG,EAAE;QACzC,IAAI,QAAQ,CAAC,iBAAiB,KAAK,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aAC/D,IAAI,IAAI,CAAC,MAAM;YAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC,CAAC;IACe,OAAO,GAAG,CAAC,KAAoB,EAAE,EAAE;QACnD,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;YACrG,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC,CAAC;IACF,OAAO;QACN,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACzE,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;CACD","sourcesContent":["/** Keeps native fullscreen, browser Escape and the viewport fallback in sync. */\nexport class StageFullscreenController {\n\tprivate active = false;\n\tprivate native = false;\n\tprivate disposed = false;\n\tprivate restore?: () => void;\n\tprivate returnFocus?: HTMLElement;\n\tconstructor(private readonly element: HTMLElement, private readonly changed: (active: boolean) => void) {\n\t\tdocument.addEventListener('fullscreenchange', this.fullscreenChanged);\n\t\twindow.addEventListener('keydown', this.keydown);\n\t}\n\tsetFullscreen(active: boolean) {\n\t\tif (this.disposed || active === this.active) return;\n\t\tif (!active) {\n\t\t\tthis.leave();\n\t\t\treturn;\n\t\t}\n\t\tthis.returnFocus = document.activeElement instanceof HTMLElement ? document.activeElement : undefined;\n\t\tconst scroll = { left: window.scrollX, top: window.scrollY, behavior: 'instant' as const };\n\t\tconst roots = [document.documentElement, document.body];\n\t\tconst styles = roots.map((root) => [root.style.getPropertyValue('overflow'), root.style.getPropertyPriority('overflow')]);\n\t\troots.forEach((root) => root.style.setProperty('overflow', 'hidden', 'important'));\n\t\tthis.restore = () => {\n\t\t\troots.forEach((root, index) => {\n\t\t\t\tconst [value, priority] = styles[index];\n\t\t\t\tif (value) root.style.setProperty('overflow', value, priority);\n\t\t\t\telse root.style.removeProperty('overflow');\n\t\t\t});\n\t\t\twindow.scrollTo(scroll);\n\t\t};\n\t\tthis.active = true;\n\t\tthis.element.setAttribute('data-stage-fullscreen', '');\n\t\tthis.changed(true);\n\t\t// Call within the click's user activation. Missing/denied APIs retain the\n\t\t// same renderer and controls in the viewport fallback.\n\t\ttry {\n\t\t\tif (!this.element.requestFullscreen || document.fullscreenEnabled === false) return;\n\t\t\tvoid this.element.requestFullscreen().then(() => {\n\t\t\t\tif (this.disposed || !this.active) {\n\t\t\t\t\tif (document.fullscreenElement === this.element) void document.exitFullscreen().catch(() => {});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.native = document.fullscreenElement === this.element;\n\t\t\t}).catch(() => { /* Keep the viewport fallback. */ });\n\t\t} catch { /* Older implementations may throw synchronously. */ }\n\t}\n\tprivate leave() {\n\t\tif (!this.active) return;\n\t\tthis.active = false;\n\t\tthis.native = false;\n\t\tthis.element.removeAttribute('data-stage-fullscreen');\n\t\tthis.restore?.();\n\t\tthis.restore = undefined;\n\t\tthis.changed(false);\n\t\tif (document.fullscreenElement === this.element) void document.exitFullscreen().catch(() => {});\n\t\tif (!this.disposed && this.returnFocus?.isConnected) this.returnFocus.focus({ preventScroll: true });\n\t}\n\tprivate readonly fullscreenChanged = () => {\n\t\tif (document.fullscreenElement === this.element) this.native = true;\n\t\telse if (this.native) this.setFullscreen(false);\n\t};\n\tprivate readonly keydown = (event: KeyboardEvent) => {\n\t\tif (event.key === 'Escape' && !event.defaultPrevented && this.active && !document.fullscreenElement) {\n\t\t\tevent.preventDefault();\n\t\t\tthis.setFullscreen(false);\n\t\t}\n\t};\n\tdispose() {\n\t\tthis.disposed = true;\n\t\tthis.leave();\n\t\tdocument.removeEventListener('fullscreenchange', this.fullscreenChanged);\n\t\twindow.removeEventListener('keydown', this.keydown);\n\t}\n}\n"]}
|
|
@@ -95,6 +95,10 @@ export declare class StageRenderPipeline {
|
|
|
95
95
|
private readonly backgroundCoverMaterial;
|
|
96
96
|
private readonly backgroundCover;
|
|
97
97
|
private readonly outlineMaskScene;
|
|
98
|
+
private readonly outlineColor;
|
|
99
|
+
private readonly outlineStrength;
|
|
100
|
+
private readonly outlineGlow;
|
|
101
|
+
updateInteractionTheme(): void;
|
|
98
102
|
private _minimapOverlayCapturePasses;
|
|
99
103
|
private _renderTargetSetCreations;
|
|
100
104
|
private _renderTargetSetResizes;
|
|
@@ -153,6 +157,8 @@ export declare class StageRenderPipeline {
|
|
|
153
157
|
private resizeCanvasTarget;
|
|
154
158
|
private createPanelBlurCapture;
|
|
155
159
|
private getPanelBlurKey;
|
|
160
|
+
/** Allocate changed blur settings without replacing the scene capture or model resources. */
|
|
161
|
+
syncPanelBlurCaptures(): void;
|
|
156
162
|
getPanelBlurTexture(options: LiquidGlassPanelOptions, targets?: StageRenderTargetSet | undefined): THREE.Texture<unknown, THREE.TextureEventMap>;
|
|
157
163
|
/** Prepare hidden close-up effects during page binding, never during camera motion.
|
|
158
164
|
* Captures stay invalid: the first visible frame must still sample the live element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageRenderPipeline.d.ts","sourceRoot":"","sources":["../../src/stage/StageRenderPipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StageRenderPipeline.d.ts","sourceRoot":"","sources":["../../src/stage/StageRenderPipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIrE,OAAO,KAAK,EAAE,iB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;IACD,IAAI,wBAAwB,WAE3B;IAED,qFAAqF;IACrF,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;CAuBlD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createOutlineOpacity } from './interactionOutline.js';
|
|
1
2
|
import { getRefinementSize } from './SpatialElementRefinement.js';
|
|
2
3
|
import { getMinimapMeasurementMode } from './minimapMeasurement.js';
|
|
3
4
|
import { parseRenderMeasurement } from './renderMeasurement.js';
|
|
@@ -7,7 +8,7 @@ import * as THREE from 'three/webgpu';
|
|
|
7
8
|
import { CatalogSpatialElementLayer } from '../catalog/CatalogSpatialElementLayer.js';
|
|
8
9
|
import { SpatialGeometryCapture } from '../catalog/SpatialGeometryCapture.js';
|
|
9
10
|
import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
|
|
10
|
-
import { Fn,
|
|
11
|
+
import { Fn, If, mix, premultiplyAlpha, texture, uniform, uv, vec4 } from 'three/tsl';
|
|
11
12
|
import { inverseAcesToneMapping, STAGE_TONE_MAPPING_EXPOSURE } from './LiquidGlassPanel.js';
|
|
12
13
|
import { isMesh } from './stageSceneUtils.js';
|
|
13
14
|
import { getStageRenderPixelRatio, resolveStageRenderSettings } from './renderSettings.js';
|
|
@@ -32,6 +33,8 @@ export class StageRenderPipeline {
|
|
|
32
33
|
const targets = this._activeRenderTargets;
|
|
33
34
|
if (!targets)
|
|
34
35
|
return false;
|
|
36
|
+
// Never bake the old screen-space halo into the outgoing background snapshot.
|
|
37
|
+
this.displayOutlineOpacity.value = 0;
|
|
35
38
|
withRendererState(this.ports.renderer, () => {
|
|
36
39
|
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
37
40
|
this.ports.renderer.setRenderTarget(targets.sceneCapture);
|
|
@@ -113,6 +116,7 @@ export class StageRenderPipeline {
|
|
|
113
116
|
}
|
|
114
117
|
constructor(ports) {
|
|
115
118
|
this.ports = ports;
|
|
119
|
+
this.updateInteractionTheme();
|
|
116
120
|
this.setRenderSettings(ports.renderSettings);
|
|
117
121
|
this.setPageBackground(ports.pageBackground ?? '#ffffff');
|
|
118
122
|
this.backgroundCoverMaterial.fragmentNode = premultiplyAlpha(vec4(inverseAcesToneMapping(this.backgroundCoverColor), this.backgroundCoverOpacity));
|
|
@@ -130,6 +134,16 @@ export class StageRenderPipeline {
|
|
|
130
134
|
backgroundCoverMaterial = new THREE.NodeMaterial();
|
|
131
135
|
backgroundCover = new THREE.QuadMesh(this.backgroundCoverMaterial);
|
|
132
136
|
outlineMaskScene = new THREE.Scene();
|
|
137
|
+
outlineColor = uniform(new THREE.Color());
|
|
138
|
+
outlineStrength = uniform(1);
|
|
139
|
+
outlineGlow = uniform(1);
|
|
140
|
+
updateInteractionTheme() {
|
|
141
|
+
const theme = this.ports.interactionTheme();
|
|
142
|
+
this.outlineColor.value.set(theme.outlineColor);
|
|
143
|
+
this.outlineStrength.value = theme.outlineOpacity;
|
|
144
|
+
this.outlineGlow.value = theme.outlineGlow;
|
|
145
|
+
this.resizeOutline(this.outlineWidth, this.outlineHeight);
|
|
146
|
+
}
|
|
133
147
|
_minimapOverlayCapturePasses = 0;
|
|
134
148
|
_renderTargetSetCreations = 0;
|
|
135
149
|
_renderTargetSetResizes = 0;
|
|
@@ -254,67 +268,10 @@ export class StageRenderPipeline {
|
|
|
254
268
|
return source;
|
|
255
269
|
}
|
|
256
270
|
createOutlineOpacity(mask) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const centerUv = uv();
|
|
262
|
-
const sampleX = sampleTexel.x.mul(scale);
|
|
263
|
-
const sampleY = sampleTexel.y.mul(scale);
|
|
264
|
-
const left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;
|
|
265
|
-
const right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;
|
|
266
|
-
const up = mask.sample(centerUv.add(vec2(0, sampleY))).r;
|
|
267
|
-
const down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;
|
|
268
|
-
const upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;
|
|
269
|
-
const upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;
|
|
270
|
-
const downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;
|
|
271
|
-
const downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;
|
|
272
|
-
return {
|
|
273
|
-
average: left
|
|
274
|
-
.add(right)
|
|
275
|
-
.add(up)
|
|
276
|
-
.add(down)
|
|
277
|
-
.add(upLeft)
|
|
278
|
-
.add(upRight)
|
|
279
|
-
.add(downLeft)
|
|
280
|
-
.add(downRight)
|
|
281
|
-
.div(8),
|
|
282
|
-
max: tslMax(tslMax(tslMax(left, right), tslMax(up, down)), tslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))),
|
|
283
|
-
min: tslMin(tslMin(tslMin(left, right), tslMin(up, down)), tslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight)))
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
const edgeNeighbor = sampleMaskRing(texel);
|
|
287
|
-
const glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);
|
|
288
|
-
const glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);
|
|
289
|
-
const glowFarNeighbor = sampleMaskRing(glowTexel);
|
|
290
|
-
const center = mask.sample(uv()).r;
|
|
291
|
-
const outside = center.oneMinus();
|
|
292
|
-
const edgeGradient = edgeNeighbor.max.sub(center).max(0);
|
|
293
|
-
const core = edgeGradient.mul(this.ports.interactionTheme().outlineOpacity);
|
|
294
|
-
// Average neighbouring coverage, rather than dilating a solid band. Keep the
|
|
295
|
-
// halo outside the spatialElement so it cannot be mistaken for painted geometry.
|
|
296
|
-
const glowNear = glowNearNeighbor.average
|
|
297
|
-
.mul(outside)
|
|
298
|
-
.mul(this.ports.interactionTheme().outlineGlow * 0.6);
|
|
299
|
-
const glowMid = glowMidNeighbor.average
|
|
300
|
-
.mul(outside)
|
|
301
|
-
.mul(this.ports.interactionTheme().outlineGlow * 0.3);
|
|
302
|
-
const glowFar = glowFarNeighbor.average
|
|
303
|
-
.mul(outside)
|
|
304
|
-
.mul(this.ports.interactionTheme().outlineGlow * 0.1);
|
|
305
|
-
const opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(this.outlineOpacityScale);
|
|
306
|
-
return opacity;
|
|
307
|
-
};
|
|
308
|
-
if (this.renderMeasurement === 'halo-unconditional')
|
|
309
|
-
return calculate();
|
|
310
|
-
return Fn(() => {
|
|
311
|
-
const opacity = float(0).toVar();
|
|
312
|
-
// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.
|
|
313
|
-
If(mask.sample(uv()).r.lessThan(1), () => {
|
|
314
|
-
opacity.assign(calculate());
|
|
315
|
-
});
|
|
316
|
-
return opacity;
|
|
317
|
-
})();
|
|
271
|
+
return createOutlineOpacity(mask, {
|
|
272
|
+
color: this.outlineColor, strength: this.outlineStrength, glow: this.outlineGlow,
|
|
273
|
+
opacityScale: this.outlineOpacityScale, texel: this.outlineTexel, glowTexel: this.outlineGlowTexel
|
|
274
|
+
}, this.renderMeasurement === 'halo-unconditional');
|
|
318
275
|
}
|
|
319
276
|
createOutlineCompositeMaterial(maskTexture) {
|
|
320
277
|
const material = new THREE.MeshBasicNodeMaterial({
|
|
@@ -323,7 +280,7 @@ export class StageRenderPipeline {
|
|
|
323
280
|
depthWrite: false,
|
|
324
281
|
transparent: true
|
|
325
282
|
});
|
|
326
|
-
material.colorNode =
|
|
283
|
+
material.colorNode = this.outlineColor;
|
|
327
284
|
material.opacityNode = this.createOutlineOpacity(texture(maskTexture));
|
|
328
285
|
material.toneMapped = false;
|
|
329
286
|
return material;
|
|
@@ -355,7 +312,7 @@ export class StageRenderPipeline {
|
|
|
355
312
|
if (this.fuseOutline) {
|
|
356
313
|
this.emptyOutlineMask.needsUpdate = true;
|
|
357
314
|
const source = this.stageDisplayTextureNode;
|
|
358
|
-
const haloColor =
|
|
315
|
+
const haloColor = this.outlineColor;
|
|
359
316
|
const haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);
|
|
360
317
|
// Merge into the existing linear display pass before the canvas output transform.
|
|
361
318
|
this.stageDisplayMaterial.fragmentNode = Fn(() => {
|
|
@@ -542,6 +499,27 @@ export class StageRenderPipeline {
|
|
|
542
499
|
const value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;
|
|
543
500
|
return Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;
|
|
544
501
|
}
|
|
502
|
+
/** Allocate changed blur settings without replacing the scene capture or model resources. */
|
|
503
|
+
syncPanelBlurCaptures() {
|
|
504
|
+
const keys = new Set(this.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options)));
|
|
505
|
+
if (!this._activeRenderTargets && keys.size)
|
|
506
|
+
this.createSceneCapture();
|
|
507
|
+
for (const targets of [this.fullQualityTargets, this.scrollQualityTargets]) {
|
|
508
|
+
if (!targets)
|
|
509
|
+
continue;
|
|
510
|
+
for (const key of keys)
|
|
511
|
+
if (!targets.panelBlurCaptures.has(key))
|
|
512
|
+
targets.panelBlurCaptures.set(key, this.createPanelBlurCapture(targets.sceneCapture.texture, key, targets.scale));
|
|
513
|
+
for (const [key, capture] of targets.panelBlurCaptures)
|
|
514
|
+
if (!keys.has(key)) {
|
|
515
|
+
capture.target.dispose();
|
|
516
|
+
capture.material.dispose();
|
|
517
|
+
capture.effect?.dispose();
|
|
518
|
+
targets.panelBlurCaptures.delete(key);
|
|
519
|
+
}
|
|
520
|
+
this.resizeRenderTargetSet(targets, window.innerWidth, window.innerHeight, this.getFullPixelRatio());
|
|
521
|
+
}
|
|
522
|
+
}
|
|
545
523
|
getPanelBlurTexture(options, targets = this._activeRenderTargets) {
|
|
546
524
|
const blur = this.getPanelBlurKey(options);
|
|
547
525
|
const capture = targets?.panelBlurCaptures.get(blur);
|
|
@@ -722,7 +700,10 @@ export class StageRenderPipeline {
|
|
|
722
700
|
}
|
|
723
701
|
renderModelOutline(target, opacity = 1) {
|
|
724
702
|
this.displayOutlineOpacity.value = 0;
|
|
725
|
-
|
|
703
|
+
// The transferred model owns its moving outline, including its interpolated camera.
|
|
704
|
+
if (this.ports.spatialCapture?.())
|
|
705
|
+
return;
|
|
706
|
+
if (this.renderMeasurement === 'no-halo' || !this.ports.frame().modelHover)
|
|
726
707
|
return;
|
|
727
708
|
const opacityBefore = this.outlineOpacityScale.value;
|
|
728
709
|
try {
|