@realsee/five-webgpu 1.0.0-alpha.1 → 1.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/_virtual/_rolldown/runtime.js +255 -0
- package/ai_guides/README.md +2 -2
- package/ai_guides/api.md +9 -8
- package/ai_guides/features/camera-animation.md +1 -1
- package/ai_guides/features/clipper.md +1 -1
- package/ai_guides/features/coordinate-system.md +1 -1
- package/ai_guides/features/event.md +1 -2
- package/ai_guides/features/five.md +81 -12
- package/ai_guides/features/gesture.md +3 -3
- package/ai_guides/features/get-screen-pixels.md +1 -1
- package/ai_guides/features/image-options.md +3 -3
- package/ai_guides/features/load-external-model.md +15 -15
- package/ai_guides/features/load-progress.md +2 -2
- package/ai_guides/features/material.md +35 -8
- package/ai_guides/features/mode.md +28 -31
- package/ai_guides/features/model.md +1 -1
- package/ai_guides/features/pano-filter.md +3 -3
- package/ai_guides/features/pano-tile.md +2 -2
- package/ai_guides/features/raycast.md +1 -1
- package/ai_guides/features/screen-project.md +1 -1
- package/ai_guides/features/state.md +3 -3
- package/ai_guides/features/ultra-hdr.md +41 -32
- package/ai_guides/features/work.md +2 -2
- package/ai_guides/quick-start.md +3 -3
- package/ai_guides/release_notes/6.6.md +2 -2
- package/ai_guides/release_notes/6.7.md +1 -1
- package/ai_guides/release_notes/6.8.md +3 -3
- 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 +77 -68
- package/docs/classes/index.FivePass.html +1 -1
- package/docs/classes/index.FiveRenderer.html +2 -2
- package/docs/classes/index.FlowingFireworks3DPass.html +7 -3
- package/docs/classes/index.FlowingLight2DPass.html +6 -3
- package/docs/classes/index.FlowingLight3DPass.html +6 -3
- package/docs/classes/index.GaussianBlurPass.html +1 -1
- package/docs/classes/index.InternalWebGPURenderer.html +17 -3
- 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 +57 -0
- package/docs/classes/index.PBMGaussianSplattingNodeMaterial.html +9 -6
- package/docs/classes/index.PBMGaussianSplattingObject.html +18 -4
- package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +41 -11
- package/docs/classes/index.PBMGroup.html +1 -1
- package/docs/classes/index.PBMMesh.html +1 -1
- package/docs/classes/index.PBMMeshBasicMaterial.html +19 -6
- package/docs/classes/index.PBMMeshBasicNodeMaterial.html +31 -8
- package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +19 -6
- package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +31 -8
- package/docs/classes/index.PBMMeshPhongMaterial.html +19 -6
- package/docs/classes/index.PBMMeshPhongNodeMaterial.html +31 -8
- package/docs/classes/index.PBMMeshPhysicalMaterial.html +19 -6
- package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +31 -8
- 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 +61 -53
- 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/README.html +2 -2
- package/docs/documents/api.html +11 -10
- package/docs/documents/features_camera-animation.html +1 -1
- package/docs/documents/features_clipper.html +1 -1
- package/docs/documents/features_coordinate-system.html +1 -1
- package/docs/documents/features_event.html +1 -2
- package/docs/documents/features_five.html +53 -11
- package/docs/documents/features_gesture.html +3 -3
- package/docs/documents/features_get-screen-pixels.html +1 -1
- package/docs/documents/features_image-options.html +3 -3
- package/docs/documents/features_load-external-model.html +13 -13
- package/docs/documents/features_load-progress.html +1 -1
- package/docs/documents/features_material.html +20 -9
- package/docs/documents/features_mode.html +30 -15
- package/docs/documents/features_model.html +1 -1
- package/docs/documents/features_pano-filter.html +3 -3
- package/docs/documents/features_pano-tile.html +2 -2
- package/docs/documents/features_raycast.html +1 -1
- package/docs/documents/features_screen-project.html +1 -1
- package/docs/documents/features_state.html +2 -2
- package/docs/documents/features_ultra-hdr.html +50 -44
- package/docs/documents/features_work.html +2 -2
- package/docs/documents/quick-start.html +2 -2
- package/docs/documents/release_notes_6.6.html +2 -2
- package/docs/documents/release_notes_6.7.html +1 -1
- package/docs/documents/release_notes_6.8.html +3 -3
- package/docs/documents/support.html +1 -3
- package/docs/functions/index.customNodesCacheKey.html +3 -0
- package/docs/functions/index.parseWork.html +1 -1
- package/docs/functions/index.workToJson.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- 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 +18 -5
- 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 +87 -0
- package/docs/interfaces/index.PBMCustomNodeOptions.html +10 -0
- package/docs/interfaces/index.PBMCustomNodePanoContext.html +20 -0
- package/docs/interfaces/index.PBMCustomNodeSlots.html +31 -0
- 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 +46 -38
- package/docs/interfaces/index.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/index.ParameterValue.html +60 -52
- package/docs/interfaces/index.Pose.html +1 -1
- package/docs/interfaces/index.RenderEvent.html +2 -2
- package/docs/interfaces/index.ResolvedParameterValue.html +60 -52
- package/docs/interfaces/index.SplatData.html +10 -5
- 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.FlowingFireworks3DPassLine.html +5 -2
- package/docs/types/index.FlowingLight2DPassLine.html +4 -2
- package/docs/types/index.FlowingLight3DPassLine.html +7 -2
- package/docs/types/index.FlowingLightLineInput.html +12 -0
- package/docs/types/index.Mode.html +6 -3
- package/docs/types/index.OutputTextureDataType.html +1 -1
- package/docs/types/index.PBMColorStyle.html +1 -1
- package/docs/types/index.PBMCustomNodeTargetType.html +2 -0
- package/docs/types/index.PBMPointBack.html +1 -1
- package/docs/types/index.PBMPointShape.html +1 -1
- package/docs/types/index.PBMPointSize.html +1 -1
- package/docs/types/index.PBMRoofStyle.html +6 -0
- 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 +15 -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 +23 -1
- package/five/core/panoVideo.d.ts +4 -1
- package/five/core/tiling.d.ts +40 -9
- 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/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/layerRegistry.d.ts +17 -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/gaussian-splatting/shStore.d.ts +22 -0
- package/five/gaussian-splatting/splatAssembler.d.ts +69 -0
- package/five/gaussian-splatting/transformStore.d.ts +37 -0
- package/five/gaussian-splatting/wasm/sort.d.ts +4 -3
- package/five/index.d.ts +8 -2
- package/five/index.js +403 -343
- package/five/index.mjs +9531 -4900
- package/five/meshes/panoCircleMeshCustom.d.ts +1 -0
- package/five/model/index.d.ts +3 -2
- package/five/model/loaders/spz.d.ts +50 -2
- package/five/model/materials/nodes/pbmMeshBasicNodeMaterial.d.ts +2 -0
- package/five/model/materials/nodes/pbmMeshPanoOnlyNodeMaterial.d.ts +2 -0
- package/five/model/materials/nodes/pbmMeshPhongNodeMaterial.d.ts +2 -0
- package/five/model/materials/nodes/pbmMeshPhysicalNodeMaterial.d.ts +2 -0
- package/five/model/materials/pbmGaussianSplattingNodeMaterial.d.ts +12 -5
- package/five/model/materials/pbmMaterial.d.ts +288 -6
- 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 +8 -2
- package/five/model/materials/tsl/outputBuilder.d.ts +8 -15
- 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 +30 -4
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +113 -48
- package/five/model/objects/pbmPointCloud.d.ts +0 -1
- package/five/model/objects/pbmPointCloudObject.d.ts +1 -1
- package/five/model/parameter.d.ts +20 -5
- 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/compute-renderers/binned/binned-core.d.ts +46 -0
- package/five/renderer/compute-renderers/binned/binned-pipelines.d.ts +10 -0
- package/five/renderer/compute-renderers/binned/shaders/args-builder.d.ts +2 -0
- package/five/renderer/compute-renderers/binned/shaders/classify.d.ts +2 -0
- package/five/renderer/compute-renderers/binned/shaders/coop.d.ts +2 -0
- package/five/renderer/compute-renderers/pointcloud-compute-renderer.d.ts +14 -38
- package/five/renderer/compute-renderers/shaders/lib/color.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/cull.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/encode.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/point-setup.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/point-size.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/raster.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/size-class.d.ts +2 -0
- package/five/renderer/compute-renderers/shaders/lib/tile-bindings.d.ts +2 -0
- package/five/renderer/compute-renderers/uniform-layout.d.ts +23 -0
- package/five/renderer/five-renderer.d.ts +2 -0
- package/five/renderer/index.d.ts +1 -1
- package/five/renderer/postprocessing/index.d.ts +1 -1
- package/five/renderer/postprocessing/passes/flowing-fireworks-3d-pass.d.ts +23 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +2 -0
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +23 -0
- package/five/renderer/postprocessing/passes/pass.js +255 -0
- package/five/renderer/postprocessing/passes/pass.mjs +255 -0
- package/five/renderer/tools/full-screen-quad.js +255 -0
- package/five/renderer/tools/full-screen-quad.mjs +255 -0
- package/five/texture/loader.d.ts +6 -0
- package/five/types/cube.d.ts +0 -1
- package/five/utils/calculateThreeMouse.js +255 -0
- package/five/utils/calculateThreeMouse.mjs +255 -0
- package/five/utils/detector.d.ts +11 -1
- package/five/utils/distance.js +255 -0
- package/five/utils/distance.mjs +255 -0
- 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/utils/isNil.js +255 -0
- package/five/utils/isNil.mjs +255 -0
- package/five/utils/ktx2.d.ts +3 -3
- package/five/utils/uuid.js +255 -0
- package/five/utils/uuid.mjs +255 -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/llms.txt +1 -1
- package/package.json +34 -5
- package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
- package/plugins/BackgroundPlugin/Controller.js +276 -0
- package/plugins/BackgroundPlugin/Controller.mjs +276 -0
- package/plugins/BackgroundPlugin/index.d.ts +5 -0
- package/plugins/BackgroundPlugin/index.js +255 -0
- package/plugins/BackgroundPlugin/index.mjs +255 -0
- package/plugins/BackgroundPlugin/typings.d.ts +44 -0
- package/plugins/BasePlugin/index.d.ts +1 -1
- package/plugins/BasePlugin/index.js +255 -0
- package/plugins/BasePlugin/index.mjs +255 -0
- package/plugins/CSS2DPlugin/Controller.d.ts +59 -0
- package/plugins/CSS2DPlugin/Controller.js +255 -0
- package/plugins/CSS2DPlugin/Controller.mjs +255 -0
- package/plugins/CSS2DPlugin/index.d.ts +5 -0
- package/plugins/CSS2DPlugin/index.js +255 -0
- package/plugins/CSS2DPlugin/index.mjs +255 -0
- package/plugins/CSS2DPlugin/style.css_raw.js +275 -0
- package/plugins/CSS2DPlugin/style.css_raw.mjs +275 -0
- package/plugins/CSS2DPlugin/typing.d.ts +31 -0
- package/plugins/CSS3DPlugin/Controller.d.ts +64 -0
- package/plugins/CSS3DPlugin/Controller.js +255 -0
- package/plugins/CSS3DPlugin/Controller.mjs +255 -0
- package/plugins/CSS3DPlugin/index.d.ts +5 -0
- package/plugins/CSS3DPlugin/index.js +255 -0
- package/plugins/CSS3DPlugin/index.mjs +255 -0
- package/plugins/CSS3DPlugin/style.css_raw.js +274 -0
- package/plugins/CSS3DPlugin/style.css_raw.mjs +274 -0
- package/plugins/CSS3DPlugin/typing.d.ts +33 -0
- package/plugins/FloorplanPlugin/Controller.d.ts +100 -0
- package/plugins/FloorplanPlugin/Controller.js +255 -0
- package/plugins/FloorplanPlugin/Controller.mjs +255 -0
- package/plugins/FloorplanPlugin/index.d.ts +6 -0
- package/plugins/FloorplanPlugin/index.js +255 -0
- package/plugins/FloorplanPlugin/index.mjs +255 -0
- package/plugins/FloorplanPlugin/render/assets.d.ts +9 -0
- package/plugins/FloorplanPlugin/render/assets.js +255 -0
- package/plugins/FloorplanPlugin/render/assets.mjs +255 -0
- package/plugins/FloorplanPlugin/render/index.d.ts +35 -0
- package/plugins/FloorplanPlugin/render/index.js +255 -0
- package/plugins/FloorplanPlugin/render/index.mjs +255 -0
- package/plugins/FloorplanPlugin/render/isPointInPolygon.d.ts +5 -0
- package/plugins/FloorplanPlugin/render/isPointInPolygon.js +255 -0
- package/plugins/FloorplanPlugin/render/isPointInPolygon.mjs +255 -0
- package/plugins/FloorplanPlugin/render/renderFloor.d.ts +22 -0
- package/plugins/FloorplanPlugin/render/renderFloor.js +255 -0
- package/plugins/FloorplanPlugin/render/renderFloor.mjs +255 -0
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.d.ts +10 -0
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.js +255 -0
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.mjs +255 -0
- package/plugins/FloorplanPlugin/render/style.css_raw.js +585 -0
- package/plugins/FloorplanPlugin/render/style.css_raw.mjs +585 -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/changeMode.js +255 -0
- package/plugins/FloorplanPlugin/utils/changeMode.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.js +255 -0
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/correctFiveState.d.ts +11 -0
- package/plugins/FloorplanPlugin/utils/correctFiveState.js +255 -0
- package/plugins/FloorplanPlugin/utils/correctFiveState.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/equal.d.ts +9 -0
- package/plugins/FloorplanPlugin/utils/equal.js +255 -0
- package/plugins/FloorplanPlugin/utils/equal.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/filter.d.ts +8 -0
- package/plugins/FloorplanPlugin/utils/filter.js +255 -0
- package/plugins/FloorplanPlugin/utils/filter.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.js +255 -0
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/formatData.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/formatData.js +255 -0
- package/plugins/FloorplanPlugin/utils/formatData.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.d.ts +20 -0
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.js +255 -0
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/formatPosition.d.ts +33 -0
- package/plugins/FloorplanPlugin/utils/formatPosition.js +255 -0
- package/plugins/FloorplanPlugin/utils/formatPosition.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.d.ts +6 -0
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.js +255 -0
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/getPxmm.d.ts +19 -0
- package/plugins/FloorplanPlugin/utils/getPxmm.js +255 -0
- package/plugins/FloorplanPlugin/utils/getPxmm.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/isTruelyObject.d.ts +4 -0
- package/plugins/FloorplanPlugin/utils/isTruelyObject.js +255 -0
- package/plugins/FloorplanPlugin/utils/isTruelyObject.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/nearlyEqual.d.ts +8 -0
- package/plugins/FloorplanPlugin/utils/nearlyEqual.js +255 -0
- package/plugins/FloorplanPlugin/utils/nearlyEqual.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/polylabel.d.ts +8 -0
- package/plugins/FloorplanPlugin/utils/polylabel.js +255 -0
- package/plugins/FloorplanPlugin/utils/polylabel.mjs +255 -0
- package/plugins/FloorplanPlugin/utils/to.d.ts +5 -0
- package/plugins/FloorplanPlugin/utils/to.js +255 -0
- package/plugins/FloorplanPlugin/utils/to.mjs +255 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.d.ts +1 -1
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.js +255 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.mjs +255 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.d.ts +1 -1
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.js +255 -0
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Controller.d.ts +99 -0
- package/plugins/Object3DHelperPlugin/Controller.js +255 -0
- package/plugins/Object3DHelperPlugin/Controller.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.d.ts +139 -0
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.js +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.d.ts +16 -0
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.js +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.d.ts +66 -0
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.js +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.d.ts +61 -0
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.js +255 -0
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.mjs +255 -0
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.d.ts +17 -0
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.js +255 -0
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.d.ts +97 -0
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.js +255 -0
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.d.ts +16 -0
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.js +255 -0
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.d.ts +37 -0
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.js +255 -0
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.mjs +255 -0
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.d.ts +93 -0
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.js +255 -0
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.mjs +255 -0
- package/plugins/Object3DHelperPlugin/constant.d.ts +27 -0
- package/plugins/Object3DHelperPlugin/constant.js +255 -0
- package/plugins/Object3DHelperPlugin/constant.mjs +255 -0
- package/plugins/Object3DHelperPlugin/index.d.ts +6 -0
- package/plugins/Object3DHelperPlugin/index.js +255 -0
- package/plugins/Object3DHelperPlugin/index.mjs +255 -0
- package/plugins/Object3DHelperPlugin/typing.d.ts +143 -0
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.d.ts +22 -0
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.d.ts +23 -0
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.d.ts +19 -0
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.d.ts +5 -0
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.d.ts +3 -0
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/direction.d.ts +14 -0
- package/plugins/Object3DHelperPlugin/utils/direction.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/direction.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.d.ts +5 -0
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.d.ts +8 -0
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.d.ts +8 -0
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/solidGuide.d.ts +27 -0
- package/plugins/Object3DHelperPlugin/utils/solidGuide.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/solidGuide.mjs +255 -0
- package/plugins/Object3DHelperPlugin/utils/tipsDom.d.ts +8 -0
- package/plugins/Object3DHelperPlugin/utils/tipsDom.js +255 -0
- package/plugins/Object3DHelperPlugin/utils/tipsDom.mjs +255 -0
- package/plugins/PanoAnimePlugin/Controller.d.ts +49 -0
- package/plugins/PanoAnimePlugin/Controller.js +255 -0
- package/plugins/PanoAnimePlugin/Controller.mjs +255 -0
- package/plugins/PanoAnimePlugin/index.d.ts +5 -0
- package/plugins/PanoAnimePlugin/index.js +255 -0
- package/plugins/PanoAnimePlugin/index.mjs +255 -0
- package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
- package/plugins/WordPassPlugin/Controller.d.ts +62 -0
- package/plugins/WordPassPlugin/Controller.js +255 -0
- package/plugins/WordPassPlugin/Controller.mjs +255 -0
- package/plugins/WordPassPlugin/hersheyFont.d.ts +11 -0
- package/plugins/WordPassPlugin/hersheyFont.js +255 -0
- package/plugins/WordPassPlugin/hersheyFont.mjs +255 -0
- package/plugins/WordPassPlugin/index.d.ts +7 -0
- package/plugins/WordPassPlugin/index.js +255 -0
- package/plugins/WordPassPlugin/index.mjs +255 -0
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.d.ts +82 -0
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.js +256 -0
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.mjs +256 -0
- package/plugins/WordPassPlugin/typing.d.ts +109 -0
- package/plugins/WordPassPlugin/word-pass.d.ts +172 -0
- package/plugins/WordPassPlugin/word-pass.js +255 -0
- package/plugins/WordPassPlugin/word-pass.mjs +255 -0
- package/plugins/index.d.ts +8 -0
- package/plugins/index.js +3 -3
- package/plugins/index.mjs +3 -287
- package/plugins/thirdParty/CSS2DRenderer.d.ts +37 -0
- package/plugins/thirdParty/CSS2DRenderer.js +255 -0
- package/plugins/thirdParty/CSS2DRenderer.mjs +255 -0
- package/plugins/thirdParty/CSS3DRenderer.d.ts +45 -0
- package/plugins/thirdParty/CSS3DRenderer.js +255 -0
- package/plugins/thirdParty/CSS3DRenderer.mjs +255 -0
- package/plugins/thirdParty/OrbitControls.d.ts +78 -0
- package/plugins/thirdParty/doctorstrange-model.d.ts +92 -0
- package/plugins/thirdParty/doctorstrange-model.js +610 -0
- package/plugins/thirdParty/doctorstrange-model.mjs +610 -0
- package/plugins/thirdParty/domevents.d.ts +36 -0
- package/plugins/thirdParty/domevents.js +255 -0
- package/plugins/thirdParty/domevents.mjs +255 -0
- package/plugins/utils/absoluteUrl.js +255 -0
- package/plugins/utils/absoluteUrl.mjs +255 -0
- package/plugins/utils/calculatePath.d.ts +3 -0
- package/plugins/utils/calculatePath.js +255 -0
- package/plugins/utils/calculatePath.mjs +255 -0
- package/plugins/utils/clamp.d.ts +2 -0
- package/plugins/utils/clamp.js +255 -0
- package/plugins/utils/clamp.mjs +255 -0
- package/plugins/utils/uuid.d.ts +2 -0
- package/plugins/utils/uuid.js +255 -0
- package/plugins/utils/uuid.mjs +255 -0
- package/react/context.d.ts +1 -1
- package/react/createProvider.d.ts +1 -1
- package/react/fiveApp.d.ts +1 -1
- package/react/hooks/unsafe__useFiveInstance.d.ts +1 -1
- package/react/hooks/useFiveAction.d.ts +1 -1
- package/react/hooks/useFiveCurrentObserver.d.ts +1 -1
- package/react/hooks/useFiveCurrentState.d.ts +1 -1
- package/react/hooks/useFiveEventCallback.d.ts +1 -1
- package/react/hooks/useFiveModelEffect.d.ts +1 -1
- package/react/hooks/useFiveModelIntersectRaycaster.d.ts +1 -1
- package/react/hooks/useFivePlugin.d.ts +1 -1
- package/react/hooks/useFiveSceneEffect.d.ts +1 -1
- package/react/hooks/useFiveState.d.ts +1 -1
- package/react/hooks/useFiveWork.d.ts +1 -1
- package/react/index.js +3 -3
- package/react/index.mjs +3 -3
- package/react/withFive.d.ts +1 -1
- 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 +817 -3
- package/umd/five-react.js +3 -3
- package/umd/five-sticker.js +255 -0
- package/umd/five-vfx.js +323 -0
- package/umd/five.js +472 -412
- 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/util/renderData.d.ts +0 -66
- 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/five/{renderer/compute-renderers/shaders/rasterize.d.ts → gaussian-splatting/gpu-sort/shaders/prefixSum.d.ts} +0 -0
|
@@ -103,7 +103,7 @@ SDK 内置了图片格式兼容性检测(`imageSupport`)。
|
|
|
103
103
|
启用 AVIF 格式并设置初始尺寸为 `512`,适用于大多数场景。
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
|
-
import { Five } from "@realsee/five";
|
|
106
|
+
import { Five } from "@realsee/five-webgpu";
|
|
107
107
|
|
|
108
108
|
const five = new Five({
|
|
109
109
|
imageOptions: {
|
|
@@ -117,7 +117,7 @@ const five = new Five({
|
|
|
117
117
|
将数据中的 `custom-oss-public.ljcdn.com` 域名映射到对应的资源专用 OSS 域名。
|
|
118
118
|
|
|
119
119
|
```typescript
|
|
120
|
-
import { Five } from "@realsee/five";
|
|
120
|
+
import { Five } from "@realsee/five-webgpu";
|
|
121
121
|
|
|
122
122
|
const five = new Five({
|
|
123
123
|
imageOptions: {
|
|
@@ -139,7 +139,7 @@ const five = new Five({
|
|
|
139
139
|
使用 SDK 提供的 `defaultImageURLTransform` 工具函数(通常导出为 `defaultImageURLTransform`,可重命名为 `imageURL`),结合 `cut` 参数获取全景图特定区域(例如获取前方图片的中心 512x512 区域)。
|
|
140
140
|
|
|
141
141
|
```typescript
|
|
142
|
-
import { defaultImageURLTransform as imageURL } from "@realsee/five";
|
|
142
|
+
import { defaultImageURLTransform as imageURL } from "@realsee/five-webgpu";
|
|
143
143
|
|
|
144
144
|
const originalUrl = "https://vr-public.realsee-cdn.com/.../pano_f.jpg";
|
|
145
145
|
|
|
@@ -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; // 是否使用简化/无光照材质 (取决于加载器实现)
|
|
@@ -41,18 +41,18 @@ interface BaseLoaderOptions {
|
|
|
41
41
|
## Concepts
|
|
42
42
|
|
|
43
43
|
### 独立加载函数 (Standalone Functions)
|
|
44
|
-
这些加载函数(如 `loadGltf`, `loadPly`)是 `@realsee/five` 包导出的**独立函数**,而非 `Five` 实例的方法。你需要单独引入它们使用。
|
|
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`。
|
|
@@ -206,8 +206,8 @@ Five 使用 **Z-up** (Z 轴向上) 的右手坐标系。
|
|
|
206
206
|
### 基础用法:加载 GLTF 模型 (Basic Usage)
|
|
207
207
|
|
|
208
208
|
```typescript
|
|
209
|
-
import { Five, FivePlugin } from '@realsee/five';
|
|
210
|
-
import { loadGltf } from '@realsee/five';
|
|
209
|
+
import { Five, FivePlugin } from '@realsee/five-webgpu';
|
|
210
|
+
import { loadGltf } from '@realsee/five-webgpu';
|
|
211
211
|
import * as THREE from 'three';
|
|
212
212
|
|
|
213
213
|
const five = new Five({/*...*/});
|
|
@@ -237,11 +237,11 @@ loadGltf('https://example.com/model.glb').then((result) => {
|
|
|
237
237
|
### 进阶用法:加载高斯泼溅 (Gaussian Splat)
|
|
238
238
|
|
|
239
239
|
```typescript
|
|
240
|
-
import { loadSplat } from '@realsee/five';
|
|
240
|
+
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);
|
|
@@ -252,7 +252,7 @@ loadSplat('https://example.com/scene.splat', {
|
|
|
252
252
|
### 进阶用法:自定义 PLY 属性映射 (Custom PLY Properties)
|
|
253
253
|
|
|
254
254
|
```typescript
|
|
255
|
-
import { loadPly } from '@realsee/five';
|
|
255
|
+
import { loadPly } from '@realsee/five-webgpu';
|
|
256
256
|
|
|
257
257
|
loadPly('https://example.com/data.ply', {
|
|
258
258
|
type: 'pbmPointCloud',
|
|
@@ -272,7 +272,7 @@ loadPly('https://example.com/data.ply', {
|
|
|
272
272
|
### 基础用法:加载 OBJ 模型 (Basic Usage - OBJ)
|
|
273
273
|
|
|
274
274
|
```typescript
|
|
275
|
-
import { loadObj } from '@realsee/five';
|
|
275
|
+
import { loadObj } from '@realsee/five-webgpu';
|
|
276
276
|
|
|
277
277
|
loadObj('https://example.com/model.obj', {
|
|
278
278
|
modelUpAxis: 'Z', // OBJ 默认通常是 Z-up (或根据实际情况调整)
|
|
@@ -285,7 +285,7 @@ loadObj('https://example.com/model.obj', {
|
|
|
285
285
|
### 基础用法:加载 FBX 模型
|
|
286
286
|
|
|
287
287
|
```typescript
|
|
288
|
-
import { loadFbx } from '@realsee/five';
|
|
288
|
+
import { loadFbx } from '@realsee/five-webgpu';
|
|
289
289
|
|
|
290
290
|
loadFbx('https://example.com/model.fbx').then((result) => {
|
|
291
291
|
five.scene.add(result.scene);
|
|
@@ -296,7 +296,7 @@ loadFbx('https://example.com/model.fbx').then((result) => {
|
|
|
296
296
|
### 进阶用法:加载 Dome 全景 (Panorama)
|
|
297
297
|
|
|
298
298
|
```typescript
|
|
299
|
-
import { loadDome } from '@realsee/five';
|
|
299
|
+
import { loadDome } from '@realsee/five-webgpu';
|
|
300
300
|
|
|
301
301
|
// 加载 .dome 或 .domez 格式
|
|
302
302
|
loadDome('https://example.com/panorama.domez', {
|
|
@@ -313,7 +313,7 @@ loadDome('https://example.com/panorama.domez', {
|
|
|
313
313
|
### 进阶用法:加载压缩模型 (AT3D)
|
|
314
314
|
|
|
315
315
|
```typescript
|
|
316
|
-
import { loadAt3d } from '@realsee/five';
|
|
316
|
+
import { loadAt3d } from '@realsee/five-webgpu';
|
|
317
317
|
|
|
318
318
|
loadAt3d('https://example.com/model.at3d', {
|
|
319
319
|
light: false,
|
|
@@ -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)
|
|
@@ -167,7 +154,7 @@ five.setState({ mode: 'Mapview' });
|
|
|
167
154
|
在 `new Five()` 时配置各个模式的默认参数:
|
|
168
155
|
|
|
169
156
|
```typescript
|
|
170
|
-
import { Five, PanoCircleMeshSolid } from '@realsee/five';
|
|
157
|
+
import { Five, PanoCircleMeshSolid } from '@realsee/five-webgpu';
|
|
171
158
|
|
|
172
159
|
const five = new Five({
|
|
173
160
|
// 全景模式配置
|
|
@@ -225,7 +212,7 @@ five.updateConfiguration({
|
|
|
225
212
|
使用 `changeMode` 精准控制切换过程,并监听完成时机:
|
|
226
213
|
|
|
227
214
|
```ts
|
|
228
|
-
import { Five, Mode } from '@realsee/five';
|
|
215
|
+
import { Five, Mode } from '@realsee/five-webgpu';
|
|
229
216
|
|
|
230
217
|
const five = new Five();
|
|
231
218
|
|
|
@@ -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
|
```
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
`PBMPanoFilter` 类定义了全景图的滤镜参数。所有属性均为对象引用,直接修改其内部属性即可生效。
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { PBMUpdateable } from "@realsee/five";
|
|
16
|
+
import { PBMUpdateable } from "@realsee/five-webgpu";
|
|
17
17
|
|
|
18
18
|
export class PBMPanoFilter extends PBMUpdateable {
|
|
19
19
|
/** 对比度控制 */
|
|
@@ -81,7 +81,7 @@ export class PBMPanoFilter extends PBMUpdateable {
|
|
|
81
81
|
创建一个滤镜实例并应用到 Five 场景中。
|
|
82
82
|
|
|
83
83
|
```typescript
|
|
84
|
-
import { Five, PBMPanoFilter } from "@realsee/five";
|
|
84
|
+
import { Five, PBMPanoFilter } from "@realsee/five-webgpu";
|
|
85
85
|
|
|
86
86
|
const five = new Five();
|
|
87
87
|
// ... 初始化 five ...
|
|
@@ -105,7 +105,7 @@ five.modelScene.parameter.set('panoFilter', panoFilter);
|
|
|
105
105
|
滤镜参数支持实时修改,适合制作调节面板。
|
|
106
106
|
|
|
107
107
|
```typescript
|
|
108
|
-
import { Five, PBMPanoFilter } from "@realsee/five";
|
|
108
|
+
import { Five, PBMPanoFilter } from "@realsee/five-webgpu";
|
|
109
109
|
|
|
110
110
|
// 假设已经有 five 实例
|
|
111
111
|
const panoFilter = new PBMPanoFilter();
|
|
@@ -76,7 +76,7 @@ interface ImageOptions {
|
|
|
76
76
|
### 查看瓦片数据结构
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
|
-
import { Five } from "@realsee/five";
|
|
79
|
+
import { Five } from "@realsee/five-webgpu";
|
|
80
80
|
|
|
81
81
|
const five = new Five();
|
|
82
82
|
|
|
@@ -94,7 +94,7 @@ five.on("loaded", () => {
|
|
|
94
94
|
### 配置瓦片加载策略与图片参数
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
|
-
import { Five } from "@realsee/five";
|
|
97
|
+
import { Five } from "@realsee/five-webgpu";
|
|
98
98
|
|
|
99
99
|
const five = new Five({
|
|
100
100
|
// 自定义瓦片层级选择策略
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
15
|
import * as THREE from "three/webgpu";
|
|
16
|
-
import { Mode } from "@realsee/five";
|
|
16
|
+
import { Mode } from "@realsee/five-webgpu";
|
|
17
17
|
|
|
18
18
|
interface Pose {
|
|
19
19
|
/** 相机偏航角 (水平方向),单位:弧度 */
|
|
@@ -79,8 +79,8 @@ const state = five.state;
|
|
|
79
79
|
|
|
80
80
|
// 在当前状态基础上,向右旋转 90 度,并略微拉远距离
|
|
81
81
|
five.setState({
|
|
82
|
-
longitude:
|
|
83
|
-
distance:
|
|
82
|
+
longitude: state.longitude + Math.PI / 2,
|
|
83
|
+
distance: state.distance + 2.0
|
|
84
84
|
});
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -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` 可实时调节以观察增益变化。
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
15
|
import * as THREE from "three/webgpu";
|
|
16
|
-
import type { Mode } from "@realsee/five";
|
|
16
|
+
import type { Mode } from "@realsee/five-webgpu";
|
|
17
17
|
|
|
18
18
|
type CubeFace = 'up' | 'down' | 'left' | 'right' | 'front' | 'back';
|
|
19
19
|
|
|
@@ -221,7 +221,7 @@ Observer 是 VR 空间中预设的观察位置。在 **Panorama (全景)** 模
|
|
|
221
221
|
最基础的用法是从 API 获取数据并加载。
|
|
222
222
|
|
|
223
223
|
```ts
|
|
224
|
-
import { Five, parseWork } from "@realsee/five";
|
|
224
|
+
import { Five, parseWork } from "@realsee/five-webgpu";
|
|
225
225
|
|
|
226
226
|
const five = new Five();
|
|
227
227
|
five.appendTo(document.getElementById("app"));
|
package/ai_guides/quick-start.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
通过 npm 或 yarn 安装:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install three@^0.
|
|
10
|
+
npm install three@^0.183.2 @realsee/five-webgpu
|
|
11
11
|
# or
|
|
12
|
-
yarn add three@^0.
|
|
12
|
+
yarn add three@^0.183.2 @realsee/five-webgpu
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
> **注意**: Five 依赖 `three`,请确保安装了兼容的版本。
|
|
@@ -19,7 +19,7 @@ yarn add three@^0.117.1 @realsee/five
|
|
|
19
19
|
初始化 Five 实例并加载 Work 数据:
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
|
-
import { Five, parseWork } from "@realsee/five";
|
|
22
|
+
import { Five, parseWork } from "@realsee/five-webgpu";
|
|
23
23
|
|
|
24
24
|
// 1. 创建 Five 实例
|
|
25
25
|
const five = new Five();
|