@spatial-elements/core 0.1.0-beta.2 → 1.0.0-beta.11
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 +4 -2
- 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 +144 -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 +5 -3
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +207 -91
- 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 +12 -27
- 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 +20 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
- package/dist/catalog/listDeviceOrientation.js +273 -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 +23 -11
- 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 +46 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +46 -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 +51 -7
- 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 +62 -71
- 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/SpaceMouseAdapter.d.ts +10 -2
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -1
- package/dist/stage/SpaceMouseAdapter.js +50 -8
- package/dist/stage/SpaceMouseAdapter.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +24 -2
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +198 -45
- 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 +266 -11
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +673 -126
- 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 -120
- 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 +6 -11
- 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 +33 -2
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/panelFocusMath.d.ts +34 -0
- package/dist/stage/panelFocusMath.d.ts.map +1 -0
- package/dist/stage/panelFocusMath.js +79 -0
- package/dist/stage/panelFocusMath.js.map +1 -0
- 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/scalarMath.d.ts +6 -0
- package/dist/stage/scalarMath.d.ts.map +1 -0
- package/dist/stage/scalarMath.js +6 -0
- package/dist/stage/scalarMath.js.map +1 -0
- 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/spaceMousePermission.d.ts +11 -0
- package/dist/stage/spaceMousePermission.d.ts.map +1 -0
- package/dist/stage/spaceMousePermission.js +63 -0
- package/dist/stage/spaceMousePermission.js.map +1 -0
- package/dist/stage/spaceMousePlatform.d.ts +12 -0
- package/dist/stage/spaceMousePlatform.d.ts.map +1 -0
- package/dist/stage/spaceMousePlatform.js +13 -0
- package/dist/stage/spaceMousePlatform.js.map +1 -0
- 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 +10 -10
- 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 +4 -33
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +39 -110
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +32 -4
- 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/dist/stage/webgpuSupport.d.ts +3 -0
- package/dist/stage/webgpuSupport.d.ts.map +1 -0
- package/dist/stage/webgpuSupport.js +14 -0
- package/dist/stage/webgpuSupport.js.map +1 -0
- package/logo.svg +225 -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,12 @@ export class StageRenderPipeline {
|
|
|
320
451
|
depthWrite: false,
|
|
321
452
|
transparent: true
|
|
322
453
|
});
|
|
323
|
-
material.
|
|
324
|
-
material.opacityNode = this.createOutlineOpacity(texture(maskTexture));
|
|
454
|
+
material.fragmentNode = vec4(inverseAcesToneMapping(this.outlineColor.rgb), this.createOutlineOpacity(texture(maskTexture)));
|
|
325
455
|
material.toneMapped = false;
|
|
326
456
|
return material;
|
|
327
457
|
}
|
|
328
458
|
disposeSceneCapture() {
|
|
459
|
+
this.warmConfiguration++;
|
|
329
460
|
this.disposeRenderTargetSet(this.fullQualityTargets);
|
|
330
461
|
this.disposeRenderTargetSet(this.scrollQualityTargets);
|
|
331
462
|
this.stageDisplayMaterial?.dispose();
|
|
@@ -337,6 +468,7 @@ export class StageRenderPipeline {
|
|
|
337
468
|
this.stageDisplayTextureNode = undefined;
|
|
338
469
|
}
|
|
339
470
|
createSceneCapture() {
|
|
471
|
+
this.warmConfiguration++;
|
|
340
472
|
const blurKeys = new Set(this.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options)));
|
|
341
473
|
this.fullQualityTargets = this.createRenderTargetSet(1, blurKeys);
|
|
342
474
|
this.scrollQualityTargets = this.createRenderTargetSet(SCROLL_RENDER_SCALE, blurKeys);
|
|
@@ -352,7 +484,7 @@ export class StageRenderPipeline {
|
|
|
352
484
|
if (this.fuseOutline) {
|
|
353
485
|
this.emptyOutlineMask.needsUpdate = true;
|
|
354
486
|
const source = this.stageDisplayTextureNode;
|
|
355
|
-
const haloColor =
|
|
487
|
+
const haloColor = inverseAcesToneMapping(this.outlineColor.rgb);
|
|
356
488
|
const haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);
|
|
357
489
|
// Merge into the existing linear display pass before the canvas output transform.
|
|
358
490
|
this.stageDisplayMaterial.fragmentNode = Fn(() => {
|
|
@@ -400,11 +532,16 @@ export class StageRenderPipeline {
|
|
|
400
532
|
targets.panelBlurCaptures.clear();
|
|
401
533
|
}
|
|
402
534
|
resizeRenderTargets() {
|
|
535
|
+
this.warmConfiguration++;
|
|
403
536
|
const width = window.innerWidth;
|
|
404
537
|
const height = window.innerHeight;
|
|
405
538
|
const pixelRatio = this.getFullPixelRatio();
|
|
406
|
-
if (!this.ports.frame().outgoingBackground)
|
|
539
|
+
if (!this.ports.frame().outgoingBackground) {
|
|
540
|
+
this.invalidateCatalogWarmOutput();
|
|
407
541
|
this.resizeCanvasTarget(this.ports.backgroundCanvasTarget, width, height, pixelRatio);
|
|
542
|
+
if (this.backgroundOutput?.getStats().mode === 'explicit' && !this.backgroundOutput.resize())
|
|
543
|
+
this.fallbackBackgroundOutput();
|
|
544
|
+
}
|
|
408
545
|
if (this.foregroundCanvasTarget) {
|
|
409
546
|
this.resizeCanvasTarget(this.foregroundCanvasTarget, width, height, pixelRatio);
|
|
410
547
|
}
|
|
@@ -420,14 +557,29 @@ export class StageRenderPipeline {
|
|
|
420
557
|
const captureHeight = Math.max(1, Math.round(height * pixelRatio * targets.scale));
|
|
421
558
|
targets.sceneCapture.setSize(captureWidth, captureHeight);
|
|
422
559
|
targets.panelBlurCaptures.forEach(({ target, effect, resolutionScale }) => {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
effect.resolutionScale =
|
|
426
|
-
|
|
560
|
+
if (effect) {
|
|
561
|
+
const effectScale = resolutionScale / (pixelRatio * targets.scale);
|
|
562
|
+
effect.resolutionScale = effectScale;
|
|
563
|
+
effect.setSize(captureWidth, captureHeight);
|
|
564
|
+
// Consumers sample normalized screen UVs. Preserve the blur's actual
|
|
565
|
+
// density instead of copying it back to a full-DPR viewport texture.
|
|
566
|
+
target.setSize(Math.max(1, Math.round(captureWidth * effectScale)), Math.max(1, Math.round(captureHeight * effectScale)));
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
// A zero-blur backdrop still contains sharp scene detail.
|
|
570
|
+
target.setSize(captureWidth, captureHeight);
|
|
571
|
+
}
|
|
427
572
|
});
|
|
428
573
|
}
|
|
429
574
|
getFullPixelRatio() {
|
|
430
|
-
return
|
|
575
|
+
return getStageRenderPixelRatio(window.innerWidth, window.innerHeight, window.devicePixelRatio, this.renderSettings);
|
|
576
|
+
}
|
|
577
|
+
setRenderSettings(settings) {
|
|
578
|
+
this.warmConfiguration++;
|
|
579
|
+
this.renderSettings = resolveStageRenderSettings(settings);
|
|
580
|
+
}
|
|
581
|
+
getRenderSettings() {
|
|
582
|
+
return { ...this.renderSettings };
|
|
431
583
|
}
|
|
432
584
|
setScrollRenderQuality(active) {
|
|
433
585
|
this.ports.container.toggleAttribute('data-stage-scroll-rendering', active);
|
|
@@ -457,6 +609,7 @@ export class StageRenderPipeline {
|
|
|
457
609
|
});
|
|
458
610
|
}
|
|
459
611
|
warmRenderTargetSets() {
|
|
612
|
+
this.syncBackgroundOutputSize();
|
|
460
613
|
const previousTargets = this._activeRenderTargets;
|
|
461
614
|
const availableTargets = [this.fullQualityTargets, this.scrollQualityTargets].filter((targets) => Boolean(targets));
|
|
462
615
|
if (!previousTargets || !this._stageDisplayQuad || availableTargets.length !== 2)
|
|
@@ -475,8 +628,7 @@ export class StageRenderPipeline {
|
|
|
475
628
|
this.ports.renderer.setRenderTarget(targets.sceneCapture);
|
|
476
629
|
this.ports.renderStage();
|
|
477
630
|
this.renderPanelBlurCaptures(targets, true);
|
|
478
|
-
this.
|
|
479
|
-
this.renderBackgroundPanels();
|
|
631
|
+
this.renderBackgroundOutput(!this.backgroundOutputHeld);
|
|
480
632
|
this._renderTargetSetWarmups += 1;
|
|
481
633
|
});
|
|
482
634
|
});
|
|
@@ -485,10 +637,166 @@ export class StageRenderPipeline {
|
|
|
485
637
|
this.activateRenderTargetSet(previousTargets);
|
|
486
638
|
}
|
|
487
639
|
}
|
|
640
|
+
/** Capture immediately after reveal's real warm draws, before its GPU fence.
|
|
641
|
+
* The facade publishes this only after that fence and its page-owner check.
|
|
642
|
+
*/
|
|
643
|
+
captureDeferredScrollWarmup(ownerIsCurrent) {
|
|
644
|
+
const renderer = this.ports.renderer, full = this.fullQualityTargets, scroll = this.scrollQualityTargets;
|
|
645
|
+
// The explicit output has a different warmed display owner. Retain the full
|
|
646
|
+
// preparation path until its no-write Scroll shortcut is separately proven.
|
|
647
|
+
if (this.backgroundOutputRequested)
|
|
648
|
+
return;
|
|
649
|
+
if (this.disposed || !full || !scroll || this._activeRenderTargets !== full || !this._stageDisplayQuad || !this.stageDisplayMaterial ||
|
|
650
|
+
!renderer.backend.isWebGPUBackend ||
|
|
651
|
+
renderer.xr.enabled || renderer.getOutputRenderTarget() || renderer.getMRT() || renderer.getRenderObjectFunction() ||
|
|
652
|
+
this.ports.panelScene.background || this.ports.panelScene.overrideMaterial ||
|
|
653
|
+
!ownerIsCurrent())
|
|
654
|
+
return;
|
|
655
|
+
const epoch = this.warmConfiguration, canvas = this.ports.backgroundCanvasTarget, quad = this._stageDisplayQuad, display = this.stageDisplayMaterial, displayVersion = display.version;
|
|
656
|
+
const width = window.innerWidth, height = window.innerHeight, dpr = window.devicePixelRatio;
|
|
657
|
+
const canvasSize = canvas.getDrawingBufferSize(new THREE.Vector2()), canvasViewport = canvas.getViewport(new THREE.Vector4()), canvasRatio = canvas.getPixelRatio(), currentSize = new THREE.Vector2(), currentViewport = new THREE.Vector4();
|
|
658
|
+
const tone = renderer.toneMapping, exposure = renderer.toneMappingExposure, space = renderer.outputColorSpace;
|
|
659
|
+
const panels = [...this.ports.panelRuntimes()], views = [...this.ports.minimaps().values()];
|
|
660
|
+
const panelOwners = panels.map(panel => ({ panel, glass: panel.glass, group: panel.group, projection: panel.projectionRoot, options: panel.options, surface: panel.surface }));
|
|
661
|
+
const materials = [];
|
|
662
|
+
const groups = [];
|
|
663
|
+
const allowed = new Set([this.ports.panelScene]);
|
|
664
|
+
for (const panel of panels) {
|
|
665
|
+
for (let node = panel.group; node && node !== this.ports.panelScene; node = node.parent)
|
|
666
|
+
allowed.add(node);
|
|
667
|
+
if (!panel.glass)
|
|
668
|
+
continue;
|
|
669
|
+
if (!(panel.glass instanceof LiquidGlassPanel) || !panel.glass.hasOwnedRenderGraph())
|
|
670
|
+
return;
|
|
671
|
+
let supported = true;
|
|
672
|
+
panel.group.traverse(node => {
|
|
673
|
+
allowed.add(node);
|
|
674
|
+
groups.push({ node, children: [...node.children] });
|
|
675
|
+
if (!isMesh(node))
|
|
676
|
+
return;
|
|
677
|
+
const material = node.material;
|
|
678
|
+
if (Array.isArray(material) || !(material instanceof THREE.MeshBasicMaterial || material instanceof THREE.MeshBasicNodeMaterial) ||
|
|
679
|
+
node.onBeforeRender !== THREE.Object3D.prototype.onBeforeRender || node.onAfterRender !== THREE.Object3D.prototype.onAfterRender) {
|
|
680
|
+
supported = false;
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
materials.push({ mesh: node, material, version: material.version });
|
|
684
|
+
});
|
|
685
|
+
if (!supported)
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
let controlledScene = true;
|
|
689
|
+
this.ports.panelScene.traverse(node => {
|
|
690
|
+
if ((!allowed.has(node) && !(node instanceof THREE.Light && !node.castShadow)) ||
|
|
691
|
+
node.onBeforeRender !== THREE.Object3D.prototype.onBeforeRender || node.onAfterRender !== THREE.Object3D.prototype.onAfterRender)
|
|
692
|
+
controlledScene = false;
|
|
693
|
+
groups.push({ node, children: [...node.children] });
|
|
694
|
+
});
|
|
695
|
+
if (!controlledScene)
|
|
696
|
+
return;
|
|
697
|
+
const targets = [full, scroll].flatMap(set => [set.sceneCapture, ...[...set.panelBlurCaptures.values()].map(capture => capture.target)])
|
|
698
|
+
.map(target => ({ target, width: target.width, height: target.height }));
|
|
699
|
+
return { owner: this, used: false, current: () => !this.disposed && ownerIsCurrent() && this.warmConfiguration === epoch &&
|
|
700
|
+
this.fullQualityTargets === full && this.scrollQualityTargets === scroll && this._activeRenderTargets === full &&
|
|
701
|
+
this._stageDisplayQuad === quad && quad.material === display && display.version === displayVersion && this.ports.backgroundCanvasTarget === canvas &&
|
|
702
|
+
window.innerWidth === width && window.innerHeight === height && window.devicePixelRatio === dpr &&
|
|
703
|
+
canvas.getPixelRatio() === canvasRatio && canvas.getDrawingBufferSize(currentSize).equals(canvasSize) && canvas.getViewport(currentViewport).equals(canvasViewport) &&
|
|
704
|
+
!renderer.xr.enabled && !renderer.getOutputRenderTarget() && !renderer.getMRT() && !renderer.getRenderObjectFunction() &&
|
|
705
|
+
!this.ports.panelScene.background && !this.ports.panelScene.overrideMaterial &&
|
|
706
|
+
renderer.toneMapping === tone && renderer.toneMappingExposure === exposure && renderer.outputColorSpace === space &&
|
|
707
|
+
!this.ports.frame().outgoingBackground &&
|
|
708
|
+
panels.length === this.ports.panelRuntimes().length && panels.every((panel, i) => panel === this.ports.panelRuntimes()[i]) &&
|
|
709
|
+
panelOwners.every(({ panel, glass, group, projection, options, surface }) => panel.glass === glass && panel.group === group &&
|
|
710
|
+
panel.projectionRoot === projection && panel.options === options && panel.surface === surface && (!glass || glass.hasOwnedRenderGraph())) &&
|
|
711
|
+
views.length === this.ports.minimaps().size && views.every(view => this.ports.minimaps().get(view.panelIndex) === view) &&
|
|
712
|
+
materials.every(({ mesh, material, version }) => mesh.material === material && material.version === version) &&
|
|
713
|
+
groups.every(({ node, children }) => node.onBeforeRender === THREE.Object3D.prototype.onBeforeRender &&
|
|
714
|
+
node.onAfterRender === THREE.Object3D.prototype.onAfterRender && node.children.length === children.length && children.every((child, i) => node.children[i] === child)) &&
|
|
715
|
+
targets.every(({ target, width, height }) => target.width === width && target.height === height) };
|
|
716
|
+
}
|
|
717
|
+
/** Warm only inactive Scroll resources without writing Canvas color/depth.
|
|
718
|
+
* A stale token performs no mutation; the caller retains the complete warm path.
|
|
719
|
+
*/
|
|
720
|
+
warmInactiveScrollTargetSet(token) {
|
|
721
|
+
if (token.owner !== this || token.used || !token.current())
|
|
722
|
+
return false;
|
|
723
|
+
token.used = true;
|
|
724
|
+
const previous = this._activeRenderTargets, renderer = this.ports.renderer;
|
|
725
|
+
const autoClear = renderer.autoClear;
|
|
726
|
+
try {
|
|
727
|
+
withRendererState(renderer, () => {
|
|
728
|
+
renderer.autoClear = false;
|
|
729
|
+
this.activateRenderTargetSet(this.scrollQualityTargets);
|
|
730
|
+
renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
731
|
+
renderer.setScissorTest(false);
|
|
732
|
+
renderer.setRenderTarget(this.scrollQualityTargets.sceneCapture);
|
|
733
|
+
this.ports.renderStage();
|
|
734
|
+
this.renderPanelBlurCaptures(this.scrollQualityTargets, true);
|
|
735
|
+
// Full reveal already drew the same display/panel materials and Canvas
|
|
736
|
+
// contexts. Scroll only replaces their sampled textures with matching
|
|
737
|
+
// types/filters. Keep preparation entirely offscreen; it must not
|
|
738
|
+
// acquire or publish another Canvas output texture.
|
|
739
|
+
this._renderTargetSetWarmups++;
|
|
740
|
+
this.inactiveScrollWarmups++;
|
|
741
|
+
});
|
|
742
|
+
return true;
|
|
743
|
+
}
|
|
744
|
+
finally {
|
|
745
|
+
renderer.autoClear = autoClear;
|
|
746
|
+
this.activateRenderTargetSet(previous);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
/** Warm the bound DETAIL's actual reveal passes while its DOM remains hidden.
|
|
750
|
+
* Unlike optional scroll/zoom preparation this uses only the active target set.
|
|
751
|
+
* Offscreen captures receive real pixels; Canvas pipelines keep their exact
|
|
752
|
+
* output context but a zero-area scissor prevents any visible warm-up draw.
|
|
753
|
+
*/
|
|
754
|
+
warmRevealFrame() {
|
|
755
|
+
const targets = this._activeRenderTargets;
|
|
756
|
+
if (this.disposed || !targets || !this._stageDisplayQuad || !this.foregroundCanvasTarget)
|
|
757
|
+
return false;
|
|
758
|
+
return withRendererState(this.ports.renderer, () => {
|
|
759
|
+
const renderer = this.ports.renderer;
|
|
760
|
+
renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
761
|
+
renderer.setRenderTarget(targets.sceneCapture);
|
|
762
|
+
renderer.setScissorTest(false);
|
|
763
|
+
this.ports.renderStage();
|
|
764
|
+
this.renderPanelBlurCaptures(targets, true);
|
|
765
|
+
const maskCanvas = (canvas) => {
|
|
766
|
+
renderer.setCanvasTarget(canvas);
|
|
767
|
+
renderer.setRenderTarget(null);
|
|
768
|
+
renderer.setScissor(new THREE.Vector4(0, 0, 0, 0));
|
|
769
|
+
renderer.setScissorTest(true);
|
|
770
|
+
};
|
|
771
|
+
// Explicit output composition stays offscreen, without publishing over
|
|
772
|
+
// the source Canvas. The legacy path retains its masked, clear-free draw.
|
|
773
|
+
this.renderBackgroundOutput(false);
|
|
774
|
+
maskCanvas(this.foregroundCanvasTarget);
|
|
775
|
+
this.renderMinimapScene();
|
|
776
|
+
return true;
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
/** Borrow the already selected scene output after all warm live passes. */
|
|
780
|
+
withSceneCapture(draw) {
|
|
781
|
+
const targets = this._activeRenderTargets;
|
|
782
|
+
if (this.disposed || !targets)
|
|
783
|
+
return;
|
|
784
|
+
return withRendererState(this.ports.renderer, () => {
|
|
785
|
+
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
786
|
+
this.ports.renderer.setRenderTarget(targets.sceneCapture);
|
|
787
|
+
this.ports.renderer.setScissorTest(false);
|
|
788
|
+
return draw();
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
isSceneCaptureCurrent(target, width, height) {
|
|
792
|
+
return !this.disposed && this._activeRenderTargets?.sceneCapture === target && target.width === width && target.height === height;
|
|
793
|
+
}
|
|
488
794
|
resizeCanvasTarget(target, width, height, pixelRatio) {
|
|
489
795
|
this.ports.renderer.setCanvasTarget(target);
|
|
490
796
|
this.ports.renderer.setPixelRatio(pixelRatio);
|
|
491
|
-
|
|
797
|
+
// The CSS display rectangle must match the camera/buffer even while mobile
|
|
798
|
+
// browser chrome animates. 100vh can represent a different viewport height.
|
|
799
|
+
this.ports.renderer.setSize(width, height, true);
|
|
492
800
|
}
|
|
493
801
|
createPanelBlurCapture(sceneTexture, blur, renderScale) {
|
|
494
802
|
const target = new THREE.RenderTarget(1, 1, {
|
|
@@ -501,7 +809,7 @@ export class StageRenderPipeline {
|
|
|
501
809
|
target.texture.colorSpace = THREE.NoColorSpace;
|
|
502
810
|
const sourceTexture = texture(sceneTexture);
|
|
503
811
|
// Scale resolution and sample offsets together to retain the CSS blur radius.
|
|
504
|
-
// The final
|
|
812
|
+
// The final texture uses the same density and normalized screen-space mapping.
|
|
505
813
|
const query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search);
|
|
506
814
|
const fullResolutionProbe = query.get('stage-test') === '1' && query.get('stage-backdrop') === 'full';
|
|
507
815
|
const blurResolution = blur >= 4 && !fullResolutionProbe ? 0.5 : 1;
|
|
@@ -525,6 +833,28 @@ export class StageRenderPipeline {
|
|
|
525
833
|
const value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;
|
|
526
834
|
return Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;
|
|
527
835
|
}
|
|
836
|
+
/** Allocate changed blur settings without replacing the scene capture or model resources. */
|
|
837
|
+
syncPanelBlurCaptures() {
|
|
838
|
+
this.warmConfiguration++;
|
|
839
|
+
const keys = new Set(this.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options)));
|
|
840
|
+
if (!this._activeRenderTargets && keys.size)
|
|
841
|
+
this.createSceneCapture();
|
|
842
|
+
for (const targets of [this.fullQualityTargets, this.scrollQualityTargets]) {
|
|
843
|
+
if (!targets)
|
|
844
|
+
continue;
|
|
845
|
+
for (const key of keys)
|
|
846
|
+
if (!targets.panelBlurCaptures.has(key))
|
|
847
|
+
targets.panelBlurCaptures.set(key, this.createPanelBlurCapture(targets.sceneCapture.texture, key, targets.scale));
|
|
848
|
+
for (const [key, capture] of targets.panelBlurCaptures)
|
|
849
|
+
if (!keys.has(key)) {
|
|
850
|
+
capture.target.dispose();
|
|
851
|
+
capture.material.dispose();
|
|
852
|
+
capture.effect?.dispose();
|
|
853
|
+
targets.panelBlurCaptures.delete(key);
|
|
854
|
+
}
|
|
855
|
+
this.resizeRenderTargetSet(targets, window.innerWidth, window.innerHeight, this.getFullPixelRatio());
|
|
856
|
+
}
|
|
857
|
+
}
|
|
528
858
|
getPanelBlurTexture(options, targets = this._activeRenderTargets) {
|
|
529
859
|
const blur = this.getPanelBlurKey(options);
|
|
530
860
|
const capture = targets?.panelBlurCaptures.get(blur);
|
|
@@ -705,13 +1035,16 @@ export class StageRenderPipeline {
|
|
|
705
1035
|
}
|
|
706
1036
|
renderModelOutline(target, opacity = 1) {
|
|
707
1037
|
this.displayOutlineOpacity.value = 0;
|
|
708
|
-
|
|
1038
|
+
// The transferred model owns its moving outline, including its interpolated camera.
|
|
1039
|
+
if (this.ports.spatialCapture?.())
|
|
1040
|
+
return;
|
|
1041
|
+
if (this.renderMeasurement === 'no-halo' || !this.ports.frame().modelHover)
|
|
709
1042
|
return;
|
|
710
1043
|
const opacityBefore = this.outlineOpacityScale.value;
|
|
711
1044
|
try {
|
|
712
1045
|
return withRendererState(this.ports.renderer, () => {
|
|
713
1046
|
if (!this.ports.frame().stageViewportVisible ||
|
|
714
|
-
!
|
|
1047
|
+
!this.ports.frame().modelHover ||
|
|
715
1048
|
!this.outlineMaskTarget ||
|
|
716
1049
|
!this.outlineQuad)
|
|
717
1050
|
return;
|
|
@@ -777,14 +1110,51 @@ export class StageRenderPipeline {
|
|
|
777
1110
|
renderStageDisplay() {
|
|
778
1111
|
if (!this._stageDisplayQuad)
|
|
779
1112
|
return;
|
|
780
|
-
this.ports
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
this.
|
|
1113
|
+
const { renderer, backgroundCanvasTarget } = this.ports;
|
|
1114
|
+
renderer.setRenderTarget(null);
|
|
1115
|
+
renderer.setCanvasTarget(backgroundCanvasTarget);
|
|
1116
|
+
renderer.setClearColor(0xffffff, 1);
|
|
1117
|
+
if (!this.canClearWithStageDisplay()) {
|
|
1118
|
+
renderer.clear();
|
|
1119
|
+
this._stageDisplayQuad.render(renderer);
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
// Only this opaque, depth-independent fullscreen copy has no nested scene
|
|
1123
|
+
// rendering. Include its clear in the same render pass, avoiding the manual
|
|
1124
|
+
// Canvas clear's separate pass and intermediate output-color-transform draw.
|
|
1125
|
+
const { autoClear, autoClearColor, autoClearDepth, autoClearStencil } = renderer;
|
|
1126
|
+
try {
|
|
1127
|
+
renderer.autoClear = renderer.autoClearColor = renderer.autoClearDepth = renderer.autoClearStencil = true;
|
|
1128
|
+
this._stageDisplayQuad.render(renderer);
|
|
1129
|
+
}
|
|
1130
|
+
finally {
|
|
1131
|
+
renderer.autoClear = autoClear;
|
|
1132
|
+
renderer.autoClearColor = autoClearColor;
|
|
1133
|
+
renderer.autoClearDepth = autoClearDepth;
|
|
1134
|
+
renderer.autoClearStencil = autoClearStencil;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
canClearWithStageDisplay() {
|
|
1138
|
+
const { renderer, backgroundCanvasTarget } = this.ports;
|
|
1139
|
+
// Deliberately retain explicit clearing for unproved output configurations.
|
|
1140
|
+
if (!renderer.backend?.isWebGPUBackend ||
|
|
1141
|
+
renderer.xr.isPresenting || renderer.stencil || renderer.reversedDepthBuffer ||
|
|
1142
|
+
renderer.getClearDepth() !== 1 || renderer.getClearStencil() !== 0 ||
|
|
1143
|
+
renderer.getOutputRenderTarget() !== null || renderer.getMRT() !== null ||
|
|
1144
|
+
backgroundCanvasTarget.getScissorTest())
|
|
1145
|
+
return false;
|
|
1146
|
+
const viewport = backgroundCanvasTarget.getViewport(this.displayViewport);
|
|
1147
|
+
const size = backgroundCanvasTarget.getSize(this.displaySize);
|
|
1148
|
+
return size.x > 0 && size.y > 0 && viewport.x === 0 && viewport.y === 0 &&
|
|
1149
|
+
viewport.z === size.x && viewport.w === size.y;
|
|
785
1150
|
}
|
|
786
1151
|
renderStageContents() {
|
|
787
1152
|
this.ports.renderer.clear();
|
|
1153
|
+
if (this.ports.frame().detailMediaActive === false) {
|
|
1154
|
+
this.backgroundCoverOpacity.value = 1;
|
|
1155
|
+
this.backgroundCover.render(this.ports.renderer);
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
788
1158
|
this.ports.renderer.render(this.ports.backgroundScene, this.ports.camera);
|
|
789
1159
|
this.ports.renderer.render(this.ports.tintScene, this.ports.tintCamera);
|
|
790
1160
|
this.backgroundCoverOpacity.value = 1 - this.ports.frame().backgroundReveal;
|
|
@@ -814,7 +1184,7 @@ export class StageRenderPipeline {
|
|
|
814
1184
|
resizeOutline(width, height) {
|
|
815
1185
|
this.outlineWidth = width;
|
|
816
1186
|
this.outlineHeight = height;
|
|
817
|
-
const scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : 1;
|
|
1187
|
+
const scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : typeof window === 'undefined' ? 1 : this.getFullPixelRatio();
|
|
818
1188
|
this.outlineMaskTarget?.setSize(Math.max(1, Math.round(width * scale)), Math.max(1, Math.round(height * scale)));
|
|
819
1189
|
this.outlineMaskValid = false;
|
|
820
1190
|
this.outlineTexel.value.set(this.ports.interactionTheme().outlineThickness / Math.max(width, 1), this.ports.interactionTheme().outlineThickness / Math.max(height, 1));
|
|
@@ -828,6 +1198,8 @@ export class StageRenderPipeline {
|
|
|
828
1198
|
if (this.disposed)
|
|
829
1199
|
return;
|
|
830
1200
|
this.disposed = true;
|
|
1201
|
+
this.invalidateCatalogWarmOutput();
|
|
1202
|
+
this.backgroundOutput?.dispose();
|
|
831
1203
|
this.releaseOutline();
|
|
832
1204
|
this.emptyOutlineMask.dispose();
|
|
833
1205
|
this.disposeSceneCapture();
|
|
@@ -858,6 +1230,7 @@ export class StageRenderPipeline {
|
|
|
858
1230
|
get renderTargetSetWarmups() {
|
|
859
1231
|
return this._renderTargetSetWarmups;
|
|
860
1232
|
}
|
|
1233
|
+
get deferredScrollWarmups() { return this.inactiveScrollWarmups; }
|
|
861
1234
|
get stageModelRenderPasses() {
|
|
862
1235
|
return this._stageModelRenderPasses;
|
|
863
1236
|
}
|
|
@@ -873,13 +1246,15 @@ export class StageRenderPipeline {
|
|
|
873
1246
|
/** The facade advances owners first; this command submits the ordered GPU passes. */
|
|
874
1247
|
renderFrame(contentOnly, outline) {
|
|
875
1248
|
this.displayOutlineOpacity.value = 0;
|
|
1249
|
+
// After a held resize, update before the outer state snapshot so restoring
|
|
1250
|
+
// that scope cannot put the obsolete viewport back on the resized Canvas.
|
|
1251
|
+
this.syncBackgroundOutputSize();
|
|
876
1252
|
return withRendererState(this.ports.renderer, () => {
|
|
877
1253
|
this.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);
|
|
878
1254
|
if (contentOnly) {
|
|
879
1255
|
this.ports.renderer.setRenderTarget(null);
|
|
880
1256
|
if (!this.ports.frame().outgoingBackground) {
|
|
881
|
-
this.
|
|
882
|
-
this.ports.renderer.clear();
|
|
1257
|
+
this.clearBackgroundOutput();
|
|
883
1258
|
}
|
|
884
1259
|
}
|
|
885
1260
|
else {
|
|
@@ -888,10 +1263,9 @@ export class StageRenderPipeline {
|
|
|
888
1263
|
this.ports.renderer.setRenderTarget(this._activeRenderTargets.sceneCapture);
|
|
889
1264
|
this.ports.renderStage();
|
|
890
1265
|
this.renderPanelBlurCaptures(this._activeRenderTargets);
|
|
891
|
-
if (outline)
|
|
1266
|
+
if (outline && this.ports.frame().detailMediaActive !== false)
|
|
892
1267
|
this.renderModelOutline(this._activeRenderTargets.sceneCapture, 1);
|
|
893
|
-
this.
|
|
894
|
-
this.renderBackgroundPanels();
|
|
1268
|
+
this.renderBackgroundOutput();
|
|
895
1269
|
}
|
|
896
1270
|
this.renderCarouselRear();
|
|
897
1271
|
this.renderForegroundLayer();
|