@spatial-elements/core 0.1.0-beta.2 → 1.0.0-beta.10
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 +16 -13
- package/dist/catalog/CarouselDeviceCamera.d.ts +20 -0
- package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -0
- package/dist/catalog/CarouselDeviceCamera.js +58 -0
- package/dist/catalog/CarouselDeviceCamera.js.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +14 -3
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.js +164 -28
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
- package/dist/catalog/CarouselGround.d.ts +43 -0
- package/dist/catalog/CarouselGround.d.ts.map +1 -0
- package/dist/catalog/CarouselGround.js +270 -0
- package/dist/catalog/CarouselGround.js.map +1 -0
- package/dist/catalog/CarouselSectionSurfaces.d.ts +10 -0
- package/dist/catalog/CarouselSectionSurfaces.d.ts.map +1 -0
- package/dist/catalog/CarouselSectionSurfaces.js +55 -0
- package/dist/catalog/CarouselSectionSurfaces.js.map +1 -0
- package/dist/catalog/CatalogDepthBlur.d.ts +45 -0
- package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
- package/dist/catalog/CatalogDepthBlur.js +190 -0
- package/dist/catalog/CatalogDepthBlur.js.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts +2 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
- package/dist/catalog/CatalogEndpointRegistry.js +2 -0
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
- package/dist/catalog/CatalogGeometryFade.d.ts +5 -1
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -1
- package/dist/catalog/CatalogGeometryFade.js +45 -9
- package/dist/catalog/CatalogGeometryFade.js.map +1 -1
- package/dist/catalog/CatalogModelOutline.d.ts +33 -0
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
- package/dist/catalog/CatalogModelOutline.js +143 -0
- package/dist/catalog/CatalogModelOutline.js.map +1 -0
- package/dist/catalog/CatalogNavigationRegistry.d.ts +44 -0
- package/dist/catalog/CatalogNavigationRegistry.d.ts.map +1 -0
- package/dist/catalog/CatalogNavigationRegistry.js +66 -0
- package/dist/catalog/CatalogNavigationRegistry.js.map +1 -0
- package/dist/catalog/CatalogPreparation.d.ts +3 -3
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
- package/dist/catalog/CatalogPreparation.js +10 -7
- package/dist/catalog/CatalogPreparation.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +175 -5
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +739 -121
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts +4 -2
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +206 -90
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/CatalogWarmOutputContext.d.ts +39 -0
- package/dist/catalog/CatalogWarmOutputContext.d.ts.map +1 -0
- package/dist/catalog/CatalogWarmOutputContext.js +159 -0
- package/dist/catalog/CatalogWarmOutputContext.js.map +1 -0
- package/dist/catalog/EarlyNavigationCoordinator.d.ts +35 -0
- package/dist/catalog/EarlyNavigationCoordinator.d.ts.map +1 -0
- package/dist/catalog/EarlyNavigationCoordinator.js +103 -0
- package/dist/catalog/EarlyNavigationCoordinator.js.map +1 -0
- package/dist/catalog/NavigationFeedback.d.ts +12 -0
- package/dist/catalog/NavigationFeedback.d.ts.map +1 -0
- package/dist/catalog/NavigationFeedback.js +40 -0
- package/dist/catalog/NavigationFeedback.js.map +1 -0
- package/dist/catalog/PreparationGate.d.ts +4 -0
- package/dist/catalog/PreparationGate.d.ts.map +1 -1
- package/dist/catalog/PreparationGate.js +1 -0
- package/dist/catalog/PreparationGate.js.map +1 -1
- package/dist/catalog/SourceDomClipping.d.ts +8 -0
- package/dist/catalog/SourceDomClipping.d.ts.map +1 -0
- package/dist/catalog/SourceDomClipping.js +74 -0
- package/dist/catalog/SourceDomClipping.js.map +1 -0
- package/dist/catalog/SourceDomMotion.d.ts +28 -0
- package/dist/catalog/SourceDomMotion.d.ts.map +1 -0
- package/dist/catalog/SourceDomMotion.js +111 -0
- package/dist/catalog/SourceDomMotion.js.map +1 -0
- 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/SpatialPageRegistry.d.ts +18 -0
- package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -0
- package/dist/catalog/SpatialPageRegistry.js +21 -0
- package/dist/catalog/SpatialPageRegistry.js.map +1 -0
- package/dist/catalog/StagedCatalogTransition.d.ts +74 -0
- package/dist/catalog/StagedCatalogTransition.d.ts.map +1 -0
- package/dist/catalog/StagedCatalogTransition.js +270 -0
- package/dist/catalog/StagedCatalogTransition.js.map +1 -0
- 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 +39 -0
- package/dist/catalog/cardProjection.d.ts.map +1 -0
- package/dist/catalog/cardProjection.js +110 -0
- package/dist/catalog/cardProjection.js.map +1 -0
- package/dist/catalog/carouselMotion.d.ts +74 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -0
- package/dist/catalog/carouselMotion.js +185 -0
- package/dist/catalog/carouselMotion.js.map +1 -0
- package/dist/catalog/carouselPanelProjection.d.ts.map +1 -1
- package/dist/catalog/carouselPanelProjection.js +48 -11
- package/dist/catalog/carouselPanelProjection.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/catalogActivationFocus.d.ts +5 -0
- package/dist/catalog/catalogActivationFocus.d.ts.map +1 -0
- package/dist/catalog/catalogActivationFocus.js +39 -0
- package/dist/catalog/catalogActivationFocus.js.map +1 -0
- package/dist/catalog/catalogDomSnapshot.d.ts +18 -0
- package/dist/catalog/catalogDomSnapshot.d.ts.map +1 -0
- package/dist/catalog/catalogDomSnapshot.js +51 -0
- package/dist/catalog/catalogDomSnapshot.js.map +1 -0
- package/dist/catalog/catalogJourney.d.ts +4 -1
- package/dist/catalog/catalogJourney.d.ts.map +1 -1
- package/dist/catalog/catalogJourney.js +7 -15
- package/dist/catalog/catalogJourney.js.map +1 -1
- package/dist/catalog/catalogPage.d.ts +7 -3
- package/dist/catalog/catalogPage.d.ts.map +1 -1
- package/dist/catalog/catalogPage.js.map +1 -1
- package/dist/catalog/catalogPose.d.ts +54 -6
- package/dist/catalog/catalogPose.d.ts.map +1 -1
- package/dist/catalog/catalogPose.js +100 -23
- package/dist/catalog/catalogPose.js.map +1 -1
- package/dist/catalog/catalogRecipes.d.ts +3 -2
- package/dist/catalog/catalogRecipes.d.ts.map +1 -1
- package/dist/catalog/catalogRecipes.js +10 -25
- package/dist/catalog/catalogRecipes.js.map +1 -1
- package/dist/catalog/catalogTransitionViewport.d.ts +9 -0
- package/dist/catalog/catalogTransitionViewport.d.ts.map +1 -0
- package/dist/catalog/catalogTransitionViewport.js +13 -0
- package/dist/catalog/catalogTransitionViewport.js.map +1 -0
- package/dist/catalog/catalogViewLink.d.ts +2 -0
- package/dist/catalog/catalogViewLink.d.ts.map +1 -1
- package/dist/catalog/catalogViewLink.js +10 -2
- package/dist/catalog/catalogViewLink.js.map +1 -1
- package/dist/catalog/deviceYaw.d.ts +21 -0
- package/dist/catalog/deviceYaw.d.ts.map +1 -0
- package/dist/catalog/deviceYaw.js +87 -0
- package/dist/catalog/deviceYaw.js.map +1 -0
- package/dist/catalog/listDeviceOrientation.d.ts +17 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
- package/dist/catalog/listDeviceOrientation.js +262 -0
- package/dist/catalog/listDeviceOrientation.js.map +1 -0
- package/dist/catalog/spatialElementAssets.d.ts +5 -5
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -1
- package/dist/catalog/spatialElementAssets.js.map +1 -1
- package/dist/catalog/spatialElementLodPair.d.ts +2 -1
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -1
- package/dist/catalog/spatialElementLodPair.js.map +1 -1
- package/dist/catalog/stagedDetailGeometry.d.ts +37 -0
- package/dist/catalog/stagedDetailGeometry.d.ts.map +1 -0
- package/dist/catalog/stagedDetailGeometry.js +55 -0
- package/dist/catalog/stagedDetailGeometry.js.map +1 -0
- package/dist/catalog/stagedDockGeometry.d.ts +66 -0
- package/dist/catalog/stagedDockGeometry.d.ts.map +1 -0
- package/dist/catalog/stagedDockGeometry.js +66 -0
- package/dist/catalog/stagedDockGeometry.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/spatial-element/ResponsiveViewportMetrics.d.ts +18 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.d.ts.map +1 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.js +68 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.js.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts +2 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js +2 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +22 -10
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +228 -96
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/SpatialElementPaneController.d.ts +67 -0
- package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementPaneController.js +246 -0
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -0
- package/dist/spatial-element/activeDetailSection.d.ts +8 -0
- package/dist/spatial-element/activeDetailSection.d.ts.map +1 -0
- package/dist/spatial-element/activeDetailSection.js +19 -0
- package/dist/spatial-element/activeDetailSection.js.map +1 -0
- package/dist/spatial-element/layoutTokens.json +228 -0
- package/dist/spatial-element/messages.d.ts +34 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +34 -0
- package/dist/spatial-element/messages.js.map +1 -0
- package/dist/spatial-element/responsiveLayout.d.ts +1353 -0
- package/dist/spatial-element/responsiveLayout.d.ts.map +1 -0
- package/dist/spatial-element/responsiveLayout.js +210 -0
- package/dist/spatial-element/responsiveLayout.js.map +1 -0
- package/dist/spatial-element/sectionBackground.d.ts +3 -0
- package/dist/spatial-element/sectionBackground.d.ts.map +1 -0
- package/dist/spatial-element/sectionBackground.js +2 -0
- package/dist/spatial-element/sectionBackground.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +17 -12
- package/dist/spatial-element/spatialElement.d.ts.map +1 -1
- package/dist/spatial-element/spatialElement.js +33 -6
- package/dist/spatial-element/spatialElement.js.map +1 -1
- package/dist/spatial-element/spatialElementDock.d.ts +15 -0
- package/dist/spatial-element/spatialElementDock.d.ts.map +1 -1
- package/dist/spatial-element/spatialElementDock.js +22 -0
- package/dist/spatial-element/spatialElementDock.js.map +1 -1
- package/dist/spatial-element/spatialElementGeometry.d.ts +22 -0
- package/dist/spatial-element/spatialElementGeometry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementGeometry.js +40 -0
- package/dist/spatial-element/spatialElementGeometry.js.map +1 -0
- package/dist/spatial-element/spatialElementMedia.d.ts +16 -0
- package/dist/spatial-element/spatialElementMedia.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementMedia.js +29 -0
- package/dist/spatial-element/spatialElementMedia.js.map +1 -0
- package/dist/spatial-element/spatialElementScene.d.ts +16 -0
- package/dist/spatial-element/spatialElementScene.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementScene.js +22 -0
- package/dist/spatial-element/spatialElementScene.js.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts +6 -25
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -1
- package/dist/spatial-element/spatialElementSectionRegistry.js +6 -63
- package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -1
- package/dist/spatial-element/spatialTheme.d.ts +27 -0
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -0
- package/dist/spatial-element/spatialTheme.js +83 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -0
- package/dist/spatial-element/types.d.ts +117 -36
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/BackgroundLayerOutput.d.ts +76 -0
- package/dist/stage/BackgroundLayerOutput.d.ts.map +1 -0
- package/dist/stage/BackgroundLayerOutput.js +333 -0
- package/dist/stage/BackgroundLayerOutput.js.map +1 -0
- package/dist/stage/DeviceGeometryMotion.d.ts +13 -0
- package/dist/stage/DeviceGeometryMotion.d.ts.map +1 -0
- package/dist/stage/DeviceGeometryMotion.js +37 -0
- package/dist/stage/DeviceGeometryMotion.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +7 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +46 -5
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +4 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +57 -66
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/ModelPointerPreview.d.ts +22 -0
- package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
- package/dist/stage/ModelPointerPreview.js +71 -0
- package/dist/stage/ModelPointerPreview.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +10 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +45 -5
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +21 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +190 -31
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +19 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +134 -13
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/SpatialElementPresentationController.d.ts +14 -2
- package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -1
- package/dist/stage/SpatialElementPresentationController.js +47 -2
- package/dist/stage/SpatialElementPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementRefinement.d.ts +34 -1
- package/dist/stage/SpatialElementRefinement.d.ts.map +1 -1
- package/dist/stage/SpatialElementRefinement.js +175 -37
- package/dist/stage/SpatialElementRefinement.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +263 -10
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +655 -124
- 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/StagePanelRuntime.d.ts +2 -1
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
- package/dist/stage/StagePanelRuntime.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +90 -2
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +494 -119
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts +7 -0
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +63 -6
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/inertLease.d.ts +2 -0
- package/dist/stage/inertLease.d.ts.map +1 -0
- package/dist/stage/inertLease.js +18 -0
- package/dist/stage/inertLease.js.map +1 -0
- package/dist/stage/interactionGuidance.d.ts +22 -0
- package/dist/stage/interactionGuidance.d.ts.map +1 -0
- package/dist/stage/interactionGuidance.js +53 -0
- package/dist/stage/interactionGuidance.js.map +1 -0
- package/dist/stage/interactionOutline.d.ts +14 -0
- package/dist/stage/interactionOutline.d.ts.map +1 -0
- package/dist/stage/interactionOutline.js +59 -0
- package/dist/stage/interactionOutline.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapGeometry.js +29 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -1
- package/dist/stage/minimap/MinimapModel.d.ts +2 -1
- package/dist/stage/minimap/MinimapModel.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapModel.js +34 -4
- package/dist/stage/minimap/MinimapModel.js.map +1 -1
- package/dist/stage/minimap/MinimapModelGeometry.d.ts +21 -0
- package/dist/stage/minimap/MinimapModelGeometry.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapModelGeometry.js +68 -0
- package/dist/stage/minimap/MinimapModelGeometry.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/minimap/MinimapState.d.ts +3 -8
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapState.js.map +1 -1
- package/dist/stage/mouseHover.d.ts +9 -0
- package/dist/stage/mouseHover.d.ts.map +1 -0
- package/dist/stage/mouseHover.js +55 -0
- package/dist/stage/mouseHover.js.map +1 -0
- package/dist/stage/panelContext.d.ts +27 -2
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/renderSettings.d.ts +10 -0
- package/dist/stage/renderSettings.d.ts.map +1 -0
- package/dist/stage/renderSettings.js +27 -0
- package/dist/stage/renderSettings.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +1 -1
- package/dist/stage/renderTargetInventory.js +1 -1
- package/dist/stage/renderTargetInventory.js.map +1 -1
- package/dist/stage/rendererState.d.ts +2 -0
- package/dist/stage/rendererState.d.ts.map +1 -1
- package/dist/stage/rendererState.js +13 -0
- package/dist/stage/rendererState.js.map +1 -1
- package/dist/stage/sceneEndpointEligibility.d.ts +20 -0
- package/dist/stage/sceneEndpointEligibility.d.ts.map +1 -0
- package/dist/stage/sceneEndpointEligibility.js +363 -0
- package/dist/stage/sceneEndpointEligibility.js.map +1 -0
- package/dist/stage/scrollFrame.d.ts +2 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -1
- package/dist/stage/scrollFrame.js +18 -5
- package/dist/stage/scrollFrame.js.map +1 -1
- package/dist/stage/spatialElementFrame.d.ts.map +1 -1
- package/dist/stage/spatialElementFrame.js +5 -1
- package/dist/stage/spatialElementFrame.js.map +1 -1
- package/dist/stage/stageConstants.d.ts +3 -3
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +6 -6
- package/dist/stage/stageConstants.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 +10 -1
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageMath.d.ts +9 -10
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +23 -21
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +30 -3
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +24 -1
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/logo.svg +188 -0
- package/package.json +7 -5
|
@@ -1,15 +1,19 @@
|
|
|
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';
|
|
4
5
|
import { gaussianTargets } from './renderTargetInventory.js';
|
|
5
|
-
import { withRendererState, withVisibility } from './rendererState.js';
|
|
6
|
+
import { clearFullTarget, withRendererState, withVisibility } from './rendererState.js';
|
|
7
|
+
import { BackgroundLayerOutput } from './BackgroundLayerOutput.js';
|
|
8
|
+
import { CatalogWarmOutputContext } from '../catalog/CatalogWarmOutputContext.js';
|
|
6
9
|
import * as THREE from 'three/webgpu';
|
|
7
10
|
import { CatalogSpatialElementLayer } from '../catalog/CatalogSpatialElementLayer.js';
|
|
8
11
|
import { SpatialGeometryCapture } from '../catalog/SpatialGeometryCapture.js';
|
|
9
12
|
import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
|
|
10
|
-
import { Fn,
|
|
11
|
-
import { inverseAcesToneMapping, STAGE_TONE_MAPPING_EXPOSURE } from './LiquidGlassPanel.js';
|
|
13
|
+
import { Fn, If, mix, texture, uniform, uv, vec4 } from 'three/tsl';
|
|
14
|
+
import { inverseAcesToneMapping, LiquidGlassPanel, STAGE_TONE_MAPPING_EXPOSURE } from './LiquidGlassPanel.js';
|
|
12
15
|
import { isMesh } from './stageSceneUtils.js';
|
|
16
|
+
import { getStageRenderPixelRatio, resolveStageRenderSettings } from './renderSettings.js';
|
|
13
17
|
const SCROLL_RENDER_SCALE = 0.82;
|
|
14
18
|
/** Owns GPU output bands, passes and target lifetimes; never schedules frames or navigation. */
|
|
15
19
|
export class StageRenderPipeline {
|
|
@@ -25,17 +29,166 @@ export class StageRenderPipeline {
|
|
|
25
29
|
measuredBackdropSeeds = new WeakMap();
|
|
26
30
|
preparedZoomViews = new WeakSet();
|
|
27
31
|
disposed = false;
|
|
32
|
+
warmConfiguration = 0;
|
|
33
|
+
inactiveScrollWarmups = 0;
|
|
34
|
+
renderSettings = resolveStageRenderSettings();
|
|
35
|
+
backgroundOutputRequested = (() => {
|
|
36
|
+
const query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search ?? '');
|
|
37
|
+
return query.get('stage-test') === '1' && query.get('stage-background-output') === '1';
|
|
38
|
+
})();
|
|
39
|
+
backgroundOutputInitialized = false;
|
|
40
|
+
backgroundOutput;
|
|
41
|
+
catalogWarmOutput;
|
|
42
|
+
/** Called after renderer.init, before mounting or ever drawing the Background Canvas. */
|
|
43
|
+
initializeBackgroundOutput() {
|
|
44
|
+
if (!this.backgroundOutputRequested || this.backgroundOutputInitialized || this.disposed)
|
|
45
|
+
return;
|
|
46
|
+
this.backgroundOutputInitialized = true;
|
|
47
|
+
const renderer = this.ports.renderer, canvas = renderer.getCanvasTarget(), target = renderer.getRenderTarget();
|
|
48
|
+
try {
|
|
49
|
+
this.resizeCanvasTarget(this.ports.backgroundCanvasTarget, window.innerWidth, window.innerHeight, this.getFullPixelRatio());
|
|
50
|
+
this.backgroundOutput = BackgroundLayerOutput.create(this.ports.renderer, this.ports.backgroundCanvasTarget);
|
|
51
|
+
if (!this.backgroundOutput)
|
|
52
|
+
return;
|
|
53
|
+
try {
|
|
54
|
+
// Prepare the final Canvas-output owner during ordinary initialization,
|
|
55
|
+
// before there is any outgoing Canvas content to preserve.
|
|
56
|
+
if (!this.backgroundOutput.clearTransparent())
|
|
57
|
+
this.fallbackBackgroundOutput();
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
this.fallbackBackgroundOutput();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
renderer.setCanvasTarget(canvas);
|
|
65
|
+
renderer.setRenderTarget(target);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
invalidateCatalogWarmOutput() {
|
|
69
|
+
this.catalogWarmOutput?.dispose();
|
|
70
|
+
this.catalogWarmOutput = undefined;
|
|
71
|
+
}
|
|
72
|
+
fallbackBackgroundOutput() {
|
|
73
|
+
this.invalidateCatalogWarmOutput();
|
|
74
|
+
this.backgroundOutput?.selectFallback();
|
|
75
|
+
this.warmConfiguration++;
|
|
76
|
+
}
|
|
77
|
+
get backgroundOutputHeld() { return this.backgroundOutputRequested && this.ports.frame().outgoingBackground; }
|
|
78
|
+
/** Preparation/eligibility may acquire a lease. Diagnostics must use peek instead. */
|
|
79
|
+
ensureCatalogWarmOutputContext() {
|
|
80
|
+
const owner = this.backgroundOutput;
|
|
81
|
+
if (!owner || this.backgroundOutputHeld || this.disposed)
|
|
82
|
+
return;
|
|
83
|
+
if (owner.getStats().mode !== 'explicit') {
|
|
84
|
+
this.invalidateCatalogWarmOutput();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
return withRendererState(this.ports.renderer, () => {
|
|
88
|
+
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
89
|
+
if (this.catalogWarmOutput?.isCurrent(this.ports.renderer))
|
|
90
|
+
return this.catalogWarmOutput;
|
|
91
|
+
this.invalidateCatalogWarmOutput();
|
|
92
|
+
const handle = owner.captureScratch();
|
|
93
|
+
if (handle)
|
|
94
|
+
this.catalogWarmOutput = CatalogWarmOutputContext.createBorrowed(this.ports.renderer, handle, () => !this.disposed && this.backgroundOutput === owner);
|
|
95
|
+
if (!this.catalogWarmOutput)
|
|
96
|
+
this.fallbackBackgroundOutput();
|
|
97
|
+
return this.catalogWarmOutput;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
peekCatalogWarmOutputContext() { return this.catalogWarmOutput; }
|
|
101
|
+
getBackgroundOutputStats() {
|
|
102
|
+
// Query-gated diagnostics only: Map.has cannot allocate Three's implicit target.
|
|
103
|
+
const buffers = this.backgroundOutputRequested
|
|
104
|
+
? this.ports.renderer._frameBufferTargets : undefined;
|
|
105
|
+
return { requested: this.backgroundOutputRequested, initialized: this.backgroundOutputInitialized,
|
|
106
|
+
...(this.backgroundOutput?.getStats() ?? { mode: 'legacy' }),
|
|
107
|
+
held: this.backgroundOutputHeld,
|
|
108
|
+
targetTextureId: this.backgroundOutput?.getRenderTargets()[0]?.texture.uuid ?? null,
|
|
109
|
+
implicitBackgroundTarget: buffers instanceof Map ? Map.prototype.has.call(buffers, this.ports.backgroundCanvasTarget) : null,
|
|
110
|
+
catalogProfile: this.catalogWarmOutput?.profileKey ?? null,
|
|
111
|
+
catalogProfileCurrent: this.catalogWarmOutput?.isCurrent(this.ports.renderer) ?? false };
|
|
112
|
+
}
|
|
113
|
+
/** A held Canvas keeps both its pixels and dimensions until normal publication resumes. */
|
|
114
|
+
syncBackgroundOutputSize() {
|
|
115
|
+
const owner = this.backgroundOutput;
|
|
116
|
+
if (!owner || this.backgroundOutputHeld || owner.getStats().mode !== 'explicit')
|
|
117
|
+
return;
|
|
118
|
+
const canvas = this.ports.backgroundCanvasTarget, size = canvas.getSize(this.displaySize), ratio = this.getFullPixelRatio();
|
|
119
|
+
if (size.x !== window.innerWidth || size.y !== window.innerHeight || canvas.getPixelRatio() !== ratio) {
|
|
120
|
+
this.invalidateCatalogWarmOutput();
|
|
121
|
+
this.warmConfiguration++;
|
|
122
|
+
this.resizeCanvasTarget(canvas, window.innerWidth, window.innerHeight, ratio);
|
|
123
|
+
}
|
|
124
|
+
if (!owner.resize())
|
|
125
|
+
this.fallbackBackgroundOutput();
|
|
126
|
+
}
|
|
127
|
+
renderBackgroundOutput(publish = true) {
|
|
128
|
+
if (!this._stageDisplayQuad || (publish && this.backgroundOutputHeld))
|
|
129
|
+
return;
|
|
130
|
+
const owner = this.backgroundOutput;
|
|
131
|
+
if (owner?.getStats().mode === 'explicit') {
|
|
132
|
+
try {
|
|
133
|
+
if (owner.compose(this._stageDisplayQuad, () => this.renderBackgroundPanels(), publish))
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
catch { /* The experiment declines permanently; use the established output path. */ }
|
|
137
|
+
this.fallbackBackgroundOutput();
|
|
138
|
+
}
|
|
139
|
+
// Once the explicit owner declines, even a masked legacy Canvas draw can
|
|
140
|
+
// replace its presented image. Skip that optional warm pass while held.
|
|
141
|
+
if (!publish && this.backgroundOutputHeld)
|
|
142
|
+
return;
|
|
143
|
+
if (publish) {
|
|
144
|
+
this.renderStageDisplay();
|
|
145
|
+
this.renderBackgroundPanels();
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
const renderer = this.ports.renderer, auto = renderer.autoClear;
|
|
149
|
+
try {
|
|
150
|
+
renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
151
|
+
renderer.setRenderTarget(null);
|
|
152
|
+
renderer.setScissor(new THREE.Vector4(0, 0, 0, 0));
|
|
153
|
+
renderer.setScissorTest(true);
|
|
154
|
+
renderer.autoClear = false;
|
|
155
|
+
this._stageDisplayQuad.render(renderer);
|
|
156
|
+
this.renderBackgroundPanels();
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
renderer.autoClear = auto;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
clearBackgroundOutput() {
|
|
164
|
+
if (this.backgroundOutputHeld)
|
|
165
|
+
return;
|
|
166
|
+
if (this.backgroundOutput?.getStats().mode === 'explicit') {
|
|
167
|
+
try {
|
|
168
|
+
if (this.backgroundOutput.clearTransparent())
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
catch { /* Terminal fallback, as for complete composition. */ }
|
|
172
|
+
this.fallbackBackgroundOutput();
|
|
173
|
+
}
|
|
174
|
+
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
175
|
+
this.ports.renderer.setRenderTarget(null);
|
|
176
|
+
this.ports.renderer.setClearColor(0, 0);
|
|
177
|
+
this.ports.renderer.clear();
|
|
178
|
+
}
|
|
28
179
|
/** Retain the last DETAIL background while its geometry is owned by a transition. */
|
|
29
180
|
freezeBackground() {
|
|
181
|
+
this.syncBackgroundOutputSize();
|
|
30
182
|
const targets = this._activeRenderTargets;
|
|
31
183
|
if (!targets)
|
|
32
184
|
return false;
|
|
185
|
+
// Never bake the old screen-space halo into the outgoing background snapshot.
|
|
186
|
+
this.displayOutlineOpacity.value = 0;
|
|
33
187
|
withRendererState(this.ports.renderer, () => {
|
|
34
188
|
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
35
189
|
this.ports.renderer.setRenderTarget(targets.sceneCapture);
|
|
36
190
|
this.renderStageContents();
|
|
37
|
-
this.
|
|
38
|
-
this.renderBackgroundPanels();
|
|
191
|
+
this.renderBackgroundOutput();
|
|
39
192
|
});
|
|
40
193
|
return true;
|
|
41
194
|
}
|
|
@@ -77,6 +230,7 @@ export class StageRenderPipeline {
|
|
|
77
230
|
}
|
|
78
231
|
getRenderTargets() {
|
|
79
232
|
return [
|
|
233
|
+
...(this.backgroundOutput?.getRenderTargets() ?? []),
|
|
80
234
|
...(this.outlineMaskTarget ? [this.outlineMaskTarget] : []),
|
|
81
235
|
...[this.fullQualityTargets, this.scrollQualityTargets].flatMap((set) => set
|
|
82
236
|
? [
|
|
@@ -111,8 +265,12 @@ export class StageRenderPipeline {
|
|
|
111
265
|
}
|
|
112
266
|
constructor(ports) {
|
|
113
267
|
this.ports = ports;
|
|
268
|
+
this.updateInteractionTheme();
|
|
269
|
+
this.setRenderSettings(ports.renderSettings);
|
|
114
270
|
this.setPageBackground(ports.pageBackground ?? '#ffffff');
|
|
115
|
-
|
|
271
|
+
// NodeMaterial applies premultipliedAlpha in setupOutput. Supply straight
|
|
272
|
+
// RGB here; multiplying twice darkens the middle of the background reveal.
|
|
273
|
+
this.backgroundCoverMaterial.fragmentNode = vec4(inverseAcesToneMapping(this.backgroundCoverColor), this.backgroundCoverOpacity);
|
|
116
274
|
this.backgroundCoverMaterial.depthTest = this.backgroundCoverMaterial.depthWrite = false;
|
|
117
275
|
this.backgroundCoverMaterial.transparent =
|
|
118
276
|
this.backgroundCoverMaterial.premultipliedAlpha = true;
|
|
@@ -127,6 +285,16 @@ export class StageRenderPipeline {
|
|
|
127
285
|
backgroundCoverMaterial = new THREE.NodeMaterial();
|
|
128
286
|
backgroundCover = new THREE.QuadMesh(this.backgroundCoverMaterial);
|
|
129
287
|
outlineMaskScene = new THREE.Scene();
|
|
288
|
+
outlineColor = uniform(new THREE.Color());
|
|
289
|
+
outlineStrength = uniform(1);
|
|
290
|
+
outlineGlow = uniform(1);
|
|
291
|
+
updateInteractionTheme() {
|
|
292
|
+
const theme = this.ports.interactionTheme();
|
|
293
|
+
this.outlineColor.value.set(theme.outlineColor);
|
|
294
|
+
this.outlineStrength.value = theme.outlineOpacity;
|
|
295
|
+
this.outlineGlow.value = theme.outlineGlow;
|
|
296
|
+
this.resizeOutline(this.outlineWidth, this.outlineHeight);
|
|
297
|
+
}
|
|
130
298
|
_minimapOverlayCapturePasses = 0;
|
|
131
299
|
_renderTargetSetCreations = 0;
|
|
132
300
|
_renderTargetSetResizes = 0;
|
|
@@ -154,11 +322,14 @@ export class StageRenderPipeline {
|
|
|
154
322
|
_activeRenderTargets;
|
|
155
323
|
stageDisplayMaterial;
|
|
156
324
|
_stageDisplayQuad;
|
|
325
|
+
displayViewport = new THREE.Vector4();
|
|
326
|
+
displaySize = new THREE.Vector2();
|
|
157
327
|
stageDisplayTextureNode;
|
|
158
328
|
foregroundCanvasTarget;
|
|
159
329
|
carouselRearTarget;
|
|
160
330
|
carouselRearCanvas;
|
|
161
331
|
carouselRearSize = new THREE.Vector3();
|
|
332
|
+
carouselRearClear = false;
|
|
162
333
|
foregroundCanvas;
|
|
163
334
|
configureRenderer() {
|
|
164
335
|
this.ports.renderer.toneMapping = THREE.ACESFilmicToneMapping;
|
|
@@ -169,7 +340,9 @@ export class StageRenderPipeline {
|
|
|
169
340
|
this.ports.backgroundCanvas.style.touchAction = 'pan-y';
|
|
170
341
|
}
|
|
171
342
|
renderCarouselRear() {
|
|
172
|
-
|
|
343
|
+
const layer = this.ports.catalogLayer();
|
|
344
|
+
const active = layer?.hasRearOutput() ?? false;
|
|
345
|
+
if (!this.carouselRearTarget && !active)
|
|
173
346
|
return;
|
|
174
347
|
if (!this.carouselRearTarget) {
|
|
175
348
|
const canvas = document.createElement('canvas');
|
|
@@ -181,18 +354,31 @@ export class StageRenderPipeline {
|
|
|
181
354
|
}
|
|
182
355
|
const target = this.carouselRearTarget;
|
|
183
356
|
const width = window.innerWidth, height = window.innerHeight, ratio = this.getFullPixelRatio();
|
|
184
|
-
|
|
357
|
+
const resized = (this.carouselRearSize.x !== width ||
|
|
185
358
|
this.carouselRearSize.y !== height ||
|
|
186
|
-
this.carouselRearSize.z !== ratio)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
this.ports.renderer
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
359
|
+
this.carouselRearSize.z !== ratio);
|
|
360
|
+
// Clear the formerly visible layer once. Keep its allocation for Back/Cancel,
|
|
361
|
+
// but do not switch canvases or submit empty passes on subsequent detail frames.
|
|
362
|
+
if (!active && this.carouselRearClear && !resized)
|
|
363
|
+
return;
|
|
364
|
+
withRendererState(this.ports.renderer, () => {
|
|
365
|
+
this.carouselRearClear = false;
|
|
366
|
+
if (resized) {
|
|
367
|
+
this.resizeCanvasTarget(target, width, height, ratio);
|
|
368
|
+
this.carouselRearSize.set(width, height, ratio);
|
|
369
|
+
}
|
|
370
|
+
this.ports.renderer.setCanvasTarget(target);
|
|
371
|
+
this.ports.renderer.setRenderTarget(null);
|
|
372
|
+
this.ports.renderer.setClearColor(0x000000, 0);
|
|
373
|
+
if (active)
|
|
374
|
+
this.ports.renderer.clear();
|
|
375
|
+
else
|
|
376
|
+
clearFullTarget(this.ports.renderer);
|
|
377
|
+
if (active)
|
|
378
|
+
layer.renderRear(this.ports.renderer);
|
|
379
|
+
else
|
|
380
|
+
this.carouselRearClear = true;
|
|
381
|
+
});
|
|
196
382
|
}
|
|
197
383
|
createForegroundCanvas() {
|
|
198
384
|
const canvas = document.createElement('canvas');
|
|
@@ -205,10 +391,7 @@ export class StageRenderPipeline {
|
|
|
205
391
|
}
|
|
206
392
|
createModelOutline(model) {
|
|
207
393
|
this.outlineMaskModel?.removeFromParent();
|
|
208
|
-
this.outlineMaskMaterial
|
|
209
|
-
this.outlineCompositeMaterial?.dispose();
|
|
210
|
-
this.outlineMaskTarget?.dispose();
|
|
211
|
-
this.outlineMaskMaterial = new THREE.MeshBasicMaterial({
|
|
394
|
+
this.outlineMaskMaterial ??= new THREE.MeshBasicMaterial({
|
|
212
395
|
color: 0xffffff,
|
|
213
396
|
depthTest: true,
|
|
214
397
|
depthWrite: true,
|
|
@@ -228,17 +411,22 @@ export class StageRenderPipeline {
|
|
|
228
411
|
});
|
|
229
412
|
this.outlineMaskModel = maskModel;
|
|
230
413
|
this.outlineMaskScene.add(maskModel);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
414
|
+
// Low/High changes replace the silhouette, not its viewport-sized storage.
|
|
415
|
+
// StageDisplay binds this sampler even while its opacity branch is zero;
|
|
416
|
+
// replacing it mid-reveal would recreate the texture and MSAA attachment.
|
|
417
|
+
if (!this.outlineMaskTarget) {
|
|
418
|
+
this.outlineMaskTarget = new THREE.RenderTarget(1, 1, {
|
|
419
|
+
depthBuffer: true,
|
|
420
|
+
stencilBuffer: false,
|
|
421
|
+
samples: 4
|
|
422
|
+
});
|
|
423
|
+
this.outlineMaskTarget.texture.minFilter = THREE.LinearFilter;
|
|
424
|
+
this.outlineMaskTarget.texture.magFilter = THREE.LinearFilter;
|
|
425
|
+
this.outlineMaskTarget.texture.generateMipmaps = false;
|
|
426
|
+
this.displayOutlineMask.value = this.outlineMaskTarget.texture;
|
|
427
|
+
this.outlineCompositeMaterial = this.createOutlineCompositeMaterial(this.outlineMaskTarget.texture);
|
|
428
|
+
this.outlineQuad = new THREE.QuadMesh(this.outlineCompositeMaterial);
|
|
429
|
+
}
|
|
242
430
|
// High refinement can replace the silhouette long after the last window resize.
|
|
243
431
|
this.resizeOutline(this.outlineWidth, this.outlineHeight);
|
|
244
432
|
}
|
|
@@ -251,67 +439,10 @@ export class StageRenderPipeline {
|
|
|
251
439
|
return source;
|
|
252
440
|
}
|
|
253
441
|
createOutlineOpacity(mask) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const centerUv = uv();
|
|
259
|
-
const sampleX = sampleTexel.x.mul(scale);
|
|
260
|
-
const sampleY = sampleTexel.y.mul(scale);
|
|
261
|
-
const left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;
|
|
262
|
-
const right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;
|
|
263
|
-
const up = mask.sample(centerUv.add(vec2(0, sampleY))).r;
|
|
264
|
-
const down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;
|
|
265
|
-
const upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;
|
|
266
|
-
const upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;
|
|
267
|
-
const downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;
|
|
268
|
-
const downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;
|
|
269
|
-
return {
|
|
270
|
-
average: left
|
|
271
|
-
.add(right)
|
|
272
|
-
.add(up)
|
|
273
|
-
.add(down)
|
|
274
|
-
.add(upLeft)
|
|
275
|
-
.add(upRight)
|
|
276
|
-
.add(downLeft)
|
|
277
|
-
.add(downRight)
|
|
278
|
-
.div(8),
|
|
279
|
-
max: tslMax(tslMax(tslMax(left, right), tslMax(up, down)), tslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))),
|
|
280
|
-
min: tslMin(tslMin(tslMin(left, right), tslMin(up, down)), tslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight)))
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
const edgeNeighbor = sampleMaskRing(texel);
|
|
284
|
-
const glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);
|
|
285
|
-
const glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);
|
|
286
|
-
const glowFarNeighbor = sampleMaskRing(glowTexel);
|
|
287
|
-
const center = mask.sample(uv()).r;
|
|
288
|
-
const outside = center.oneMinus();
|
|
289
|
-
const edgeGradient = edgeNeighbor.max.sub(center).max(0);
|
|
290
|
-
const core = edgeGradient.mul(this.ports.interactionTheme().outlineOpacity);
|
|
291
|
-
// Average neighbouring coverage, rather than dilating a solid band. Keep the
|
|
292
|
-
// halo outside the spatialElement so it cannot be mistaken for painted geometry.
|
|
293
|
-
const glowNear = glowNearNeighbor.average
|
|
294
|
-
.mul(outside)
|
|
295
|
-
.mul(this.ports.interactionTheme().outlineGlow * 0.6);
|
|
296
|
-
const glowMid = glowMidNeighbor.average
|
|
297
|
-
.mul(outside)
|
|
298
|
-
.mul(this.ports.interactionTheme().outlineGlow * 0.3);
|
|
299
|
-
const glowFar = glowFarNeighbor.average
|
|
300
|
-
.mul(outside)
|
|
301
|
-
.mul(this.ports.interactionTheme().outlineGlow * 0.1);
|
|
302
|
-
const opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(this.outlineOpacityScale);
|
|
303
|
-
return opacity;
|
|
304
|
-
};
|
|
305
|
-
if (this.renderMeasurement === 'halo-unconditional')
|
|
306
|
-
return calculate();
|
|
307
|
-
return Fn(() => {
|
|
308
|
-
const opacity = float(0).toVar();
|
|
309
|
-
// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.
|
|
310
|
-
If(mask.sample(uv()).r.lessThan(1), () => {
|
|
311
|
-
opacity.assign(calculate());
|
|
312
|
-
});
|
|
313
|
-
return opacity;
|
|
314
|
-
})();
|
|
442
|
+
return createOutlineOpacity(mask, {
|
|
443
|
+
color: this.outlineColor, strength: this.outlineStrength, glow: this.outlineGlow,
|
|
444
|
+
opacityScale: this.outlineOpacityScale, texel: this.outlineTexel, glowTexel: this.outlineGlowTexel
|
|
445
|
+
}, this.renderMeasurement === 'halo-unconditional');
|
|
315
446
|
}
|
|
316
447
|
createOutlineCompositeMaterial(maskTexture) {
|
|
317
448
|
const material = new THREE.MeshBasicNodeMaterial({
|
|
@@ -320,12 +451,13 @@ export class StageRenderPipeline {
|
|
|
320
451
|
depthWrite: false,
|
|
321
452
|
transparent: true
|
|
322
453
|
});
|
|
323
|
-
material.colorNode =
|
|
454
|
+
material.colorNode = inverseAcesToneMapping(this.outlineColor.rgb);
|
|
324
455
|
material.opacityNode = this.createOutlineOpacity(texture(maskTexture));
|
|
325
456
|
material.toneMapped = false;
|
|
326
457
|
return material;
|
|
327
458
|
}
|
|
328
459
|
disposeSceneCapture() {
|
|
460
|
+
this.warmConfiguration++;
|
|
329
461
|
this.disposeRenderTargetSet(this.fullQualityTargets);
|
|
330
462
|
this.disposeRenderTargetSet(this.scrollQualityTargets);
|
|
331
463
|
this.stageDisplayMaterial?.dispose();
|
|
@@ -337,6 +469,7 @@ export class StageRenderPipeline {
|
|
|
337
469
|
this.stageDisplayTextureNode = undefined;
|
|
338
470
|
}
|
|
339
471
|
createSceneCapture() {
|
|
472
|
+
this.warmConfiguration++;
|
|
340
473
|
const blurKeys = new Set(this.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options)));
|
|
341
474
|
this.fullQualityTargets = this.createRenderTargetSet(1, blurKeys);
|
|
342
475
|
this.scrollQualityTargets = this.createRenderTargetSet(SCROLL_RENDER_SCALE, blurKeys);
|
|
@@ -352,7 +485,7 @@ export class StageRenderPipeline {
|
|
|
352
485
|
if (this.fuseOutline) {
|
|
353
486
|
this.emptyOutlineMask.needsUpdate = true;
|
|
354
487
|
const source = this.stageDisplayTextureNode;
|
|
355
|
-
const haloColor =
|
|
488
|
+
const haloColor = inverseAcesToneMapping(this.outlineColor.rgb);
|
|
356
489
|
const haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);
|
|
357
490
|
// Merge into the existing linear display pass before the canvas output transform.
|
|
358
491
|
this.stageDisplayMaterial.fragmentNode = Fn(() => {
|
|
@@ -400,11 +533,16 @@ export class StageRenderPipeline {
|
|
|
400
533
|
targets.panelBlurCaptures.clear();
|
|
401
534
|
}
|
|
402
535
|
resizeRenderTargets() {
|
|
536
|
+
this.warmConfiguration++;
|
|
403
537
|
const width = window.innerWidth;
|
|
404
538
|
const height = window.innerHeight;
|
|
405
539
|
const pixelRatio = this.getFullPixelRatio();
|
|
406
|
-
if (!this.ports.frame().outgoingBackground)
|
|
540
|
+
if (!this.ports.frame().outgoingBackground) {
|
|
541
|
+
this.invalidateCatalogWarmOutput();
|
|
407
542
|
this.resizeCanvasTarget(this.ports.backgroundCanvasTarget, width, height, pixelRatio);
|
|
543
|
+
if (this.backgroundOutput?.getStats().mode === 'explicit' && !this.backgroundOutput.resize())
|
|
544
|
+
this.fallbackBackgroundOutput();
|
|
545
|
+
}
|
|
408
546
|
if (this.foregroundCanvasTarget) {
|
|
409
547
|
this.resizeCanvasTarget(this.foregroundCanvasTarget, width, height, pixelRatio);
|
|
410
548
|
}
|
|
@@ -420,14 +558,29 @@ export class StageRenderPipeline {
|
|
|
420
558
|
const captureHeight = Math.max(1, Math.round(height * pixelRatio * targets.scale));
|
|
421
559
|
targets.sceneCapture.setSize(captureWidth, captureHeight);
|
|
422
560
|
targets.panelBlurCaptures.forEach(({ target, effect, resolutionScale }) => {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
effect.resolutionScale =
|
|
426
|
-
|
|
561
|
+
if (effect) {
|
|
562
|
+
const effectScale = resolutionScale / (pixelRatio * targets.scale);
|
|
563
|
+
effect.resolutionScale = effectScale;
|
|
564
|
+
effect.setSize(captureWidth, captureHeight);
|
|
565
|
+
// Consumers sample normalized screen UVs. Preserve the blur's actual
|
|
566
|
+
// density instead of copying it back to a full-DPR viewport texture.
|
|
567
|
+
target.setSize(Math.max(1, Math.round(captureWidth * effectScale)), Math.max(1, Math.round(captureHeight * effectScale)));
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
// A zero-blur backdrop still contains sharp scene detail.
|
|
571
|
+
target.setSize(captureWidth, captureHeight);
|
|
572
|
+
}
|
|
427
573
|
});
|
|
428
574
|
}
|
|
429
575
|
getFullPixelRatio() {
|
|
430
|
-
return
|
|
576
|
+
return getStageRenderPixelRatio(window.innerWidth, window.innerHeight, window.devicePixelRatio, this.renderSettings);
|
|
577
|
+
}
|
|
578
|
+
setRenderSettings(settings) {
|
|
579
|
+
this.warmConfiguration++;
|
|
580
|
+
this.renderSettings = resolveStageRenderSettings(settings);
|
|
581
|
+
}
|
|
582
|
+
getRenderSettings() {
|
|
583
|
+
return { ...this.renderSettings };
|
|
431
584
|
}
|
|
432
585
|
setScrollRenderQuality(active) {
|
|
433
586
|
this.ports.container.toggleAttribute('data-stage-scroll-rendering', active);
|
|
@@ -457,6 +610,7 @@ export class StageRenderPipeline {
|
|
|
457
610
|
});
|
|
458
611
|
}
|
|
459
612
|
warmRenderTargetSets() {
|
|
613
|
+
this.syncBackgroundOutputSize();
|
|
460
614
|
const previousTargets = this._activeRenderTargets;
|
|
461
615
|
const availableTargets = [this.fullQualityTargets, this.scrollQualityTargets].filter((targets) => Boolean(targets));
|
|
462
616
|
if (!previousTargets || !this._stageDisplayQuad || availableTargets.length !== 2)
|
|
@@ -475,8 +629,7 @@ export class StageRenderPipeline {
|
|
|
475
629
|
this.ports.renderer.setRenderTarget(targets.sceneCapture);
|
|
476
630
|
this.ports.renderStage();
|
|
477
631
|
this.renderPanelBlurCaptures(targets, true);
|
|
478
|
-
this.
|
|
479
|
-
this.renderBackgroundPanels();
|
|
632
|
+
this.renderBackgroundOutput(!this.backgroundOutputHeld);
|
|
480
633
|
this._renderTargetSetWarmups += 1;
|
|
481
634
|
});
|
|
482
635
|
});
|
|
@@ -485,10 +638,166 @@ export class StageRenderPipeline {
|
|
|
485
638
|
this.activateRenderTargetSet(previousTargets);
|
|
486
639
|
}
|
|
487
640
|
}
|
|
641
|
+
/** Capture immediately after reveal's real warm draws, before its GPU fence.
|
|
642
|
+
* The facade publishes this only after that fence and its page-owner check.
|
|
643
|
+
*/
|
|
644
|
+
captureDeferredScrollWarmup(ownerIsCurrent) {
|
|
645
|
+
const renderer = this.ports.renderer, full = this.fullQualityTargets, scroll = this.scrollQualityTargets;
|
|
646
|
+
// The explicit output has a different warmed display owner. Retain the full
|
|
647
|
+
// preparation path until its no-write Scroll shortcut is separately proven.
|
|
648
|
+
if (this.backgroundOutputRequested)
|
|
649
|
+
return;
|
|
650
|
+
if (this.disposed || !full || !scroll || this._activeRenderTargets !== full || !this._stageDisplayQuad || !this.stageDisplayMaterial ||
|
|
651
|
+
!renderer.backend.isWebGPUBackend ||
|
|
652
|
+
renderer.xr.enabled || renderer.getOutputRenderTarget() || renderer.getMRT() || renderer.getRenderObjectFunction() ||
|
|
653
|
+
this.ports.panelScene.background || this.ports.panelScene.overrideMaterial ||
|
|
654
|
+
!ownerIsCurrent())
|
|
655
|
+
return;
|
|
656
|
+
const epoch = this.warmConfiguration, canvas = this.ports.backgroundCanvasTarget, quad = this._stageDisplayQuad, display = this.stageDisplayMaterial, displayVersion = display.version;
|
|
657
|
+
const width = window.innerWidth, height = window.innerHeight, dpr = window.devicePixelRatio;
|
|
658
|
+
const canvasSize = canvas.getDrawingBufferSize(new THREE.Vector2()), canvasViewport = canvas.getViewport(new THREE.Vector4()), canvasRatio = canvas.getPixelRatio(), currentSize = new THREE.Vector2(), currentViewport = new THREE.Vector4();
|
|
659
|
+
const tone = renderer.toneMapping, exposure = renderer.toneMappingExposure, space = renderer.outputColorSpace;
|
|
660
|
+
const panels = [...this.ports.panelRuntimes()], views = [...this.ports.minimaps().values()];
|
|
661
|
+
const panelOwners = panels.map(panel => ({ panel, glass: panel.glass, group: panel.group, projection: panel.projectionRoot, options: panel.options, surface: panel.surface }));
|
|
662
|
+
const materials = [];
|
|
663
|
+
const groups = [];
|
|
664
|
+
const allowed = new Set([this.ports.panelScene]);
|
|
665
|
+
for (const panel of panels) {
|
|
666
|
+
for (let node = panel.group; node && node !== this.ports.panelScene; node = node.parent)
|
|
667
|
+
allowed.add(node);
|
|
668
|
+
if (!panel.glass)
|
|
669
|
+
continue;
|
|
670
|
+
if (!(panel.glass instanceof LiquidGlassPanel) || !panel.glass.hasOwnedRenderGraph())
|
|
671
|
+
return;
|
|
672
|
+
let supported = true;
|
|
673
|
+
panel.group.traverse(node => {
|
|
674
|
+
allowed.add(node);
|
|
675
|
+
groups.push({ node, children: [...node.children] });
|
|
676
|
+
if (!isMesh(node))
|
|
677
|
+
return;
|
|
678
|
+
const material = node.material;
|
|
679
|
+
if (Array.isArray(material) || !(material instanceof THREE.MeshBasicMaterial || material instanceof THREE.MeshBasicNodeMaterial) ||
|
|
680
|
+
node.onBeforeRender !== THREE.Object3D.prototype.onBeforeRender || node.onAfterRender !== THREE.Object3D.prototype.onAfterRender) {
|
|
681
|
+
supported = false;
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
materials.push({ mesh: node, material, version: material.version });
|
|
685
|
+
});
|
|
686
|
+
if (!supported)
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
let controlledScene = true;
|
|
690
|
+
this.ports.panelScene.traverse(node => {
|
|
691
|
+
if ((!allowed.has(node) && !(node instanceof THREE.Light && !node.castShadow)) ||
|
|
692
|
+
node.onBeforeRender !== THREE.Object3D.prototype.onBeforeRender || node.onAfterRender !== THREE.Object3D.prototype.onAfterRender)
|
|
693
|
+
controlledScene = false;
|
|
694
|
+
groups.push({ node, children: [...node.children] });
|
|
695
|
+
});
|
|
696
|
+
if (!controlledScene)
|
|
697
|
+
return;
|
|
698
|
+
const targets = [full, scroll].flatMap(set => [set.sceneCapture, ...[...set.panelBlurCaptures.values()].map(capture => capture.target)])
|
|
699
|
+
.map(target => ({ target, width: target.width, height: target.height }));
|
|
700
|
+
return { owner: this, used: false, current: () => !this.disposed && ownerIsCurrent() && this.warmConfiguration === epoch &&
|
|
701
|
+
this.fullQualityTargets === full && this.scrollQualityTargets === scroll && this._activeRenderTargets === full &&
|
|
702
|
+
this._stageDisplayQuad === quad && quad.material === display && display.version === displayVersion && this.ports.backgroundCanvasTarget === canvas &&
|
|
703
|
+
window.innerWidth === width && window.innerHeight === height && window.devicePixelRatio === dpr &&
|
|
704
|
+
canvas.getPixelRatio() === canvasRatio && canvas.getDrawingBufferSize(currentSize).equals(canvasSize) && canvas.getViewport(currentViewport).equals(canvasViewport) &&
|
|
705
|
+
!renderer.xr.enabled && !renderer.getOutputRenderTarget() && !renderer.getMRT() && !renderer.getRenderObjectFunction() &&
|
|
706
|
+
!this.ports.panelScene.background && !this.ports.panelScene.overrideMaterial &&
|
|
707
|
+
renderer.toneMapping === tone && renderer.toneMappingExposure === exposure && renderer.outputColorSpace === space &&
|
|
708
|
+
!this.ports.frame().outgoingBackground &&
|
|
709
|
+
panels.length === this.ports.panelRuntimes().length && panels.every((panel, i) => panel === this.ports.panelRuntimes()[i]) &&
|
|
710
|
+
panelOwners.every(({ panel, glass, group, projection, options, surface }) => panel.glass === glass && panel.group === group &&
|
|
711
|
+
panel.projectionRoot === projection && panel.options === options && panel.surface === surface && (!glass || glass.hasOwnedRenderGraph())) &&
|
|
712
|
+
views.length === this.ports.minimaps().size && views.every(view => this.ports.minimaps().get(view.panelIndex) === view) &&
|
|
713
|
+
materials.every(({ mesh, material, version }) => mesh.material === material && material.version === version) &&
|
|
714
|
+
groups.every(({ node, children }) => node.onBeforeRender === THREE.Object3D.prototype.onBeforeRender &&
|
|
715
|
+
node.onAfterRender === THREE.Object3D.prototype.onAfterRender && node.children.length === children.length && children.every((child, i) => node.children[i] === child)) &&
|
|
716
|
+
targets.every(({ target, width, height }) => target.width === width && target.height === height) };
|
|
717
|
+
}
|
|
718
|
+
/** Warm only inactive Scroll resources without writing Canvas color/depth.
|
|
719
|
+
* A stale token performs no mutation; the caller retains the complete warm path.
|
|
720
|
+
*/
|
|
721
|
+
warmInactiveScrollTargetSet(token) {
|
|
722
|
+
if (token.owner !== this || token.used || !token.current())
|
|
723
|
+
return false;
|
|
724
|
+
token.used = true;
|
|
725
|
+
const previous = this._activeRenderTargets, renderer = this.ports.renderer;
|
|
726
|
+
const autoClear = renderer.autoClear;
|
|
727
|
+
try {
|
|
728
|
+
withRendererState(renderer, () => {
|
|
729
|
+
renderer.autoClear = false;
|
|
730
|
+
this.activateRenderTargetSet(this.scrollQualityTargets);
|
|
731
|
+
renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
732
|
+
renderer.setScissorTest(false);
|
|
733
|
+
renderer.setRenderTarget(this.scrollQualityTargets.sceneCapture);
|
|
734
|
+
this.ports.renderStage();
|
|
735
|
+
this.renderPanelBlurCaptures(this.scrollQualityTargets, true);
|
|
736
|
+
// Full reveal already drew the same display/panel materials and Canvas
|
|
737
|
+
// contexts. Scroll only replaces their sampled textures with matching
|
|
738
|
+
// types/filters. Keep preparation entirely offscreen; it must not
|
|
739
|
+
// acquire or publish another Canvas output texture.
|
|
740
|
+
this._renderTargetSetWarmups++;
|
|
741
|
+
this.inactiveScrollWarmups++;
|
|
742
|
+
});
|
|
743
|
+
return true;
|
|
744
|
+
}
|
|
745
|
+
finally {
|
|
746
|
+
renderer.autoClear = autoClear;
|
|
747
|
+
this.activateRenderTargetSet(previous);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
/** Warm the bound DETAIL's actual reveal passes while its DOM remains hidden.
|
|
751
|
+
* Unlike optional scroll/zoom preparation this uses only the active target set.
|
|
752
|
+
* Offscreen captures receive real pixels; Canvas pipelines keep their exact
|
|
753
|
+
* output context but a zero-area scissor prevents any visible warm-up draw.
|
|
754
|
+
*/
|
|
755
|
+
warmRevealFrame() {
|
|
756
|
+
const targets = this._activeRenderTargets;
|
|
757
|
+
if (this.disposed || !targets || !this._stageDisplayQuad || !this.foregroundCanvasTarget)
|
|
758
|
+
return false;
|
|
759
|
+
return withRendererState(this.ports.renderer, () => {
|
|
760
|
+
const renderer = this.ports.renderer;
|
|
761
|
+
renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
762
|
+
renderer.setRenderTarget(targets.sceneCapture);
|
|
763
|
+
renderer.setScissorTest(false);
|
|
764
|
+
this.ports.renderStage();
|
|
765
|
+
this.renderPanelBlurCaptures(targets, true);
|
|
766
|
+
const maskCanvas = (canvas) => {
|
|
767
|
+
renderer.setCanvasTarget(canvas);
|
|
768
|
+
renderer.setRenderTarget(null);
|
|
769
|
+
renderer.setScissor(new THREE.Vector4(0, 0, 0, 0));
|
|
770
|
+
renderer.setScissorTest(true);
|
|
771
|
+
};
|
|
772
|
+
// Explicit output composition stays offscreen, without publishing over
|
|
773
|
+
// the source Canvas. The legacy path retains its masked, clear-free draw.
|
|
774
|
+
this.renderBackgroundOutput(false);
|
|
775
|
+
maskCanvas(this.foregroundCanvasTarget);
|
|
776
|
+
this.renderMinimapScene();
|
|
777
|
+
return true;
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
/** Borrow the already selected scene output after all warm live passes. */
|
|
781
|
+
withSceneCapture(draw) {
|
|
782
|
+
const targets = this._activeRenderTargets;
|
|
783
|
+
if (this.disposed || !targets)
|
|
784
|
+
return;
|
|
785
|
+
return withRendererState(this.ports.renderer, () => {
|
|
786
|
+
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
787
|
+
this.ports.renderer.setRenderTarget(targets.sceneCapture);
|
|
788
|
+
this.ports.renderer.setScissorTest(false);
|
|
789
|
+
return draw();
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
isSceneCaptureCurrent(target, width, height) {
|
|
793
|
+
return !this.disposed && this._activeRenderTargets?.sceneCapture === target && target.width === width && target.height === height;
|
|
794
|
+
}
|
|
488
795
|
resizeCanvasTarget(target, width, height, pixelRatio) {
|
|
489
796
|
this.ports.renderer.setCanvasTarget(target);
|
|
490
797
|
this.ports.renderer.setPixelRatio(pixelRatio);
|
|
491
|
-
|
|
798
|
+
// The CSS display rectangle must match the camera/buffer even while mobile
|
|
799
|
+
// browser chrome animates. 100vh can represent a different viewport height.
|
|
800
|
+
this.ports.renderer.setSize(width, height, true);
|
|
492
801
|
}
|
|
493
802
|
createPanelBlurCapture(sceneTexture, blur, renderScale) {
|
|
494
803
|
const target = new THREE.RenderTarget(1, 1, {
|
|
@@ -501,7 +810,7 @@ export class StageRenderPipeline {
|
|
|
501
810
|
target.texture.colorSpace = THREE.NoColorSpace;
|
|
502
811
|
const sourceTexture = texture(sceneTexture);
|
|
503
812
|
// Scale resolution and sample offsets together to retain the CSS blur radius.
|
|
504
|
-
// The final
|
|
813
|
+
// The final texture uses the same density and normalized screen-space mapping.
|
|
505
814
|
const query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search);
|
|
506
815
|
const fullResolutionProbe = query.get('stage-test') === '1' && query.get('stage-backdrop') === 'full';
|
|
507
816
|
const blurResolution = blur >= 4 && !fullResolutionProbe ? 0.5 : 1;
|
|
@@ -525,6 +834,28 @@ export class StageRenderPipeline {
|
|
|
525
834
|
const value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;
|
|
526
835
|
return Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;
|
|
527
836
|
}
|
|
837
|
+
/** Allocate changed blur settings without replacing the scene capture or model resources. */
|
|
838
|
+
syncPanelBlurCaptures() {
|
|
839
|
+
this.warmConfiguration++;
|
|
840
|
+
const keys = new Set(this.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options)));
|
|
841
|
+
if (!this._activeRenderTargets && keys.size)
|
|
842
|
+
this.createSceneCapture();
|
|
843
|
+
for (const targets of [this.fullQualityTargets, this.scrollQualityTargets]) {
|
|
844
|
+
if (!targets)
|
|
845
|
+
continue;
|
|
846
|
+
for (const key of keys)
|
|
847
|
+
if (!targets.panelBlurCaptures.has(key))
|
|
848
|
+
targets.panelBlurCaptures.set(key, this.createPanelBlurCapture(targets.sceneCapture.texture, key, targets.scale));
|
|
849
|
+
for (const [key, capture] of targets.panelBlurCaptures)
|
|
850
|
+
if (!keys.has(key)) {
|
|
851
|
+
capture.target.dispose();
|
|
852
|
+
capture.material.dispose();
|
|
853
|
+
capture.effect?.dispose();
|
|
854
|
+
targets.panelBlurCaptures.delete(key);
|
|
855
|
+
}
|
|
856
|
+
this.resizeRenderTargetSet(targets, window.innerWidth, window.innerHeight, this.getFullPixelRatio());
|
|
857
|
+
}
|
|
858
|
+
}
|
|
528
859
|
getPanelBlurTexture(options, targets = this._activeRenderTargets) {
|
|
529
860
|
const blur = this.getPanelBlurKey(options);
|
|
530
861
|
const capture = targets?.panelBlurCaptures.get(blur);
|
|
@@ -705,13 +1036,16 @@ export class StageRenderPipeline {
|
|
|
705
1036
|
}
|
|
706
1037
|
renderModelOutline(target, opacity = 1) {
|
|
707
1038
|
this.displayOutlineOpacity.value = 0;
|
|
708
|
-
|
|
1039
|
+
// The transferred model owns its moving outline, including its interpolated camera.
|
|
1040
|
+
if (this.ports.spatialCapture?.())
|
|
1041
|
+
return;
|
|
1042
|
+
if (this.renderMeasurement === 'no-halo' || !this.ports.frame().modelHover)
|
|
709
1043
|
return;
|
|
710
1044
|
const opacityBefore = this.outlineOpacityScale.value;
|
|
711
1045
|
try {
|
|
712
1046
|
return withRendererState(this.ports.renderer, () => {
|
|
713
1047
|
if (!this.ports.frame().stageViewportVisible ||
|
|
714
|
-
!
|
|
1048
|
+
!this.ports.frame().modelHover ||
|
|
715
1049
|
!this.outlineMaskTarget ||
|
|
716
1050
|
!this.outlineQuad)
|
|
717
1051
|
return;
|
|
@@ -777,14 +1111,51 @@ export class StageRenderPipeline {
|
|
|
777
1111
|
renderStageDisplay() {
|
|
778
1112
|
if (!this._stageDisplayQuad)
|
|
779
1113
|
return;
|
|
780
|
-
this.ports
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
this.
|
|
1114
|
+
const { renderer, backgroundCanvasTarget } = this.ports;
|
|
1115
|
+
renderer.setRenderTarget(null);
|
|
1116
|
+
renderer.setCanvasTarget(backgroundCanvasTarget);
|
|
1117
|
+
renderer.setClearColor(0xffffff, 1);
|
|
1118
|
+
if (!this.canClearWithStageDisplay()) {
|
|
1119
|
+
renderer.clear();
|
|
1120
|
+
this._stageDisplayQuad.render(renderer);
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
// Only this opaque, depth-independent fullscreen copy has no nested scene
|
|
1124
|
+
// rendering. Include its clear in the same render pass, avoiding the manual
|
|
1125
|
+
// Canvas clear's separate pass and intermediate output-color-transform draw.
|
|
1126
|
+
const { autoClear, autoClearColor, autoClearDepth, autoClearStencil } = renderer;
|
|
1127
|
+
try {
|
|
1128
|
+
renderer.autoClear = renderer.autoClearColor = renderer.autoClearDepth = renderer.autoClearStencil = true;
|
|
1129
|
+
this._stageDisplayQuad.render(renderer);
|
|
1130
|
+
}
|
|
1131
|
+
finally {
|
|
1132
|
+
renderer.autoClear = autoClear;
|
|
1133
|
+
renderer.autoClearColor = autoClearColor;
|
|
1134
|
+
renderer.autoClearDepth = autoClearDepth;
|
|
1135
|
+
renderer.autoClearStencil = autoClearStencil;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
canClearWithStageDisplay() {
|
|
1139
|
+
const { renderer, backgroundCanvasTarget } = this.ports;
|
|
1140
|
+
// Deliberately retain explicit clearing for unproved output configurations.
|
|
1141
|
+
if (!renderer.backend?.isWebGPUBackend ||
|
|
1142
|
+
renderer.xr.isPresenting || renderer.stencil || renderer.reversedDepthBuffer ||
|
|
1143
|
+
renderer.getClearDepth() !== 1 || renderer.getClearStencil() !== 0 ||
|
|
1144
|
+
renderer.getOutputRenderTarget() !== null || renderer.getMRT() !== null ||
|
|
1145
|
+
backgroundCanvasTarget.getScissorTest())
|
|
1146
|
+
return false;
|
|
1147
|
+
const viewport = backgroundCanvasTarget.getViewport(this.displayViewport);
|
|
1148
|
+
const size = backgroundCanvasTarget.getSize(this.displaySize);
|
|
1149
|
+
return size.x > 0 && size.y > 0 && viewport.x === 0 && viewport.y === 0 &&
|
|
1150
|
+
viewport.z === size.x && viewport.w === size.y;
|
|
785
1151
|
}
|
|
786
1152
|
renderStageContents() {
|
|
787
1153
|
this.ports.renderer.clear();
|
|
1154
|
+
if (this.ports.frame().detailMediaActive === false) {
|
|
1155
|
+
this.backgroundCoverOpacity.value = 1;
|
|
1156
|
+
this.backgroundCover.render(this.ports.renderer);
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
788
1159
|
this.ports.renderer.render(this.ports.backgroundScene, this.ports.camera);
|
|
789
1160
|
this.ports.renderer.render(this.ports.tintScene, this.ports.tintCamera);
|
|
790
1161
|
this.backgroundCoverOpacity.value = 1 - this.ports.frame().backgroundReveal;
|
|
@@ -814,7 +1185,7 @@ export class StageRenderPipeline {
|
|
|
814
1185
|
resizeOutline(width, height) {
|
|
815
1186
|
this.outlineWidth = width;
|
|
816
1187
|
this.outlineHeight = height;
|
|
817
|
-
const scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : 1;
|
|
1188
|
+
const scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : typeof window === 'undefined' ? 1 : this.getFullPixelRatio();
|
|
818
1189
|
this.outlineMaskTarget?.setSize(Math.max(1, Math.round(width * scale)), Math.max(1, Math.round(height * scale)));
|
|
819
1190
|
this.outlineMaskValid = false;
|
|
820
1191
|
this.outlineTexel.value.set(this.ports.interactionTheme().outlineThickness / Math.max(width, 1), this.ports.interactionTheme().outlineThickness / Math.max(height, 1));
|
|
@@ -828,6 +1199,8 @@ export class StageRenderPipeline {
|
|
|
828
1199
|
if (this.disposed)
|
|
829
1200
|
return;
|
|
830
1201
|
this.disposed = true;
|
|
1202
|
+
this.invalidateCatalogWarmOutput();
|
|
1203
|
+
this.backgroundOutput?.dispose();
|
|
831
1204
|
this.releaseOutline();
|
|
832
1205
|
this.emptyOutlineMask.dispose();
|
|
833
1206
|
this.disposeSceneCapture();
|
|
@@ -858,6 +1231,7 @@ export class StageRenderPipeline {
|
|
|
858
1231
|
get renderTargetSetWarmups() {
|
|
859
1232
|
return this._renderTargetSetWarmups;
|
|
860
1233
|
}
|
|
1234
|
+
get deferredScrollWarmups() { return this.inactiveScrollWarmups; }
|
|
861
1235
|
get stageModelRenderPasses() {
|
|
862
1236
|
return this._stageModelRenderPasses;
|
|
863
1237
|
}
|
|
@@ -873,13 +1247,15 @@ export class StageRenderPipeline {
|
|
|
873
1247
|
/** The facade advances owners first; this command submits the ordered GPU passes. */
|
|
874
1248
|
renderFrame(contentOnly, outline) {
|
|
875
1249
|
this.displayOutlineOpacity.value = 0;
|
|
1250
|
+
// After a held resize, update before the outer state snapshot so restoring
|
|
1251
|
+
// that scope cannot put the obsolete viewport back on the resized Canvas.
|
|
1252
|
+
this.syncBackgroundOutputSize();
|
|
876
1253
|
return withRendererState(this.ports.renderer, () => {
|
|
877
1254
|
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
878
1255
|
if (contentOnly) {
|
|
879
1256
|
this.ports.renderer.setRenderTarget(null);
|
|
880
1257
|
if (!this.ports.frame().outgoingBackground) {
|
|
881
|
-
this.
|
|
882
|
-
this.ports.renderer.clear();
|
|
1258
|
+
this.clearBackgroundOutput();
|
|
883
1259
|
}
|
|
884
1260
|
}
|
|
885
1261
|
else {
|
|
@@ -888,10 +1264,9 @@ export class StageRenderPipeline {
|
|
|
888
1264
|
this.ports.renderer.setRenderTarget(this._activeRenderTargets.sceneCapture);
|
|
889
1265
|
this.ports.renderStage();
|
|
890
1266
|
this.renderPanelBlurCaptures(this._activeRenderTargets);
|
|
891
|
-
if (outline)
|
|
1267
|
+
if (outline && this.ports.frame().detailMediaActive !== false)
|
|
892
1268
|
this.renderModelOutline(this._activeRenderTargets.sceneCapture, 1);
|
|
893
|
-
this.
|
|
894
|
-
this.renderBackgroundPanels();
|
|
1269
|
+
this.renderBackgroundOutput();
|
|
895
1270
|
}
|
|
896
1271
|
this.renderCarouselRear();
|
|
897
1272
|
this.renderForegroundLayer();
|