@realsee/five-webgpu 1.0.0-alpha.5 → 1.0.0-alpha.7
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/ai_guides/api.md +9 -8
- package/ai_guides/features/camera-animation.md +1 -1
- package/ai_guides/features/event.md +0 -1
- package/ai_guides/features/five.md +78 -9
- package/ai_guides/features/gesture.md +1 -1
- package/ai_guides/features/load-external-model.md +6 -6
- package/ai_guides/features/load-progress.md +2 -2
- package/ai_guides/features/material.md +35 -8
- package/ai_guides/features/mode.md +26 -29
- package/ai_guides/features/model.md +1 -1
- package/ai_guides/features/state.md +2 -2
- package/ai_guides/features/ultra-hdr.md +41 -32
- package/ai_guides/quick-start.md +2 -2
- package/ai_guides/release_notes/6.8.md +2 -2
- package/ai_guides/support.md +0 -4
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/index.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/index.BoundingMesh.html +1 -1
- package/docs/classes/index.Camera.html +1 -1
- package/docs/classes/index.EffectComposer.html +1 -1
- package/docs/classes/index.EyeDomeLightingPass.html +1 -1
- package/docs/classes/index.Five.html +69 -67
- package/docs/classes/index.FivePass.html +1 -1
- package/docs/classes/index.FlowingFireworks3DPass.html +1 -1
- package/docs/classes/index.FlowingLight2DPass.html +1 -1
- package/docs/classes/index.FlowingLight3DPass.html +2 -2
- package/docs/classes/index.GaussianBlurPass.html +1 -1
- package/docs/classes/index.InternalWebGPURenderer.html +8 -5
- package/docs/classes/index.Model.html +1 -1
- package/docs/classes/index.ModelScene.html +1 -1
- package/docs/classes/index.NetworkSubscribe.html +1 -1
- package/docs/classes/index.PBMCustomNode.html +8 -8
- package/docs/classes/index.PBMGaussianSplattingNodeMaterial.html +8 -6
- package/docs/classes/index.PBMGaussianSplattingObject.html +10 -4
- package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +26 -15
- package/docs/classes/index.PBMGroup.html +1 -1
- package/docs/classes/index.PBMMesh.html +1 -1
- package/docs/classes/index.PBMMeshBasicMaterial.html +13 -8
- package/docs/classes/index.PBMMeshBasicNodeMaterial.html +15 -10
- package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +13 -8
- package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +13 -8
- package/docs/classes/index.PBMMeshPhongMaterial.html +13 -8
- package/docs/classes/index.PBMMeshPhongNodeMaterial.html +15 -10
- package/docs/classes/index.PBMMeshPhysicalMaterial.html +13 -8
- package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +15 -10
- package/docs/classes/index.PBMPanoFilter.html +8 -8
- package/docs/classes/index.PBMPointCloud.html +6 -7
- package/docs/classes/index.PBMPointCloudMaterial.html +83 -0
- package/docs/classes/index.PBMSkinnedMesh.html +1 -1
- package/docs/classes/index.PBMUpdateable.html +1 -1
- package/docs/classes/index.PanoCircleMesh.html +1 -1
- package/docs/classes/index.PanoCircleMeshCustom.html +5 -5
- package/docs/classes/index.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/index.Parameter.html +57 -56
- package/docs/classes/index.Scene.html +1 -1
- package/docs/classes/index.Subscribe.html +1 -1
- package/docs/classes/index.TextureLoader.html +4 -1
- package/docs/classes/index.Tile3D.html +23 -21
- package/docs/classes/index.TileNode.html +1 -1
- package/docs/classes/index.Tileset.html +4 -4
- package/docs/classes/index.TrajectoryNode.html +3 -3
- package/docs/classes/index.Work.html +20 -18
- package/docs/classes/index.WorkResolvedObserver.html +22 -22
- package/docs/classes/index.XRButton.html +3 -0
- package/docs/documents/api.html +11 -10
- package/docs/documents/features_camera-animation.html +1 -1
- package/docs/documents/features_event.html +0 -1
- package/docs/documents/features_five.html +51 -9
- package/docs/documents/features_gesture.html +1 -1
- package/docs/documents/features_load-external-model.html +6 -6
- package/docs/documents/features_load-progress.html +1 -1
- package/docs/documents/features_material.html +20 -9
- package/docs/documents/features_mode.html +28 -13
- package/docs/documents/features_model.html +1 -1
- package/docs/documents/features_state.html +1 -1
- package/docs/documents/features_ultra-hdr.html +50 -44
- package/docs/documents/quick-start.html +1 -1
- package/docs/documents/release_notes_6.8.html +2 -2
- package/docs/documents/support.html +1 -3
- package/docs/functions/index.customNodesCacheKey.html +1 -1
- package/docs/functions/index.parseWork.html +1 -1
- package/docs/functions/index.workToJson.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/index.AddableObject.html +1 -1
- package/docs/interfaces/index.AjaxOptions.html +1 -1
- package/docs/interfaces/index.BaseEvent.html +2 -2
- package/docs/interfaces/index.Clock.html +24 -0
- package/docs/interfaces/index.DeviceProfile.html +8 -0
- package/docs/interfaces/index.EventCallback.html +49 -47
- package/docs/interfaces/index.FiveInitArgs.html +65 -41
- package/docs/interfaces/index.GainmapCfgData.html +15 -0
- package/docs/interfaces/index.GestureEvent.html +2 -2
- package/docs/interfaces/index.IPBMMaterial.html +12 -7
- package/docs/interfaces/index.ImageOptions.html +1 -1
- package/docs/interfaces/index.IntersectEvent.html +2 -2
- package/docs/interfaces/index.IntersectMesh.html +1 -1
- package/docs/interfaces/index.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/index.Intersection.html +1 -1
- package/docs/interfaces/index.LoosePanoWork.html +2 -2
- package/docs/interfaces/index.LooseWork.html +2 -2
- package/docs/interfaces/index.LooseWorkInitial.html +2 -2
- package/docs/interfaces/index.LooseWorkModel.html +2 -2
- package/docs/interfaces/index.LooseWorkObserver.html +2 -2
- package/docs/interfaces/index.LooseWorkPanorama.html +4 -3
- package/docs/interfaces/index.LooseWorkWithExtrinsics.html +15 -9
- package/docs/interfaces/index.ModeChangeEvent.html +2 -2
- package/docs/interfaces/index.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ModelEvent.html +2 -2
- package/docs/interfaces/index.ModelSceneEvent.html +2 -2
- package/docs/interfaces/index.ModelTileEvent.html +2 -2
- package/docs/interfaces/index.MovePanoOptions.html +1 -1
- package/docs/interfaces/index.NetworkAbortError.html +1 -1
- package/docs/interfaces/index.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/index.NetworkOptions.html +1 -1
- package/docs/interfaces/index.NetworkProxyError.html +1 -1
- package/docs/interfaces/index.NetworkResourceEvent.html +2 -2
- package/docs/interfaces/index.NetworkResponseError.html +1 -1
- package/docs/interfaces/index.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/index.ObjectEvent.html +2 -2
- package/docs/interfaces/index.PBMClipperParameter.html +2 -2
- package/docs/interfaces/index.PBMCustomNodeContext.html +60 -12
- package/docs/interfaces/index.PBMCustomNodeOptions.html +4 -4
- package/docs/interfaces/index.PBMCustomNodePanoContext.html +13 -6
- package/docs/interfaces/index.PBMCustomNodeSlots.html +6 -6
- package/docs/interfaces/index.PBMGaussianSplattingNodeMaterialOptions.html +4 -0
- package/docs/interfaces/index.PBMPanoDepth.html +5 -5
- package/docs/interfaces/index.PBMPanoFilterValue.html +2 -2
- package/docs/interfaces/index.PBMPanoGainmap.html +6 -0
- package/docs/interfaces/index.PBMPanoPicture.html +9 -8
- package/docs/interfaces/index.PBMRefinedScreen.html +2 -2
- package/docs/interfaces/index.PanoCircleMeshCustomOptions.html +2 -2
- package/docs/interfaces/index.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/index.PanoEvent.html +2 -2
- package/docs/interfaces/index.PanoPrepareEvent.html +15 -0
- package/docs/interfaces/index.PanoTextureEvent.html +2 -2
- package/docs/interfaces/index.PanoramaControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/index.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ParameterMaterialValue.html +42 -41
- package/docs/interfaces/index.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/index.ParameterValue.html +56 -55
- package/docs/interfaces/index.Pose.html +1 -1
- package/docs/interfaces/index.RenderEvent.html +2 -2
- package/docs/interfaces/index.ResolvedParameterValue.html +56 -55
- package/docs/interfaces/index.State.html +1 -1
- package/docs/interfaces/index.StateEvent.html +2 -2
- package/docs/interfaces/index.TextureOptions.html +1 -1
- package/docs/interfaces/index.TilesetOptions.html +7 -2
- package/docs/interfaces/index.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.VRPanoramaControllerCustomInitArgs.html +37 -0
- package/docs/interfaces/index.ViewLayer.html +23 -21
- package/docs/interfaces/index.WorkCubeHdrGainmapImage.html +10 -0
- package/docs/interfaces/index.WorkCubeImage.html +5 -9
- package/docs/interfaces/index.WorkImage.html +8 -12
- package/docs/interfaces/index.WorkInitial.html +8 -8
- package/docs/interfaces/index.WorkModel.html +8 -8
- package/docs/interfaces/index.WorkModelLayer.html +6 -6
- package/docs/interfaces/index.WorkObserver.html +23 -23
- package/docs/interfaces/index.WorkPanoramaJson.html +3 -2
- package/docs/interfaces/index.WorkTile.html +8 -12
- package/docs/interfaces/index.WorksEvent.html +2 -2
- package/docs/interfaces/index.XRControllerEvent.html +2 -2
- package/docs/interfaces/index.XRGestureEvent.html +2 -2
- package/docs/interfaces/index.XRPanoramaControllerCustomInitArgs.html +52 -0
- package/docs/interfaces/index.XRSessionEvent.html +2 -2
- package/docs/modules/index.html +1 -1
- package/docs/types/index.ControllerCustomInitTypes.html +4 -2
- package/docs/types/index.ControllerEventTypes.html +25 -23
- package/docs/types/index.DeviceProfileOverride.html +5 -0
- package/docs/types/index.EventTypes.html +26 -26
- package/docs/types/index.FlowingLightLineInput.html +11 -0
- package/docs/types/index.Mode.html +6 -3
- package/docs/types/index.OutputTextureDataType.html +1 -1
- package/docs/types/index.PBMCustomNodeTargetType.html +1 -1
- package/docs/types/index.ParseOptions.html +14 -8
- package/docs/types/index.XRMachineType.html +7 -0
- package/docs/variables/index.GSPLAT_PIPELINE_AUTO.html +2 -0
- package/docs/variables/index.GSPLAT_PIPELINE_RASTER_CPU_SORT.html +2 -0
- package/docs/variables/index.GSPLAT_PIPELINE_RASTER_GPU_SORT.html +2 -0
- package/docs/variables/index.PBMVertexMarkFlag.html +4 -0
- package/docs/variables/index.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
- package/docs/variables/index.controllersDefaultInitArgs.html +1 -1
- package/five/application/controllers.d.ts +8 -0
- package/five/application/events.d.ts +1 -1
- package/five/application/five.d.ts +6 -1
- package/five/application/fiveInitArgs.d.ts +32 -1
- package/five/application/mode.d.ts +8 -1
- package/five/cardboard/helper.d.ts +2 -0
- package/five/cardboard/index.d.ts +13 -0
- package/five/cardboard/sensor.d.ts +158 -0
- package/five/controllers/base.d.ts +3 -0
- package/five/controllers/events.d.ts +5 -3
- package/five/controllers/panorama.d.ts +2 -2
- package/five/controllers/vrPanorama.d.ts +56 -0
- package/five/controllers/xrPanorama.d.ts +506 -0
- package/five/core/internalWebGPURenderer.d.ts +7 -1
- package/five/core/panoVideo.d.ts +4 -1
- package/five/core/tiling.d.ts +25 -11
- package/five/core/webglAsyncReadFix.d.ts +25 -0
- package/five/gaussian-splatting/gpu-sort/prefixSumKernel.d.ts +65 -0
- package/five/gaussian-splatting/gpu-sort/radixSortModule.d.ts +128 -0
- package/five/gaussian-splatting/gpu-sort/shaders/prefixSum.d.ts +2 -0
- package/five/gaussian-splatting/gpu-sort/shaders/radixHistogram.d.ts +2 -0
- package/five/gaussian-splatting/gpu-sort/shaders/radixReorder.d.ts +2 -0
- package/five/gaussian-splatting/gpu-sort/shaders/sortKeygen.d.ts +2 -0
- package/five/gaussian-splatting/gpu-sort/sortAdapter.d.ts +234 -0
- package/five/gaussian-splatting/pipelines/cpuSortPipeline.d.ts +159 -0
- package/five/gaussian-splatting/pipelines/gpuSortPipeline.d.ts +98 -0
- package/five/gaussian-splatting/pipelines/gsplatPipeline.d.ts +104 -0
- package/five/gaussian-splatting/pipelines/pipelineMode.d.ts +42 -0
- package/five/gaussian-splatting/pipelines/sortThrottle.d.ts +45 -0
- package/five/index.d.ts +8 -2
- package/five/index.js +272 -269
- package/five/index.mjs +8389 -4487
- package/five/meshes/panoCircleMeshCustom.d.ts +1 -0
- package/five/model/index.d.ts +3 -2
- package/five/model/materials/pbmGaussianSplattingNodeMaterial.d.ts +4 -0
- package/five/model/materials/pbmMaterial.d.ts +126 -19
- package/five/model/materials/pbmMeshMaterial.d.ts +0 -9
- package/five/model/materials/pbmPointCloudNodeMaterial.d.ts +1 -1
- package/five/model/materials/tsl/defines.d.ts +6 -1
- package/five/model/materials/tsl/outputBuilder.d.ts +1 -12
- package/five/model/materials/tsl/panoColor.d.ts +8 -2
- package/five/model/materials/tsl/utils.d.ts +13 -0
- package/five/model/objects/pbmGaussianSplattingObject.d.ts +9 -0
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +67 -101
- package/five/model/objects/pbmPointCloud.d.ts +0 -1
- package/five/model/objects/pbmPointCloudObject.d.ts +1 -1
- package/five/model/parameter.d.ts +5 -4
- package/five/model/tile3d/index.d.ts +2 -0
- package/five/model/tile3d/tileset.d.ts +5 -0
- package/five/model/tile3d/trajectory-content.d.ts +53 -0
- package/five/renderer/index.d.ts +1 -1
- package/five/renderer/postprocessing/index.d.ts +1 -1
- package/five/texture/loader.d.ts +6 -0
- package/five/types/cube.d.ts +0 -1
- package/five/utils/detector.d.ts +11 -1
- package/five/utils/error.d.ts +1 -0
- package/five/utils/event.d.ts +26 -3
- package/five/utils/gainmap-data.d.ts +23 -0
- package/five/webxr/XRControllerModelFactory.d.ts +55 -0
- package/five/webxr/buttonStateMachine.d.ts +31 -0
- package/five/webxr/deviceProfile.d.ts +70 -0
- package/five/webxr/inputSourceTracker.d.ts +59 -0
- package/five/webxr/referenceSpace.d.ts +60 -0
- package/five/webxr/renderTargetBridge.d.ts +45 -0
- package/five/webxr/xrButton.d.ts +4 -0
- package/five/webxr/xrManager.d.ts +174 -0
- package/five/work/index.d.ts +1 -1
- package/five/work/looseWorkType.d.ts +2 -1
- package/five/work/work.d.ts +30 -7
- package/five/work/workJsonType.d.ts +2 -1
- package/gltf-loader/gltf-object.d.ts +17 -0
- package/gltf-loader/index.d.ts +45 -0
- package/gltf-loader/index.js +255 -0
- package/gltf-loader/index.mjs +302 -0
- package/line/circle_png.d.ts +1 -0
- package/line/index.d.ts +49 -0
- package/line/index.js +255 -0
- package/line/index.mjs +340 -0
- package/package.json +30 -5
- package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
- package/plugins/BackgroundPlugin/index.d.ts +5 -0
- package/plugins/BackgroundPlugin/typings.d.ts +44 -0
- package/plugins/CSS2DPlugin/Controller.d.ts +59 -0
- package/plugins/CSS2DPlugin/index.d.ts +5 -0
- package/plugins/CSS2DPlugin/typing.d.ts +31 -0
- package/plugins/CSS3DPlugin/Controller.d.ts +64 -0
- package/plugins/CSS3DPlugin/index.d.ts +5 -0
- package/plugins/CSS3DPlugin/typing.d.ts +33 -0
- package/plugins/FloorplanPlugin/Controller.d.ts +100 -0
- package/plugins/FloorplanPlugin/index.d.ts +6 -0
- package/plugins/FloorplanPlugin/render/assets.d.ts +9 -0
- package/plugins/FloorplanPlugin/render/index.d.ts +35 -0
- package/plugins/FloorplanPlugin/render/isPointInPolygon.d.ts +5 -0
- package/plugins/FloorplanPlugin/render/renderFloor.d.ts +22 -0
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.d.ts +10 -0
- package/plugins/FloorplanPlugin/typing.d.ts +156 -0
- package/plugins/FloorplanPlugin/typings/floorplanData.d.ts +112 -0
- package/plugins/FloorplanPlugin/typings/floorplanJson.d.ts +167 -0
- package/plugins/FloorplanPlugin/typings/floorplanServerData.d.ts +78 -0
- package/plugins/FloorplanPlugin/typings/index.d.ts +3 -0
- package/plugins/FloorplanPlugin/utils/changeMode.d.ts +5 -0
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/correctFiveState.d.ts +11 -0
- package/plugins/FloorplanPlugin/utils/equal.d.ts +9 -0
- package/plugins/FloorplanPlugin/utils/filter.d.ts +8 -0
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/formatData.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.d.ts +20 -0
- package/plugins/FloorplanPlugin/utils/formatPosition.d.ts +33 -0
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/getPxmm.d.ts +19 -0
- package/plugins/FloorplanPlugin/utils/isTruelyObject.d.ts +4 -0
- package/plugins/FloorplanPlugin/utils/nearlyEqual.d.ts +8 -0
- package/plugins/FloorplanPlugin/utils/polylabel.d.ts +8 -0
- package/plugins/FloorplanPlugin/utils/to.d.ts +5 -0
- package/plugins/Object3DHelperPlugin/Controller.d.ts +99 -0
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.d.ts +142 -0
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.d.ts +16 -0
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.d.ts +66 -0
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.d.ts +61 -0
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.d.ts +17 -0
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.d.ts +97 -0
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.d.ts +16 -0
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.d.ts +37 -0
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.d.ts +93 -0
- package/plugins/Object3DHelperPlugin/constant.d.ts +27 -0
- package/plugins/Object3DHelperPlugin/index.d.ts +6 -0
- package/plugins/Object3DHelperPlugin/typing.d.ts +143 -0
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.d.ts +22 -0
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.d.ts +23 -0
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.d.ts +19 -0
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.d.ts +5 -0
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.d.ts +3 -0
- package/plugins/Object3DHelperPlugin/utils/direction.d.ts +14 -0
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.d.ts +5 -0
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.d.ts +8 -0
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.d.ts +8 -0
- package/plugins/Object3DHelperPlugin/utils/solidGuide.d.ts +27 -0
- package/plugins/Object3DHelperPlugin/utils/tipsDom.d.ts +8 -0
- package/plugins/PanoAnimePlugin/Controller.d.ts +49 -0
- package/plugins/PanoAnimePlugin/index.d.ts +5 -0
- package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +748 -3
- package/plugins/index.mjs +28761 -88
- package/plugins/thirdParty/CSS2DRenderer.d.ts +37 -0
- package/plugins/thirdParty/CSS3DRenderer.d.ts +45 -0
- package/plugins/thirdParty/OrbitControls.d.ts +78 -0
- package/plugins/thirdParty/doctorstrange-model.d.ts +92 -0
- package/plugins/thirdParty/domevents.d.ts +36 -0
- package/plugins/utils/clamp.d.ts +2 -0
- package/plugins/utils/uuid.d.ts +2 -0
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/sticker/geometry.d.ts +3 -0
- package/sticker/index.d.ts +68 -0
- package/sticker/index.js +255 -0
- package/sticker/index.mjs +358 -0
- package/umd/five-gltf-loader.js +255 -0
- package/umd/five-line.js +322 -0
- package/umd/five-plugins.js +816 -3
- package/umd/five-react.js +2 -2
- package/umd/five-sticker.js +255 -0
- package/umd/five-vfx.js +323 -0
- package/umd/five.js +347 -344
- package/vfx/airflow/airflow.d.ts +18 -0
- package/vfx/common/simplex-noise.d.ts +2 -0
- package/vfx/frame/frame.d.ts +27 -0
- package/vfx/index.d.ts +7 -0
- package/vfx/index.js +255 -0
- package/vfx/index.mjs +738 -0
- package/vfx/particle/instance.d.ts +36 -0
- package/vfx/particle/particle.d.ts +119 -0
- package/vfx/particle/utils.d.ts +11 -0
- package/vfx/particle-gpu/particle.d.ts +75 -0
- package/vfx/particle-gpu/utils.d.ts +11 -0
- package/vfx/spotLight/spotLight.d.ts +15 -0
- package/work-downloader/components/model-3d-tile.d.ts +2 -0
- package/work-downloader/components/model.d.ts +3 -0
- package/work-downloader/components/observer.d.ts +9 -0
- package/work-downloader/download.d.ts +16 -0
- package/work-downloader/index.d.ts +2 -0
- package/work-downloader/index.js +255 -0
- package/work-downloader/index.mjs +595 -0
- package/work-downloader/type.d.ts +28 -0
- package/work-downloader/utils/download-to-file.d.ts +1 -0
- package/work-downloader/utils/image-processing.d.ts +7 -0
- package/work-downloader/utils/join-url.d.ts +2 -0
- package/work-downloader/utils/log.d.ts +1 -0
- package/work-downloader/utils/relative-url.d.ts +1 -0
- package/docs/interfaces/index.PBMHDRConfig.html +0 -12
- package/five/gaussian-splatting/worker/dataWorker.d.ts +0 -1
- package/five/three-version-check.d.ts +0 -1
- package/five/utils/hdr-data.d.ts +0 -13
- package/five/utils/shaderContentFix.d.ts +0 -7
package/ai_guides/api.md
CHANGED
|
@@ -24,7 +24,7 @@ const five = new Five(initArgs?: FiveInitArgs);
|
|
|
24
24
|
| `five.scene` | `THREE.Scene` | The Three.js scene used for non-model elements. |
|
|
25
25
|
| `five.modelScene` | `ModelScene` | The Three.js scene used for the model. |
|
|
26
26
|
| `five.camera` | `Camera` | The internal camera. |
|
|
27
|
-
| `five.renderer` | `THREE.
|
|
27
|
+
| `five.renderer` | `THREE.WebGPURenderer` | The WebGPU renderer. |
|
|
28
28
|
| `five.needsRender` | `boolean` | Set to `true` to request a render frame in the next loop. |
|
|
29
29
|
| `five.plugins` | `Object` | Access to registered plugins. |
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ const five = new Five(initArgs?: FiveInitArgs);
|
|
|
32
32
|
|
|
33
33
|
| Property | Type | Description |
|
|
34
34
|
| :--- | :--- | :--- |
|
|
35
|
-
| `Five.Mode` | `Enum` | Available modes: `Panorama`, `Model`, `Floorplan`, `Topview`, `Mapview`, `VRPanorama
|
|
35
|
+
| `Five.Mode` | `Enum` | Available modes: `Panorama`, `Model`, `Floorplan`, `Topview`, `Mapview`, `VRPanorama`. |
|
|
36
36
|
|
|
37
37
|
## Initialization Configuration (`FiveInitArgs`)
|
|
38
38
|
|
|
@@ -40,8 +40,8 @@ Configuration object passed to the `Five` constructor.
|
|
|
40
40
|
|
|
41
41
|
```typescript
|
|
42
42
|
interface FiveInitArgs {
|
|
43
|
-
/** External
|
|
44
|
-
renderer?: THREE.
|
|
43
|
+
/** External WebGPURenderer. If provided, internal renderer creation is skipped. */
|
|
44
|
+
renderer?: THREE.WebGPURenderer;
|
|
45
45
|
|
|
46
46
|
/** Width/Height of the viewport relative to container (0-1). */
|
|
47
47
|
viewport?: { left: number; bottom: number; width: number; height: number };
|
|
@@ -80,12 +80,13 @@ interface FiveInitArgs {
|
|
|
80
80
|
|
|
81
81
|
## Core Methods
|
|
82
82
|
|
|
83
|
-
### `load(
|
|
83
|
+
### `load(inputWork, state?, options?, userAction?)`
|
|
84
84
|
Loads a "Work" (dataset) into the Five instance.
|
|
85
85
|
|
|
86
|
-
- **
|
|
86
|
+
- **inputWork**: The data object (`LooseWork` or `Work`) containing scene information.
|
|
87
87
|
- **state**: Initial state overrides. `"inherit"`, `"initial"`, or a `State` object.
|
|
88
88
|
- **options**: Loading options (e.g., transition duration).
|
|
89
|
+
- **userAction**: Whether the load was triggered by a user action. Defaults to `true`.
|
|
89
90
|
|
|
90
91
|
### `appendTo(element, size?)`
|
|
91
92
|
Mounts the Five canvas to a DOM element.
|
|
@@ -243,8 +244,8 @@ These events follow a standard naming convention and provide typed event objects
|
|
|
243
244
|
| :--- | :--- | :--- |
|
|
244
245
|
| `works.load` | Triggered when work data starts loading. | `WorksEvent` |
|
|
245
246
|
| `models.load` | Triggered when models are loaded. | `ModelSceneEvent` |
|
|
246
|
-
| `
|
|
247
|
-
| `
|
|
247
|
+
| `models.tileLoad` | Triggered when a 3D tile is loaded. | `ModelTileEvent` |
|
|
248
|
+
| `models.tileUnload` | Triggered when a 3D tile is unloaded. | `ModelTileEvent` |
|
|
248
249
|
| `pano.arrived` | Triggered when arrival at a panorama node. | `PanoEvent` |
|
|
249
250
|
| `pano.texture.progress` | Triggered when panorama texture loading progresses. | `{ progress, panoIndex }` |
|
|
250
251
|
| `render` | Triggered after each render frame. | `RenderEvent` |
|
|
@@ -104,7 +104,7 @@ five.changeMode(mode: Mode, options?, animationOptions?): Promise<void>
|
|
|
104
104
|
|
|
105
105
|
| Parameter | Type | Default | Description |
|
|
106
106
|
| :--- | :--- | :--- | :--- |
|
|
107
|
-
| `modeChangeDuration` | `number` | `
|
|
107
|
+
| `modeChangeDuration` | `number` | `800` | 模态切换 (如 Panorama -> Mapview) 的默认时长 (ms)。 |
|
|
108
108
|
|
|
109
109
|
### MovePanoOptions Configuration (移动参数)
|
|
110
110
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
```typescript
|
|
18
18
|
interface FiveInitArgs {
|
|
19
19
|
/** 外部传入的渲染器 (如果传入,部分渲染配置将失效) */
|
|
20
|
-
renderer?: THREE.
|
|
20
|
+
renderer?: THREE.WebGPURenderer;
|
|
21
21
|
/**
|
|
22
22
|
* 屏幕渲染区域 { left, bottom, width, height }
|
|
23
23
|
* 必须配合外部 renderer 使用
|
|
@@ -35,7 +35,7 @@ interface FiveInitArgs {
|
|
|
35
35
|
textureOptions?: TextureOptions;
|
|
36
36
|
/** 是否按需渲染 (默认 true, 推荐开启以节省性能) */
|
|
37
37
|
onlyRenderIfNeeds?: boolean;
|
|
38
|
-
/** 模式切换动画时长 (ms, 默认
|
|
38
|
+
/** 模式切换动画时长 (ms, 默认 800) */
|
|
39
39
|
modeChangeDuration?: number;
|
|
40
40
|
/** 是否支持滚轮缩放 (默认 true) */
|
|
41
41
|
enableWheel?: boolean;
|
|
@@ -43,6 +43,17 @@ interface FiveInitArgs {
|
|
|
43
43
|
plugins?: FivePlugin[];
|
|
44
44
|
/** 是否显示 Powered by Realsee */
|
|
45
45
|
poweredByRealsee?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 强制使用 WebGL2 回落后端(默认 false)
|
|
48
|
+
* 进入 XRPanorama(WebXR 头显全景)的前置条件。
|
|
49
|
+
* 只在构造期生效,后端无法在运行时切换,设备检测必须在 new Five() 之前完成。
|
|
50
|
+
* 详见下方《forceWebGL 与 XR 回落后端》。
|
|
51
|
+
*/
|
|
52
|
+
forceWebGL?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated 在 five-webgpu 中未接线、无效。需要 WebGL2 后端请使用 `forceWebGL`。
|
|
55
|
+
*/
|
|
56
|
+
webgl2?: boolean;
|
|
46
57
|
}
|
|
47
58
|
```
|
|
48
59
|
|
|
@@ -55,7 +66,7 @@ Five 实例是整个 3D 场景的入口。
|
|
|
55
66
|
|
|
56
67
|
### Rendering Loop (渲染循环)
|
|
57
68
|
Five 内部维护了一个 `requestAnimationFrame` 循环。
|
|
58
|
-
- **按需渲染**: 默认开启 `onlyRenderIfNeeds
|
|
69
|
+
- **按需渲染**: 默认开启 `onlyRenderIfNeeds`,仅在画面发生变化(如视角移动、数据加载)时才触发渲染,大幅降低能耗。
|
|
59
70
|
- **手动触发**: 可以通过 `five.needsRender = true` 强制下一帧进行渲染。
|
|
60
71
|
|
|
61
72
|
### Resource Loading (资源加载)
|
|
@@ -71,8 +82,66 @@ Five 内部维护了一个 `requestAnimationFrame` 循环。
|
|
|
71
82
|
| `textureOptions` | `TextureOptions` | `{}` | 贴图加载策略,同上 |
|
|
72
83
|
| `onlyRenderIfNeeds` | `boolean` | `true` | 是否仅在需要时渲染,建议保持 `true` |
|
|
73
84
|
| `antialias` | `boolean` | `false` | 抗锯齿,开启会增加性能消耗 |
|
|
74
|
-
| `modeChangeDuration` | `number` | `
|
|
85
|
+
| `modeChangeDuration` | `number` | `800` | 模式切换动画时长 (ms) |
|
|
75
86
|
| `enableWheel` | `boolean` | `true` | 是否支持滚轮缩放 |
|
|
87
|
+
| `forceWebGL` | `boolean` | `false` | 强制使用 WebGL2 回落后端,进入 `XRPanorama` 的前置条件,详见下文 |
|
|
88
|
+
| `webgl2` | `boolean` | — | **已废弃**,在 five-webgpu 中未接线。需要 WebGL2 请用 `forceWebGL` |
|
|
89
|
+
|
|
90
|
+
### forceWebGL 与 XR 回落后端
|
|
91
|
+
|
|
92
|
+
`forceWebGL` 让 five-webgpu 强制走 WebGL2 回落后端,而不是默认的 WebGPU 后端。它存在的唯一原因是 **进入 `XRPanorama`(WebXR 头显全景)模式**:`three` 的 WebGPU 后端目前不支持 WebXR,而 WebGL2 后端下 `renderer.xr` 完整可用。
|
|
93
|
+
|
|
94
|
+
**语义与使用约束**
|
|
95
|
+
|
|
96
|
+
- **语义**:`forceWebGL: true` 时,内部 `WebGPURenderer` 以 `{ forceWebGL: true }` 构造,使用 `WebGLBackend` 而非 WebGPU。
|
|
97
|
+
- **必须在 `new Five()` 时决定**:后端在 renderer 构造期定死,**运行时无法切换**。因此业务侧的「是否需要进入 XR」的设备检测必须发生在 `new Five()` 之前,不能等实例创建后再改。
|
|
98
|
+
- **与 `enableHDR` 互斥**:当 `forceWebGL` 为 `true` 时 `enableHDR` 不生效(`five.enableHDR` 会被置为 `false`),因为 XR 的 projection layer 固定 `colorFormat: RGBA8`,HDR 没有落地路径。
|
|
99
|
+
- **传入外部 `renderer` 时不生效**:如果通过 `renderer` 参数传入了外部渲染器,`forceWebGL` 不会对其生效,需由调用方自行在构造该 renderer 时设置 `forceWebGL`(与 `antialias` 等参数一致)。
|
|
100
|
+
- **`webgl2` 已废弃**:遗留的 `webgl2` 参数在 five-webgpu 中未接线、无任何效果;需要 WebGL2 后端请改用 `forceWebGL`。
|
|
101
|
+
|
|
102
|
+
**能力降级限制**(开启 `forceWebGL` 后不可规避)
|
|
103
|
+
|
|
104
|
+
1. **XR 下没有后处理**:`XRPanorama` 模式会整体旁路 `FiveRenderer` 的后处理链路(合成 / EffectComposer 全屏 pass 均不参与),滤镜、泛光等后处理在头显中不生效。
|
|
105
|
+
2. **点云走 NodeMaterial 路径**:`forceWebGL` 下点云不再走 WebGPU compute 光栅化,而是退回 NodeMaterial 渲染路径。
|
|
106
|
+
3. **3DGS 走 CPU 排序,且 VR 中性能预期需放低**:`forceWebGL` 下 3DGS 只能走 CPU 排序(`RASTER_CPU_SORT`);在 XR 中还要叠加双眼渲染开销,务必对点数 / 显示做降级,不要期待与 WebGPU 后端相同的帧率。
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { Five } from "@realsee/five-webgpu";
|
|
110
|
+
|
|
111
|
+
// 设备检测需在 new Five() 之前完成
|
|
112
|
+
const needXR = detectNeedXR();
|
|
113
|
+
|
|
114
|
+
const five = new Five({
|
|
115
|
+
forceWebGL: needXR, // 一旦创建就无法再切换后端
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
five.load(workData);
|
|
119
|
+
|
|
120
|
+
// 进入 XR(需在用户手势回调中调用,会触发 WebXR 权限请求)
|
|
121
|
+
button.addEventListener("click", () => {
|
|
122
|
+
five.changeMode("XRPanorama").catch((error) => {
|
|
123
|
+
// 后端非 WebGL2 或浏览器不支持 WebXR 时,这里会收到含 forceWebGL 字样的中文错误
|
|
124
|
+
console.error(error);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// 用户摘下头显 / 退出 XR 时切回普通全景
|
|
129
|
+
five.on("xr.session.end", () => five.changeMode("Panorama"));
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
也可以直接使用内置的 `XRButton`,样式与 API 同原始 five 保持一致(`XRButton.createButton(onClickHook)`):
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
import { Five, XRButton } from "@realsee/five-webgpu";
|
|
136
|
+
|
|
137
|
+
const button = XRButton.createButton(() => five.changeMode("XRPanorama"));
|
|
138
|
+
document.body.appendChild(button);
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- 浏览器没有 `navigator.xr` 时显示 `WEBXR NOT AVAILABLE`(非 HTTPS 时显示 `WEBXR NEEDS HTTPS`),不支持 `immersive-vr` 时显示 `VR NOT SUPPORTED`。
|
|
142
|
+
- 回调返回 Promise 时,`XRButton` 会接住 reject。若失败原因是没有开启 `forceWebGL`(后端是 WebGPU),按钮文案会临时变为「需降级到 WebGL2」,3 秒后恢复。其他失败原因不改变按钮,错误通过 `five.on("error")` 上报。
|
|
143
|
+
|
|
144
|
+
> 更多模式说明(含 `XRPanorama` 与 `VRPanorama` 的区别)见 [mode.md](./mode.md),可运行示例参见 `examples/xr`。
|
|
76
145
|
|
|
77
146
|
## Examples
|
|
78
147
|
|
|
@@ -103,7 +172,7 @@ five.load(workData);
|
|
|
103
172
|
import * as THREE from "three/webgpu";
|
|
104
173
|
import { Five } from "@realsee/five-webgpu";
|
|
105
174
|
|
|
106
|
-
const renderer = new THREE.
|
|
175
|
+
const renderer = new THREE.WebGPURenderer();
|
|
107
176
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
108
177
|
document.body.appendChild(renderer.domElement);
|
|
109
178
|
|
|
@@ -152,8 +221,8 @@ five.updateCameraWithKeyframes(keyframes, 2000).then(() => {
|
|
|
152
221
|
### 实例方法 (Instance Methods)
|
|
153
222
|
|
|
154
223
|
- **`appendTo(element: HTMLElement)`**: 将 canvas 挂载到指定 DOM 元素。
|
|
155
|
-
- **`load(
|
|
156
|
-
- **`dispose()`**:
|
|
224
|
+
- **`load(inputWork, state?: "inherit" | "initial" | Partial<State>, options?: number | FiveLoadOptions, userAction?: boolean)`**: 加载场景数据。详见 [work.md](./work.md)。
|
|
225
|
+
- **`dispose()`**: 销毁实例并释放相关渲染资源。
|
|
157
226
|
- **`updateCamera(pose: Partial<Pose>, duration: number, userAction?: boolean)`**: 移动相机(不触发点位移动)。移动相机的视角或位置,不会改变当前所在的 PanoIndex。如果动画中途被打断,Promise 会被 reject。
|
|
158
227
|
- **`updateCameraWithKeyframes(keyframes: { progress: number; value: Pose; key?: string }[], duration: number, userAction?: boolean)`**: 通过关键帧动画移动相机。
|
|
159
228
|
- **`refresh()`**: 强制刷新画布尺寸。通常在窗口 resize 时调用,Five 会自动监听 resize,但在某些布局变化场景下可能需要手动调用。
|
|
@@ -164,7 +233,7 @@ five.updateCameraWithKeyframes(keyframes, 2000).then(() => {
|
|
|
164
233
|
1. **状态同步**:相机姿态已通过动画过渡到目标状态(`stateSynced` 为 true)。
|
|
165
234
|
2. **模型加载**:如果是 Floorplan/Topview/Mapview/Model 模态,需等待模型加载完成 (`modelScene.loaded`)。
|
|
166
235
|
3. **瓦片加载**:如果是 Panorama 模态且传入了 `{ tile: true }`,需等待当前视角的瓦片加载完成。
|
|
167
|
-
- **`setState(state: Partial<State>,
|
|
236
|
+
- **`setState(state: Partial<State>, immediately?: boolean, userAction?: boolean)`**: 变更当前状态(如点位、视角)。详见 [state.md](./state.md)。
|
|
168
237
|
- **`on(event, callback)` / `off(event, callback)`**: 事件监听。详见 [event.md](./event.md)。
|
|
169
238
|
|
|
170
239
|
## Related
|
|
@@ -180,5 +249,5 @@ five.updateCameraWithKeyframes(keyframes, 2000).then(() => {
|
|
|
180
249
|
---
|
|
181
250
|
|
|
182
251
|
```yaml
|
|
183
|
-
tags: [five, initialization, core, instance, lifecycle]
|
|
252
|
+
tags: [five, initialization, core, instance, lifecycle, forceWebGL, webgl2, xr, webxr]
|
|
184
253
|
```
|
|
@@ -30,7 +30,7 @@ export type LoadResultType<Scene = THREE.Object3D> = {
|
|
|
30
30
|
|
|
31
31
|
// 通用配置项接口
|
|
32
32
|
interface BaseLoaderOptions {
|
|
33
|
-
upAxis?: 'Y' | 'Z'; // 期望输出的上轴,默认为 'Z'
|
|
33
|
+
upAxis?: 'Y' | 'Z'; // 期望输出的上轴,默认为 'Z'(加载器输出坐标系)
|
|
34
34
|
modelUpAxis?: 'Y' | 'Z'; // (部分加载器支持) 原始模型的上轴,用于自动旋转修正
|
|
35
35
|
fetcher?: Fetcher; // 自定义网络请求 Fetcher
|
|
36
36
|
light?: boolean; // 是否使用简化/无光照材质 (取决于加载器实现)
|
|
@@ -44,15 +44,15 @@ interface BaseLoaderOptions {
|
|
|
44
44
|
这些加载函数(如 `loadGltf`, `loadPly`)是 `@realsee/five-webgpu` 包导出的**独立函数**,而非 `Five` 实例的方法。你需要单独引入它们使用。
|
|
45
45
|
|
|
46
46
|
### 坐标系转换 (Up-Axis Conversion)
|
|
47
|
-
Five
|
|
47
|
+
Five 运行时场景使用 **Y-up** (Y 轴向上) 的右手坐标系;加载器默认输出通常为 **Z-up**。
|
|
48
48
|
许多外部模型(如 standard GLTF, FBX)通常是 **Y-up** 的。
|
|
49
49
|
加载器提供了 `upAxis` 和 `modelUpAxis` 选项来自动处理旋转:
|
|
50
|
-
- `upAxis`:
|
|
50
|
+
- `upAxis`: 你期望得到的加载器输出坐标系上轴(通常保持默认 'Z')。
|
|
51
51
|
- `modelUpAxis`: 原始文件的上轴(如 GLTF 默认为 'Y',PLY 默认为 'Z')。
|
|
52
|
-
|
|
52
|
+
如果不指定,加载器会使用各自的默认值;将结果直接添加到 `five.scene` 时,应按需设置 `upAxis: 'Y'` 与 Five 的运行时坐标系对齐。
|
|
53
53
|
|
|
54
54
|
### 资源销毁 (Disposal)
|
|
55
|
-
加载的模型包含 Geometry、Material 和 Texture 等
|
|
55
|
+
加载的模型包含 Geometry、Material 和 Texture 等 GPU 资源。当你不再需要该模型时(例如切换场景或移除物体),**必须**调用返回结果中的 `dispose()` 方法来释放资源,否则会导致内存泄漏。
|
|
56
56
|
|
|
57
57
|
### Fetcher
|
|
58
58
|
所有加载器支持传入自定义 `fetcher`。这在需要鉴权、自定义 Header 或处理特定 CDN 逻辑时非常有用。如果不传,默认使用内部的 `internalFetcher`。
|
|
@@ -241,7 +241,7 @@ import { loadSplat } from '@realsee/five-webgpu';
|
|
|
241
241
|
|
|
242
242
|
loadSplat('https://example.com/scene.splat', {
|
|
243
243
|
modelUpAxis: 'Y', // 假设原始数据是 Y-up
|
|
244
|
-
upAxis: '
|
|
244
|
+
upAxis: 'Y', // 转换到 Five 的 Y-up 运行时坐标系
|
|
245
245
|
}).then((result) => {
|
|
246
246
|
const splatMesh = result.scene;
|
|
247
247
|
five.scene.add(splatMesh);
|
|
@@ -85,11 +85,11 @@ const progress = tile.content.loadProgress; // [0, 1]
|
|
|
85
85
|
监控单个 Tile 的加载与卸载事件,用于更精细的调试或资源统计。
|
|
86
86
|
|
|
87
87
|
```ts
|
|
88
|
-
five.on("
|
|
88
|
+
five.on("models.tileLoad", ({ tile }) => {
|
|
89
89
|
console.log(`Tile loaded: ${tile.debugLabel}, Size: ${tile.content.byteLength}`);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
five.on("
|
|
92
|
+
five.on("models.tileUnload", ({ tile }) => {
|
|
93
93
|
console.log(`Tile unloaded: ${tile.debugLabel}`);
|
|
94
94
|
});
|
|
95
95
|
```
|
|
@@ -51,12 +51,19 @@ Five 支持高性能的点云渲染(PBM),并提供灵活的样式配置:
|
|
|
51
51
|
|
|
52
52
|
### 4. Vertex Marks & Semantic Filtering (顶点标记与语义过滤)
|
|
53
53
|
|
|
54
|
-
`vertexMarks`
|
|
55
|
-
|
|
56
|
-
* **机制**: 模型顶点预置了 `_feature_id_rsmask`
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
54
|
+
`vertexMarks` 用于控制模型顶点上的语义标记(`_feature_id_rsmask`)逻辑。它是一个**按位掩码(bit flag)**,可以独立开关多类标注,而不再是单一的全局 `boolean` 开关。
|
|
55
|
+
|
|
56
|
+
* **机制**: 模型顶点预置了 `_feature_id_rsmask` 属性,不同的值代表不同的语义部分;每一类标注对应掩码中的一位,可按位独立启用。
|
|
57
|
+
* **标志位 (`PBMVertexMarkFlag`)**:
|
|
58
|
+
* `PBMVertexMarkFlag.roof` (`0b00000010`): 开盖标注(`_feature_id_rsmask=1`)。开启后,命中屋顶标记的顶点会按 `roofStyle` 裁切:`AUTO` 随相机俯仰角渐进隐藏,`HIDE` 始终隐藏。
|
|
59
|
+
* `PBMVertexMarkFlag.hidden` (`0b00000100`): 隐藏标注(`_feature_id_rsmask=2`)。开启后,命中隐藏标记且超过高度阈值的顶点会被裁掉。
|
|
60
|
+
* `PBMVertexMarkFlag.none` (`0b00000000`): 不启用任何标注。
|
|
61
|
+
* `PBMVertexMarkFlag.all` (`0b11111111`): 启用全部标注(默认全开,且包含未来新增的标注档位)。
|
|
62
|
+
* **按位组合**: 使用按位或组合多个标志,例如同时开启开盖与隐藏:
|
|
63
|
+
`PBMVertexMarkFlag.roof | PBMVertexMarkFlag.hidden`。
|
|
64
|
+
* **向后兼容**: `vertexMarks` 仍接受 `boolean`。传入 `true` 等价于 `PBMVertexMarkFlag.all`(全开),`false` 等价于 `PBMVertexMarkFlag.none`(全关)。
|
|
65
|
+
* **与自定义节点的关系**: 节点上下文中的 `isRoof` / `isHidden` 等标记判定**始终可用**,不受本开关影响;`vertexMarks` 只门控管线内置的自动裁切。
|
|
66
|
+
* **未来扩展**: 新增标注档位时,只需在 `PBMVertexMarkFlag` 中追加一个新的位,不影响现有标志。
|
|
60
67
|
|
|
61
68
|
## Configuration
|
|
62
69
|
|
|
@@ -74,7 +81,7 @@ Five 支持高性能的点云渲染(PBM),并提供灵活的样式配置:
|
|
|
74
81
|
| `pointMinPixel` | `number` | `0` | 点云最小像素尺寸。 |
|
|
75
82
|
| `pointMaxPixel` | `number` | `40` | 点云最大像素尺寸。 |
|
|
76
83
|
| `pointAppearAnimation` | `boolean` | `true` | 是否开启点云出现动画。 |
|
|
77
|
-
| `vertexMarks` | `boolean` | `true` |
|
|
84
|
+
| `vertexMarks` | `boolean \| number` | `true` | 顶点标注开关,按位控制(见 Concepts)。`PBMVertexMarkFlag` 位掩码;传入 `boolean` 时 `true`=全开、`false`=全关。 |
|
|
78
85
|
| `brightness` | `number` | `1.0` | 场景亮度倍数。 |
|
|
79
86
|
| `floorStyle` | `PBMFloorStyle` | `'OPACITY'` | 楼层显示样式。 |
|
|
80
87
|
| `shownFloorIndex` | `number` | `-1` | 当前显示的楼层索引。`-1` 表示显示所有楼层。 |
|
|
@@ -140,6 +147,26 @@ five.model.set({
|
|
|
140
147
|
});
|
|
141
148
|
```
|
|
142
149
|
|
|
150
|
+
### 3. Toggling Vertex Marks (控制顶点标注)
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import { PBMVertexMarkFlag } from '@realsee/five-webgpu';
|
|
154
|
+
|
|
155
|
+
// 仅开启“开盖”标注
|
|
156
|
+
five.model.set({ vertexMarks: PBMVertexMarkFlag.roof });
|
|
157
|
+
|
|
158
|
+
// 同时开启“开盖”与“隐藏”标注
|
|
159
|
+
five.model.set({
|
|
160
|
+
vertexMarks: PBMVertexMarkFlag.roof | PBMVertexMarkFlag.hidden,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// 关闭全部标注
|
|
164
|
+
five.model.set({ vertexMarks: PBMVertexMarkFlag.none });
|
|
165
|
+
|
|
166
|
+
// 向后兼容:true 等价于全开,false 等价于全关
|
|
167
|
+
five.model.set({ vertexMarks: true });
|
|
168
|
+
```
|
|
169
|
+
|
|
143
170
|
## Related
|
|
144
171
|
|
|
145
172
|
* [Parameter](./parameter.md): 配置系统入口与继承逻辑。
|
|
@@ -149,5 +176,5 @@ five.model.set({
|
|
|
149
176
|
---
|
|
150
177
|
|
|
151
178
|
```yaml
|
|
152
|
-
tags: [material, appearance, pointcloud, parameter, roof, ceiling, config]
|
|
179
|
+
tags: [material, appearance, pointcloud, parameter, roof, hidden, ceiling, 开盖, 隐藏, 顶点标记, 位掩码, bitmask, vertex-mark, config]
|
|
153
180
|
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Mode (模式)
|
|
2
2
|
|
|
3
|
-
- **Summary**: Five
|
|
4
|
-
- **Schema**: 字符串枚举类型,定义了
|
|
5
|
-
- **Concepts**: Panorama, Mapview, Floorplan, Topview, Model
|
|
3
|
+
- **Summary**: Five 支持全景漫游、模型浏览等五种交互模式,适用于不同的看房场景。
|
|
4
|
+
- **Schema**: 字符串枚举类型,定义了 5 种交互模式。
|
|
5
|
+
- **Concepts**: Panorama, Mapview, Floorplan, Topview, Model。
|
|
6
6
|
- **Examples**: 模式切换与事件监听。
|
|
7
7
|
|
|
8
8
|
## Schema
|
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
15
|
type Mode =
|
|
16
|
-
| "Panorama"
|
|
17
|
-
| "Mapview"
|
|
18
|
-
| "Floorplan"
|
|
19
|
-
| "Topview"
|
|
20
|
-
| "Model"
|
|
21
|
-
| "VRPanorama"
|
|
22
|
-
| "XRPanorama" // WebXR 虚拟现实 VR 眼镜模式
|
|
16
|
+
| "Panorama" // 全景图游走模式
|
|
17
|
+
| "Mapview" // 模型地图模式
|
|
18
|
+
| "Floorplan" // 模型户型图模式
|
|
19
|
+
| "Topview" // 模型平面图模式
|
|
20
|
+
| "Model" // 模型游走模式
|
|
21
|
+
| "VRPanorama" // 手机 Cardboard 分屏全景模式(陀螺仪驱动)
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
## Concepts
|
|
@@ -34,8 +33,12 @@ type Mode =
|
|
|
34
33
|
* 交互:鼠标拖拽 / Pan手势平移相机;滚轮 / Pinch手势缩放画面;点击 / Tap切换到最近全景点。
|
|
35
34
|
* **Model (模型漫游)**: 适用于第一人称在场景中自由游览。交互同 Panorama,但不限制相机只能在观察点位置。
|
|
36
35
|
* 交互:鼠标拖拽 / Pan手势旋转视角;滚轮 / Pinch手势缩放视场角;点击 / Tap移动到指定位置。
|
|
37
|
-
* **
|
|
38
|
-
*
|
|
36
|
+
* **XRPanorama (WebXR 头显全景)**: 适用于通过 WebXR 在 VR 头显(Pico / Quest / Apple Vision Pro 等)中沉浸式浏览全景。头显朝向决定看景方向,用手柄 / 注视射线指向并走动到全景点位。
|
|
37
|
+
* 交互:头显朝向看景;手柄指向射线(或 Vision Pro 的注视射线)拾取;手柄按键 tap / press 走点与触发事件。
|
|
38
|
+
* 前置条件:**必须在 `new Five({ forceWebGL: true })` 时开启 WebGL2 回落后端**(`three` 的 WebGPU 后端目前不支持 WebXR);浏览器需支持 WebXR(存在 `navigator.xr`)。
|
|
39
|
+
* 进入:`five.changeMode('XRPanorama')` 或 `five.setState({ mode: 'XRPanorama' })`,会触发一次 XR 会话权限请求(需在用户手势中调用)。
|
|
40
|
+
* 退出:监听 `xr.session.end` 事件后切回其他模式(如 `Panorama`)。
|
|
41
|
+
* **VRPanorama (Cardboard 分屏全景)**: 适用于手机配合 Cardboard 眼镜的分屏体验。使用陀螺仪驱动视角,左右眼分屏渲染。**不需要头显设备,也不需要 `forceWebGL`**。
|
|
39
42
|
|
|
40
43
|
## Configuration
|
|
41
44
|
|
|
@@ -135,22 +138,6 @@ interface ModelConfig {
|
|
|
135
138
|
}
|
|
136
139
|
```
|
|
137
140
|
|
|
138
|
-
### VRPanorama / XRPanorama (VR 模式)
|
|
139
|
-
|
|
140
|
-
继承自 Panorama 配置,但移除了俯仰角限制(`maxLatitude`, `minLatitude`),因为 VR 模式下视角由设备姿态控制。
|
|
141
|
-
|
|
142
|
-
```typescript
|
|
143
|
-
interface VRPanoramaConfig {
|
|
144
|
-
// ... 同 Panorama 基础配置
|
|
145
|
-
// 移除: maxLatitude, minLatitude
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
interface XRPanoramaConfig {
|
|
149
|
-
// ... 同 Panorama 基础配置
|
|
150
|
-
// 移除: maxLatitude, minLatitude
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
141
|
## Examples
|
|
155
142
|
|
|
156
143
|
### 快速上手 (Quick Example)
|
|
@@ -255,15 +242,25 @@ document.querySelector('#btn-map').addEventListener('click', () => {
|
|
|
255
242
|
1. **相机类型差异**:`Topview` 模式使用的是正交相机 (OrthographicCamera),而其他模式使用的是透视相机 (PerspectiveCamera)。在进行自定义渲染或计算时需注意投影矩阵的差异。
|
|
256
243
|
2. **切换动画**:`setState` 触发的切换动画是自动规划的,而 `changeMode` 允许更细粒度的控制。如果需要精确控制动画时长或回调,请使用 `changeMode`。
|
|
257
244
|
3. **全景加载**:`Panorama` 模式下会自动使用瓦片(tile)方式加载全景图以平衡效率和清晰度,而其他模式(如 `Mapview`)主要展示模型几何。
|
|
245
|
+
4. **`XRPanorama` 与 `VRPanorama` 不要混淆**:
|
|
246
|
+
* `VRPanorama` 是手机 Cardboard 分屏 + 陀螺仪方案,**不需要头显、不需要 `forceWebGL`**,面向的是把手机塞进纸盒眼镜的场景。
|
|
247
|
+
* `XRPanorama` 走的是真正的 WebXR 头显设备(Pico / Quest / Apple Vision Pro 等),**必须 `new Five({ forceWebGL: true })`**,面向的是独立 VR 头显。
|
|
248
|
+
* 两者的驱动源(陀螺仪 vs WebXR viewer pose)、渲染路径(分屏 quad vs XR projection layer)、输入方式(无手柄 vs 手柄 / 注视射线)都不同,切换前请先确认目标设备。
|
|
249
|
+
5. **`XRPanorama` 的能力降级限制**(均源自 `forceWebGL` 的 WebGL2 回落后端,无法规避):
|
|
250
|
+
* **XR 下没有后处理**:XR 模式会整体旁路 `FiveRenderer` 的后处理链路(合成 / EffectComposer 全屏 pass 都不参与),滤镜、泛光等后处理效果在头显中不生效。
|
|
251
|
+
* **点云走 NodeMaterial 路径**:`forceWebGL` 下点云不再走 WebGPU compute 光栅化,而是退回 NodeMaterial 渲染路径。
|
|
252
|
+
* **3DGS 走 CPU 排序,且 VR 中性能预期需放低**:`forceWebGL` 下 3DGS 只能走 CPU 排序(`RASTER_CPU_SORT`);在 XR 中还叠加了双眼渲染的开销,务必对点数 / 显示做降级,不要期待与 WebGPU 后端相同的帧率。
|
|
258
253
|
|
|
259
254
|
## Related
|
|
260
255
|
|
|
261
256
|
* [State - 状态](./state.md): 了解 Mode 在 State 中的位置及其他状态属性。
|
|
262
257
|
* [Gesture - 手势](./gesture.md): 了解不同模式下的手势交互逻辑。
|
|
263
258
|
* [Event - 事件](./event.md): 了解模式切换等相关事件。
|
|
259
|
+
* [Five - 核心类](./five.md): 了解 `forceWebGL` 初始化参数(进入 `XRPanorama` 的前置条件)。
|
|
260
|
+
* XR 示例:参见 `examples/xr`(`forceWebGL: true` + 按钮进入 `XRPanorama`)。
|
|
264
261
|
|
|
265
262
|
---
|
|
266
263
|
|
|
267
264
|
```yaml
|
|
268
|
-
tags: [mode, state, interaction]
|
|
265
|
+
tags: [mode, state, interaction, xr, webxr, vr, forceWebGL, XRPanorama, VRPanorama]
|
|
269
266
|
```
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# UltraHDR /
|
|
1
|
+
# UltraHDR / gainmap 渲染
|
|
2
2
|
|
|
3
|
-
本篇说明 five-webgpu 如何用 UltraHDR(
|
|
3
|
+
本篇说明 five-webgpu 如何用 UltraHDR(gainmap)方案还原全景图的高动态范围,重点是**最终 RGB 是如何算出来的**。
|
|
4
4
|
|
|
5
5
|
## 基本原理
|
|
6
6
|
|
|
7
7
|
UltraHDR 不直接存 HDR 像素,而是拆成两部分:
|
|
8
8
|
|
|
9
9
|
- **SDR 底图(base / color)**:普通的 8bit 全景图,直接可显示。
|
|
10
|
-
- **
|
|
10
|
+
- **gainmap(增益图)**:每个像素存一个 `[0,1]` 的增益值,表示该像素相对 SDR 需要放大多少亮度。
|
|
11
11
|
|
|
12
12
|
渲染时的公式是:
|
|
13
13
|
|
|
@@ -15,11 +15,11 @@ UltraHDR 不直接存 HDR 像素,而是拆成两部分:
|
|
|
15
15
|
finalRGB = sdrRGB * boost(gain)
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
`boost` 是由
|
|
18
|
+
`boost` 是由 gainmap 值加上一组元数据(HDR config)算出的每通道增益系数。当没有 HDR(增益全为 1 / 未启用)时 `boost = 1`,退化为普通 SDR。
|
|
19
19
|
|
|
20
20
|
## 相关数据结构
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
gainmap 元数据来自每个点位的 `observer.images.gainmap?.cfg`(`GainmapCfgData`):该点位无 HDR 数据时 `images.gainmap` 字段不存在。
|
|
23
23
|
|
|
24
24
|
| 字段 | 含义 |
|
|
25
25
|
| --- | --- |
|
|
@@ -27,9 +27,9 @@ GainMap 元数据来自每个点位的 `hdrConfig`(`HDRCfgData`):
|
|
|
27
27
|
| `minContentBoost` | 内容侧最小亮度增益(gain=0 时对应,通常为 1) |
|
|
28
28
|
| `hdrCapacityMin` | 显示器 HDR 容量下限(通常为 1) |
|
|
29
29
|
| `hdrCapacityMax` | 显示器 HDR 容量上限 |
|
|
30
|
-
| `gamma` |
|
|
31
|
-
| `offsetSdr` | SDR
|
|
32
|
-
| `offsetHdr` | HDR
|
|
30
|
+
| `gamma` | gainmap 的编码 gamma(解码用 `1/gamma`) |
|
|
31
|
+
| `offsetSdr` | SDR 偏移,缺省 `1/64`(UltraHDR 规范默认值) |
|
|
32
|
+
| `offsetHdr` | HDR 偏移,缺省 `1/64`(UltraHDR 规范默认值) |
|
|
33
33
|
|
|
34
34
|
另外还有一个运行时可调参数:
|
|
35
35
|
|
|
@@ -37,7 +37,7 @@ GainMap 元数据来自每个点位的 `hdrConfig`(`HDRCfgData`):
|
|
|
37
37
|
|
|
38
38
|
## 最终 RGB 的计算步骤
|
|
39
39
|
|
|
40
|
-
对应实现见 `
|
|
40
|
+
对应实现见 `lib/five/model/materials/tsl/utils.ts#hdrBoost` / `#hdrOffset`(以及瓦片路径下等价的 `lib/five/core/tiling.ts#computeHDRBoostNode`)。
|
|
41
41
|
|
|
42
42
|
### 1. 计算显示权重 weight
|
|
43
43
|
|
|
@@ -55,11 +55,11 @@ weight = clamp(
|
|
|
55
55
|
- `weight = 1`:显示器能力达到内容上限 → 全量增益。
|
|
56
56
|
- 中间值:按比例插值。
|
|
57
57
|
|
|
58
|
-
>
|
|
58
|
+
> 两条路径都对分母做了保护:`max(denom, 1e-6)` 并乘以 `step(1e-6, denom)`,避免非 HDR(capacity 全为 1)时除零产生 NaN(此时权重取 0,退化为 SDR)。
|
|
59
59
|
|
|
60
|
-
### 2.
|
|
60
|
+
### 2. gainmap 解码(gamma)
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
gainmap 采样值经 gamma 还原为线性增益量(每通道独立),解码使用 gamma 的倒数:
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
gainLinear = pow(gainRGB, 1/gamma) // 对 r/g/b 分别做 pow,与 Adobe 规范一致
|
|
@@ -84,7 +84,7 @@ boost = exp2(logGain * weight) // 每通道
|
|
|
84
84
|
|
|
85
85
|
### 5. 得到最终颜色
|
|
86
86
|
|
|
87
|
-
应用
|
|
87
|
+
应用 gainmap 偏移得到最终 HDR 颜色(`offset` 为 0 时退化为 `sdr * boost`):
|
|
88
88
|
|
|
89
89
|
```
|
|
90
90
|
finalRGB = (sdrRGB + offsetSdr) * boost - offsetHdr
|
|
@@ -121,22 +121,22 @@ finalRGB = (sdrRGB + offsetSdr) * boost - offsetHdr
|
|
|
121
121
|
|
|
122
122
|
解码端 `applyGain`(带 displayBoost 的重载)核心逻辑:
|
|
123
123
|
|
|
124
|
-
```
|
|
124
|
+
```
|
|
125
125
|
logBoost = log2(minContentBoost) * (1 - gain) + log2(maxContentBoost) * gain;
|
|
126
126
|
gainFactor = exp2(logBoost * displayBoost / maxContentBoost);
|
|
127
127
|
finalRGB = sdr * gainFactor;
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
说明:
|
|
131
|
-
- `gain` 是
|
|
131
|
+
- `gain` 是 gainmap 采样值(`[0,1]`)。该库固定 `gamma = 1.0`、`offsetSdr = offsetHdr = 0`、`hdrCapacityMin = 1`、`hdrCapacityMax = maxContentBoost`,所以权重简化成 `displayBoost / maxContentBoost`。
|
|
132
132
|
- 元数据里的 `minContentBoost` / `maxContentBoost` 是**线性倍数**(非 log),在着色器里才取 `log2`。
|
|
133
133
|
- 来源:[ittiam-systems/libultrahdr](https://github.com/ittiam-systems/libultrahdr) / [AOSP libultrahdr](https://android.googlesource.com/platform/external/libultrahdr)。内容为改写。
|
|
134
134
|
|
|
135
|
-
### 2) MONOGRID `gainmap-js` v3.4.0(Adobe
|
|
135
|
+
### 2) MONOGRID `gainmap-js` v3.4.0(Adobe gainmap 规范的 three.js 移植)
|
|
136
136
|
|
|
137
137
|
解码 fragment shader 原式(等价重排):
|
|
138
138
|
|
|
139
|
-
```
|
|
139
|
+
```
|
|
140
140
|
logRecovery = pow(recovery, gamma); // gamma uniform = 1.0 / metadataGamma
|
|
141
141
|
logBoost = gainMapMin * (1 - logRecovery) + gainMapMax * logRecovery;
|
|
142
142
|
hdrColor = (sdr + offsetSdr) * exp2(logBoost * weightFactor) - offsetHdr;
|
|
@@ -161,17 +161,24 @@ weightFactor = clamp(
|
|
|
161
161
|
1. **元数据空间约定(最关键,仍需确认)**
|
|
162
162
|
- 本项目对 `minContentBoost / maxContentBoost / hdrCapacityMin / hdrCapacityMax` 在 shader 内部统一取 `log2`,说明这些字段在数据里是**线性倍数**(如 `maxContentBoost = 100`、`hdrCapacityMax = 1000`)。这与 **libultrahdr 约定一致**。
|
|
163
163
|
- 但 **Adobe / gainmap-js 约定相反**:这些字段在元数据里就已经是 **log2 空间**。
|
|
164
|
-
- 风险:如果
|
|
164
|
+
- 风险:如果 gainmap 资源是按 Adobe/UltraHDR 标准(XMP `hdrgm`)导出的,那里的 `HDRCapacityMin/Max`、`GainMapMin/Max` 已经是 log2 值,本项目再套一次 `log2` 就会**二次取对数**导致结果错误。务必确认打包侧写入的到底是线性倍数还是 log2 值。
|
|
165
165
|
|
|
166
|
-
2. **gamma 方向(✅
|
|
167
|
-
-
|
|
168
|
-
- `gamma = 1
|
|
169
|
-
-
|
|
166
|
+
2. **gamma 方向(✅ 已修复,pano 与瓦片两条路径一致)**
|
|
167
|
+
- 解码使用 `pow(gainRGB, 1/gamma)`(规范:`log_recovery = pow(recovery, 1.0 / map_gamma)`),与 Adobe / gainmap-js 规范一致;`gamma` 做了 `> 0` 保护,`gain` 先 clamp 到 `[0,1]`。
|
|
168
|
+
- `gamma = 1`(当前数据默认)时与旧行为相同,无回归;`gamma ≠ 1` 时结果才会正确。
|
|
169
|
+
- 注意:`PanoSourceNode` 已删除,公式现在在 `tsl/utils.ts#hdrBoost` 与 `tiling.ts#computeHDRBoostNode` 各有一份,改动需同步。
|
|
170
170
|
|
|
171
171
|
3. **offset 偏移(✅ 已支持)**
|
|
172
|
-
- 完整式:`hdr = (sdr + offsetSdr) * boost - offsetHdr`,由 `
|
|
173
|
-
- `offsetSdr` / `offsetHdr` 已加入 `
|
|
174
|
-
-
|
|
172
|
+
- 完整式:`hdr = (sdr + offsetSdr) * boost - offsetHdr`,由 `tsl/utils.ts#hdrOffset`(pano 路径)与 `tiling.ts#hdrOffsetNode`(瓦片路径)应用,不需要额外的 `applyHDROffset` 包装。
|
|
173
|
+
- `offsetSdr` / `offsetHdr` 已加入 `GainmapCfgData`(支持 `offset_sdr` / `offset_hdr` 下划线写法)、pano 材质 uniform(`pano0HdrOffsetSdr` 等)与瓦片 uniform,可从 `images.gainmap.cfg` 读取。
|
|
174
|
+
- **缺省值为 `1/64`**(见导出的 `DEFAULT_GAINMAP_CFG_DATA`,与 UltraHDR 规范默认一致):cfg 里没有该字段时按 `1/64` 解码。
|
|
175
|
+
- ⚠️ 编码/解码 offset 必须一致:若打包侧按 `offsetSdr = offsetHdr = 0` 生成 gain map,需在 cfg 里显式写 `0`(否则近黑会略有抬升);反之若按规范 `1/64` 编码,现在的默认值正好匹配。因此**建议打包侧始终在 cfg 中显式写入这两个字段**。
|
|
176
|
+
|
|
177
|
+
4. **gainmap 纹理的色彩空间(✅ 已改为 `NoColorSpace`)**
|
|
178
|
+
- 规范要求 gain map 直接使用 `encoded_recovery / 255`(其自带的色彩配置文件不生效)。
|
|
179
|
+
- 现在 pano 路径(`panorama` / `floorplan` / `mapview` 的 `loadCubeTexture`)与瓦片路径(`core/tiling.ts` 的 `loadTexture`)都显式传 `colorSpace: THREE.NoColorSpace`;SDR 底图仍为 `SRGBColorSpace`。
|
|
180
|
+
- three 的 GPU 纹理格式在**首次创建时**按 colorSpace 决定(WebGPU:sRGB → `rgba8unorm-srgb` 做硬件解码),之后只重传像素、不重建格式。因此瓦片纹理池改为按 `尺寸 + colorSpace` 分桶,避免色图与 gainmap 串用同一张池化纹理。
|
|
181
|
+
- 观感变化:gainmap 中间调不再被 sRGB 曲线压低(`maxDisplayBoost=4`、`maxContentBoost=100`、capacity `1..1000` 时,gain=0.5 的 boost 由约 1.22 → 1.59),亮部更亮;gain=0 与 gain=1 两端不变。若打包侧曾把 `recovery` 按 sRGB 预补偿写进 JPEG(非标准做法),需回退此项。
|
|
175
182
|
|
|
176
183
|
### weight 公式对比
|
|
177
184
|
|
|
@@ -191,14 +198,16 @@ weight = clamp( (log2(maxDisplayBoost) - hdrCapacityMin)
|
|
|
191
198
|
|
|
192
199
|
## 关键代码位置
|
|
193
200
|
|
|
194
|
-
- `lib/five/model/materials/
|
|
195
|
-
- `
|
|
196
|
-
- `
|
|
201
|
+
- `lib/five/model/materials/tsl/utils.ts`
|
|
202
|
+
- `hdrBoost(gainRGB, maxDisplayBoost, maxContentBoost, minContentBoost, capacityMin, capacityMax, gamma)`:增益系数计算(TSL 节点,含 gamma 解码与容量权重)。
|
|
203
|
+
- `hdrOffset(sdrRGB, boost, offsetSdr, offsetHdr)`:应用 offset 得到最终 HDR 颜色。
|
|
204
|
+
- `lib/five/model/materials/tsl/defines.ts`
|
|
205
|
+
- `pano0HdrColor` / `pano1HdrColor`:拼接 `hdrBoost` 与 `hdrOffset`,材质 uniform 由 `pbmMaterial.ts` 的 `pano0Hdr*` / `pano1Hdr*` 属性驱动。
|
|
197
206
|
- `lib/five/core/tiling.ts`
|
|
198
|
-
- `computeHDRBoostNode(gainRGB, uniforms)`:瓦片细化路径下的等价实现(带除零保护)。
|
|
199
|
-
- `TileMaterial.setupNode()`:`mix(sdr, sdr*boost, enabled)` 的烘焙逻辑。
|
|
200
|
-
- `lib/five/utils/
|
|
207
|
+
- `computeHDRBoostNode(gainRGB, uniforms)` / `hdrOffsetNode(...)`:瓦片细化路径下的等价实现(带除零保护)。
|
|
208
|
+
- `TileMaterial.setupNode()` / `BoundingMaterial`:`mix(sdr, (sdr + offsetSdr) * boost - offsetHdr, enabled)` 的烘焙逻辑。
|
|
209
|
+
- `lib/five/utils/gainmap-data.ts`:`GainmapCfgData` 定义与 `parseGainmapCfgData` 解析(兼容 camelCase 与下划线 key)。
|
|
201
210
|
|
|
202
211
|
## 使用示例
|
|
203
212
|
|
|
204
|
-
参见 `examples/hdr/index.ts` 与 `examples/_tools/hdr-viewer/panes/hdr.ts`:到达点位后从 `observer.images.
|
|
213
|
+
参见 `examples/hdr/index.ts` 与 `examples/_tools/hdr-viewer/panes/hdr.ts`:到达点位后从 `observer.images.gainmap?.cfg` 拉取元数据(无 HDR 时该字段不存在),`maxDisplayBoost` 可实时调节以观察增益变化。
|