@realsee/five-webgpu 1.0.0-alpha.4 → 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +8 -8
- 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/mode.md +3 -23
- 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 +68 -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 +1 -1
- package/docs/classes/index.GaussianBlurPass.html +1 -1
- package/docs/classes/index.InternalWebGPURenderer.html +14 -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 +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 +16 -5
- package/docs/classes/index.PBMMeshBasicNodeMaterial.html +28 -7
- package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +16 -5
- package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +28 -7
- package/docs/classes/index.PBMMeshPhongMaterial.html +16 -5
- package/docs/classes/index.PBMMeshPhongNodeMaterial.html +28 -7
- package/docs/classes/index.PBMMeshPhysicalMaterial.html +16 -5
- package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +28 -7
- package/docs/classes/index.PBMPanoFilter.html +8 -8
- package/docs/classes/index.PBMPointCloud.html +1 -1
- 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 -52
- 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/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 +7 -7
- 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_mode.html +5 -15
- 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 +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/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.EventCallback.html +49 -47
- package/docs/interfaces/index.FiveInitArgs.html +49 -40
- package/docs/interfaces/index.GainmapCfgData.html +15 -0
- package/docs/interfaces/index.GestureEvent.html +2 -2
- package/docs/interfaces/index.IPBMMaterial.html +15 -4
- 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.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.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 -37
- package/docs/interfaces/index.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/index.ParameterValue.html +56 -51
- package/docs/interfaces/index.Pose.html +1 -1
- package/docs/interfaces/index.RenderEvent.html +2 -2
- package/docs/interfaces/index.ResolvedParameterValue.html +56 -51
- 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.XRSessionEvent.html +2 -2
- package/docs/modules/index.html +1 -1
- package/docs/types/index.ControllerCustomInitTypes.html +3 -2
- package/docs/types/index.ControllerEventTypes.html +25 -23
- package/docs/types/index.EventTypes.html +26 -26
- package/docs/types/index.Mode.html +2 -1
- package/docs/types/index.PBMCustomNodeTargetType.html +2 -0
- package/docs/types/index.ParseOptions.html +14 -8
- 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.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
- package/docs/variables/index.controllersDefaultInitArgs.html +1 -1
- package/five/application/controllers.d.ts +4 -0
- package/five/application/events.d.ts +1 -1
- package/five/application/five.d.ts +4 -1
- package/five/application/fiveInitArgs.d.ts +13 -0
- package/five/application/mode.d.ts +2 -0
- 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/core/internalWebGPURenderer.d.ts +16 -0
- package/five/core/panoVideo.d.ts +4 -1
- package/five/core/tiling.d.ts +40 -9
- 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 +4 -1
- package/five/index.js +272 -269
- package/five/index.mjs +7183 -4546
- package/five/meshes/panoCircleMeshCustom.d.ts +1 -0
- package/five/model/index.d.ts +1 -1
- 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 +4 -0
- package/five/model/materials/pbmMaterial.d.ts +268 -5
- 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 +9 -0
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +67 -101
- package/five/model/parameter.d.ts +13 -1
- 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/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 +17 -1
- package/five/utils/gainmap-data.d.ts +23 -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/package.json +6 -1
- 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 +5 -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/floorplanServerData.d.ts +78 -0
- package/plugins/FloorplanPlugin/typings/index.d.ts +2 -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/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/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 +393 -3
- package/plugins/index.mjs +3421 -92
- 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/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/umd/five-gltf-loader.js +255 -0
- package/umd/five-plugins.js +461 -3
- package/umd/five-react.js +2 -2
- package/umd/five.js +350 -347
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as THREE from 'three/webgpu';
|
|
2
2
|
import { PBMGaussianSplattingNodeMaterial } from '../materials/pbmGaussianSplattingNodeMaterial';
|
|
3
3
|
/**
|
|
4
|
-
* 3DGS 渲染 Mesh(WebGPU / TSL
|
|
4
|
+
* 3DGS 渲染 Mesh(WebGPU / TSL 版)
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* 主循环用四个协作者准备数据:
|
|
7
7
|
* - `SplatAssembler`:per-object region 增量 diff + **CPU 拼装** 大数据纹理
|
|
8
8
|
* (把各对象 packedData 紧凑拷进 CPU 缓冲,写 transformIndex/layerIndex 到 texel1.w;
|
|
9
9
|
* 经 THREE.DataTexture 上传供主材质采样)
|
|
@@ -15,11 +15,14 @@ import { PBMGaussianSplattingNodeMaterial } from '../materials/pbmGaussianSplatt
|
|
|
15
15
|
* 索引顺序 ≡ `SHStore` 写入顺序。四个协作者都从**同一有序 `objects` 数组、同一顺序**同步,
|
|
16
16
|
* 因此不会产生 transformIndex / SH 错位;`onBeforeRender` 中另加防御性一致性断言兜底。
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* 排序:本类**不再自己排序**。排序、绘制索引来源与绘制实例数一律经 `GSplatPipeline` 抽象基类
|
|
19
|
+
* 消费(Requirement 10.2):
|
|
20
|
+
* - `RASTER_CPU_SORT`(`CpuSortPipeline`):wasm worker 排序 + Reorder_CPU,索引来自
|
|
21
|
+
* `splatIndex` 实例属性;
|
|
22
|
+
* - `RASTER_GPU_SORT`(`GpuSortPipeline`):GPU radix sort,索引来自 R32UI Order_Texture。
|
|
23
|
+
* 「本帧是否需要排序」由 `SortThrottle` 判定(相机小平移 / 小角度 / min-interval 门),
|
|
24
|
+
* 与管线实现无关,两条路径的节流行为完全一致。管线按 `pipelineMode` 解析结果整体切换,
|
|
25
|
+
* 本类不引用 Sort_Worker、排序模块或任何 WebGPU 资源。
|
|
23
26
|
*
|
|
24
27
|
* 大数据纹理:
|
|
25
28
|
* - `SplatAssembler` 在对象集合变化时在 **CPU** 端把各对象 packedData 紧凑拼进一张
|
|
@@ -36,100 +39,61 @@ declare class PBMGaussianSplattingRenderMesh extends THREE.Mesh<THREE.InstancedB
|
|
|
36
39
|
private transformStore;
|
|
37
40
|
private layerRegistry;
|
|
38
41
|
private shStore;
|
|
39
|
-
|
|
42
|
+
/**
|
|
43
|
+
* 当前生效的排序管线。由 `syncPipelineMode` 按 Current_Pipeline_Mode 创建 / 重建,
|
|
44
|
+
* 尚未创建(首帧之前)时为 null。
|
|
45
|
+
*/
|
|
46
|
+
private pipeline;
|
|
47
|
+
/** 排序节流器:判定本 Render_Frame 是否需要调用 `pipeline.requestSort`。 */
|
|
48
|
+
private throttle;
|
|
49
|
+
/** Requested_Pipeline_Mode(外部经 `pipelineMode` 写入,下一帧生效)。 */
|
|
50
|
+
private _requestedPipelineMode;
|
|
51
|
+
/**
|
|
52
|
+
* Current_Pipeline_Mode(`resolvePipelineMode` 的解析结果,永不为 `AUTO`)。
|
|
53
|
+
* 初值取 CPU 排序:管线未创建前对外报告最保守的取值。
|
|
54
|
+
*/
|
|
55
|
+
private _activePipelineMode;
|
|
56
|
+
/**
|
|
57
|
+
* 创建当前 `pipeline` 时所用的渲染器。渲染器只能从 `onBeforeRender` 拿到,因此管线在首帧
|
|
58
|
+
* 才创建;若本 Mesh 被挂到另一个渲染器上(renderer 身份变化),管线持有的 device 资源不再
|
|
59
|
+
* 有效,需连同模式一起重建。
|
|
60
|
+
*/
|
|
61
|
+
private _pipelineRenderer;
|
|
62
|
+
/**
|
|
63
|
+
* 传给管线的每帧参数。**跨帧复用同一个对象**(Requirement 10.7),每帧填字段后传入,
|
|
64
|
+
* 不在渲染循环里新建。`camera` 由每帧填充,构造时无值。
|
|
65
|
+
*/
|
|
66
|
+
private _frameParams;
|
|
40
67
|
/**
|
|
41
68
|
* 大纹理待组装标记:tile 集合变化(rebuildScene)时置 true;onBeforeRender 中即调用
|
|
42
69
|
* `assembler.assemble()`(CPU 拼装 + DataTexture 上传)并清除。相机移动帧不置位(不重组装)。
|
|
43
70
|
*/
|
|
44
71
|
private assemblePending;
|
|
45
|
-
/** splatIndex 实例属性的当前容量(点数);不足时按 2 的幂扩容。 */
|
|
46
|
-
private splatIndexCapacity;
|
|
47
|
-
/** 单调递增的排序请求代;每代记录其所基于的布局快照,回传时按代取回(防异步错配)。 */
|
|
48
|
-
private sortGeneration;
|
|
49
|
-
/** 当前排序输入是否已上传给 worker(场景/transform 变化时置 false 触发重传)。 */
|
|
50
|
-
private sortDataUploaded;
|
|
51
|
-
/** 排序输入(布局 / transform)自上次上传后是否已变化——脏则强制重排并重传。 */
|
|
52
|
-
private sortInputsDirty;
|
|
53
72
|
private forceClipperUniformRefresh;
|
|
73
|
+
private usedSHDegree;
|
|
74
|
+
constructor();
|
|
54
75
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
private sortWorkerFailed;
|
|
59
|
-
/** 当前 order 长度(= 最近一次排序回传的 depthIndex 长度 = 该次排序时 vertexCount)。 */
|
|
60
|
-
private orderCount;
|
|
61
|
-
/**
|
|
62
|
-
* 最近一次排序回传的 depthIndex 副本(基于 orderBaseSnapshot 布局的全局点索引 P 的排列)。
|
|
63
|
-
* 作为 CPU reorder 的输入源:`applyReorderCPU` 用「orderBaseSnapshot → 当前布局」段表把它
|
|
64
|
-
* remap 到当前布局,紧凑写入 splatIndex 实例属性,从而在 tile 增删(布局变化)时保持排序与
|
|
65
|
-
* 大纹理映射一致、不闪烁。
|
|
76
|
+
* Requested_Pipeline_Mode(`GSPLAT_PIPELINE_*`)。写入后在**下一帧**由
|
|
77
|
+
* `syncPipelineMode` 解析并按需重建管线,便于开发期在同场景下对比两条管线
|
|
78
|
+
* (Requirement 13.2)。
|
|
66
79
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
private layoutDirty;
|
|
72
|
-
/** 当前存活实例数(= 最近一次 applyReorderCPU 写入 splatIndex 的点数)。 */
|
|
73
|
-
private aliveCount;
|
|
74
|
-
/** 当前 order 所基于的布局快照(= 该次排序发起时的布局)。 */
|
|
75
|
-
private orderBaseSnapshot;
|
|
76
|
-
/** generation → 该次排序发起时的布局快照。 */
|
|
77
|
-
private snapshotByGen;
|
|
78
|
-
private prevSortCameraMatrix;
|
|
80
|
+
get pipelineMode(): number;
|
|
81
|
+
set pipelineMode(value: number);
|
|
82
|
+
/** 实际生效的 Current_Pipeline_Mode(解析后的结果,永不为 `AUTO`)。 */
|
|
83
|
+
get currentPipelineMode(): number;
|
|
79
84
|
/** 平移增量阈值(世界单位):超过才重排。 */
|
|
80
|
-
sortCameraDistance: number;
|
|
85
|
+
get sortCameraDistance(): number;
|
|
86
|
+
set sortCameraDistance(value: number);
|
|
81
87
|
/** 姿态相似度阈值(|quat 点积|):低于才重排(0.99 ≈ 约 16° 内不重排)。 */
|
|
82
|
-
sortCameraCoorient: number;
|
|
88
|
+
get sortCameraCoorient(): number;
|
|
89
|
+
set sortCameraCoorient(value: number);
|
|
83
90
|
/** 最小重排间隔(ms):即使脏也不超过此频率,0=不限。 */
|
|
84
|
-
sortMinIntervalMs: number;
|
|
85
|
-
|
|
86
|
-
private _scratchViewProj;
|
|
87
|
-
private usedSHDegree;
|
|
88
|
-
constructor();
|
|
91
|
+
get sortMinIntervalMs(): number;
|
|
92
|
+
set sortMinIntervalMs(value: number);
|
|
89
93
|
private createGeometry;
|
|
90
|
-
/**
|
|
91
|
-
* 确保 splatIndex 实例属性容量 >= requiredCount;不足时按 2 的幂扩容(保留旧内容)。
|
|
92
|
-
* 返回当前(可能是新建的)属性。
|
|
93
|
-
*/
|
|
94
|
-
private ensureSplatIndexCapacity;
|
|
95
94
|
private createMaterial;
|
|
96
95
|
private createDefaultLayerClipperRanges;
|
|
97
96
|
private createDefaultClipperMatrices;
|
|
98
|
-
/**
|
|
99
|
-
* 应用排序结果:
|
|
100
|
-
* 1. 保存 depthIndex 副本到 `orderData`(作为 CPU reorder 的输入源;实际 remap 在
|
|
101
|
-
* onBeforeRender 中由 applyReorderCPU 完成,此处不写 splatIndex)。
|
|
102
|
-
* 2. 置 orderDirty(新排序回传 → 需重跑 CPU reorder)。
|
|
103
|
-
* 3. 按 generation 取回该次排序真正基于的布局快照,作为 reorder 基准,并清理更旧快照
|
|
104
|
-
* (worker 结果按 generation 单调返回,更旧快照不会再用到)。
|
|
105
|
-
* 保证:每次回传的 depthIndex 恒为「该代排序时 totalPoints」的一个排列,点数守恒。
|
|
106
|
-
*/
|
|
107
|
-
private applyDepthIndex;
|
|
108
|
-
/** 捕获当前布局:assembler.regions 的 {object, start, count}(顺序即全局点区间顺序)。 */
|
|
109
|
-
private snapshotLayout;
|
|
110
|
-
/**
|
|
111
|
-
* 用「排序时旧布局 → 当前布局」构造 reorder 段表:
|
|
112
|
-
* - 存活对象:{ oldStart, oldEnd, delta = 当前 start - 旧 start, removed: false }
|
|
113
|
-
* - 被删对象:{ oldStart, oldEnd, delta: 0, removed: true }
|
|
114
|
-
* 段按 oldStart 升序(base 已按 start 升序)、区间不重叠;相邻同类段(同 removed 且
|
|
115
|
-
* removed 或 delta 相同、且首尾相接)合并以压低段数(供 applyReorderCPU 二分查找)。
|
|
116
|
-
*/
|
|
117
|
-
private buildSegments;
|
|
118
|
-
/**
|
|
119
|
-
* 二分查找覆盖全局点索引 P 的段(段按 oldStart 升序、区间 [oldStart,oldEnd) 连续无重叠)。
|
|
120
|
-
* 找不到(P 越界,理论上不会发生)返回 null。
|
|
121
|
-
*/
|
|
122
|
-
private findSegment;
|
|
123
|
-
/**
|
|
124
|
-
* CPU reorder:把最近一次排序回传的 depthIndex(orderData,基于 orderBaseSnapshot 旧布局的
|
|
125
|
-
* 全局点索引 P 的排列)用「旧布局 → 当前布局」段表 remap 到当前布局,紧凑写入 splatIndex 实例属性:
|
|
126
|
-
* - 存活对象点 P → 写入 P + delta;
|
|
127
|
-
* - 被删对象点(removed)→ 跳过(不写,实例数不计)。
|
|
128
|
-
* 从而在 tile 增删(布局变化)时保持排序顺序与大纹理映射一致、不闪烁(等价 five 的 ReorderPass)。
|
|
129
|
-
* 结果实例数写入 `geometry.instanceCount`(= 存活点数 n)。material.numPoints 设为当前布局总点数
|
|
130
|
-
* 作 shader 端 P>=numPoints 的保护性剔除(正常情况下存活区都 < numPoints)。
|
|
131
|
-
*/
|
|
132
|
-
private applyReorderCPU;
|
|
133
97
|
private collectObjects;
|
|
134
98
|
private isSceneNeedsRebuild;
|
|
135
99
|
private getClipperHash;
|
|
@@ -142,8 +106,8 @@ declare class PBMGaussianSplattingRenderMesh extends THREE.Mesh<THREE.InstancedB
|
|
|
142
106
|
/**
|
|
143
107
|
* 场景变化时按**同一有序 objects**依次同步四个协作者,保证布局三一致:
|
|
144
108
|
* layerRegistry / transformStore 先行(assembler 的 resolveIndices 依赖二者的 indexOf/layerIndexOf),
|
|
145
|
-
* 再 assembler.sync(增量 diff + 连续 start 偏移,不触碰 GPU)→ shStore.sync
|
|
146
|
-
* 延迟到 onBeforeRender
|
|
109
|
+
* 再 assembler.sync(增量 diff + 连续 start 偏移,不触碰 GPU)→ shStore.sync;大纹理组装
|
|
110
|
+
* 延迟到 onBeforeRender 中的 assembler.assemble()。
|
|
147
111
|
*/
|
|
148
112
|
private rebuildScene;
|
|
149
113
|
/**
|
|
@@ -151,21 +115,23 @@ declare class PBMGaussianSplattingRenderMesh extends THREE.Mesh<THREE.InstancedB
|
|
|
151
115
|
* 四者由 rebuildScene 从同一 objects 同序同步,正常情况下恒成立;不成立即视为错误状态并告警。
|
|
152
116
|
*/
|
|
153
117
|
private assertLayoutConsistency;
|
|
154
|
-
/**
|
|
155
|
-
* 把排序输入喂给 Sort_Worker:位置 + transformIndex 来自 assembler.extractSortInputs(),
|
|
156
|
-
* 变换矩阵来自 transformStore.transforms(20 float/对象,与 sort.cpp `_sort` 步长一致)。
|
|
157
|
-
* 每次上传 ++generation,回传时据此丢弃过期结果。
|
|
158
|
-
*/
|
|
159
|
-
private postSortData;
|
|
160
|
-
/**
|
|
161
|
-
* 是否需要重排:
|
|
162
|
-
* - 排序输入脏(布局 / transform 变化)或尚未上传过 → 强制重排;
|
|
163
|
-
* - 否则比较相机相对「上次排序时快照」的平移 / 姿态增量,均小于阈值则跳过(小角度节流)。
|
|
164
|
-
*/
|
|
165
|
-
private shouldSort;
|
|
166
|
-
private requestSort;
|
|
167
118
|
/** 把 store 产出的纹理与 SH 阶数同步到材质。 */
|
|
168
119
|
private syncMaterialTextures;
|
|
120
|
+
/**
|
|
121
|
+
* 每帧一次的 Pipeline_Mode 检查与管线切换(Requirement 8.2)。
|
|
122
|
+
*
|
|
123
|
+
* 之所以每帧检查而非首帧一次性初始化:`pipelineMode` 的运行时修改要在下一帧生效
|
|
124
|
+
* (Requirement 8.6 / 13.2),且 `totalPoints` 增长导致 limits 越界、或 GPU 管线运行期失效
|
|
125
|
+
* (compute pipeline 创建失败 / device lost,经 `unusable` 汇聚)时都要能自动降级。
|
|
126
|
+
* 所有降级情形统一归结为「`resolvePipelineMode` 返回 `RASTER_CPU_SORT`」后由本方法完成切换
|
|
127
|
+
* (Requirement 15.4),因此不存在第二条降级代码路径。
|
|
128
|
+
*
|
|
129
|
+
* 模式未变且管线已就绪时只做一次整数比较即返回,开销可忽略(Requirement 8.10)。
|
|
130
|
+
*
|
|
131
|
+
* @param renderer 本帧渲染器(由 `onBeforeRender` 传入,是取 `GPUDevice` 的唯一入口)
|
|
132
|
+
* @param totalPoints 当前布局的 Total_Points,用于按实际规模检查 limits
|
|
133
|
+
*/
|
|
134
|
+
private syncPipelineMode;
|
|
169
135
|
onBeforeRender: (renderer: any, scene: THREE.Scene, camera: THREE.Camera, ..._rest: any[]) => void;
|
|
170
136
|
dispose(): void;
|
|
171
137
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three/webgpu';
|
|
2
|
-
import { type PBMPanoPicture, type PBMPanoDepth, type PBMRefinedScreen, type PBMTransition, type PBMFloorStyle, type PBMRoofStyle, type PBMColorStyle, type PBMClipperParameter, type PBMPanoFilter, type PBMPointShape, type PBMPointSize, type PBMPointBack } from './materials/pbmMaterial';
|
|
2
|
+
import { type PBMPanoPicture, type PBMPanoDepth, type PBMRefinedScreen, type PBMTransition, type PBMFloorStyle, type PBMRoofStyle, type PBMColorStyle, type PBMClipperParameter, type PBMPanoFilter, type PBMPointShape, type PBMPointSize, type PBMPointBack, type PBMCustomNode } from './materials/pbmMaterial';
|
|
3
3
|
import type { TileRequestOrder } from './tile3d/types';
|
|
4
4
|
import type { Camera } from '../core/camera';
|
|
5
5
|
export interface ParameterMaterialValue {
|
|
@@ -80,6 +80,13 @@ export interface ParameterMaterialValue {
|
|
|
80
80
|
/** 3dgs球谐阶数*/
|
|
81
81
|
gaussianSplattingSHDegree: number;
|
|
82
82
|
maxDisplayBoost: number;
|
|
83
|
+
/** 自定义节点列表(TSL Node 级别的材质扩展) */
|
|
84
|
+
customNodes: readonly PBMCustomNode[];
|
|
85
|
+
/**
|
|
86
|
+
* 自定义节点 uniform 的脏计数器(内部维护,无需手动设置)。
|
|
87
|
+
* 任一 customNode emit('update') 时自动递增,用于触发材质刷新。
|
|
88
|
+
*/
|
|
89
|
+
customNodesVersion: number;
|
|
83
90
|
}
|
|
84
91
|
export interface ParameterTilesetValue {
|
|
85
92
|
/** 模型显示最小细化层级 */
|
|
@@ -132,6 +139,11 @@ export declare class Parameter {
|
|
|
132
139
|
resolveValue<K extends keyof ParameterValue>(name: K, ...values: Partial<ParameterValue>[]): ParameterValue[K];
|
|
133
140
|
resolveValue(...baseValues: Partial<ParameterValue>[]): ResolvedParameterValue;
|
|
134
141
|
private assignValue;
|
|
142
|
+
/**
|
|
143
|
+
* 递增 customNodesVersion 并 bump 参数版本,促使模型重新下发参数、
|
|
144
|
+
* 令 NodeMaterialObserver 检测到 customNodesVersion 变化而刷新(上传 customNode 的 uniform)。
|
|
145
|
+
*/
|
|
146
|
+
private bumpCustomNodesVersion;
|
|
135
147
|
set<T extends keyof ParameterValue>(name: T, value: ParameterValue[T]): this;
|
|
136
148
|
set(values: Partial<ParameterValue>): this;
|
|
137
149
|
reset(...names: (keyof ParameterValue)[]): this;
|
|
@@ -73,6 +73,8 @@ export declare class Tile3D extends THREE.Object3D {
|
|
|
73
73
|
loadContent(tile: Tile): Promise<void>;
|
|
74
74
|
unloadContent(tile: Tile): Promise<void>;
|
|
75
75
|
loadAllTilesets(): Promise<void>;
|
|
76
|
+
loadTrajectory(trajectory: Trajectory): Promise<void>;
|
|
77
|
+
unloadTrajectory(trajectory: Trajectory): Promise<void>;
|
|
76
78
|
intersectRaycaster(raycaster: THREE.Raycaster, target?: Intersection[]): Intersection[];
|
|
77
79
|
update(renderer: THREE.WebGPURenderer, camera: Camera, modelScene: ModelScene, model: Model): boolean;
|
|
78
80
|
dispose(): void;
|
|
@@ -12,6 +12,11 @@ export interface TilesetOptions {
|
|
|
12
12
|
onTileLoad: (tile: Tile) => any;
|
|
13
13
|
onTileUnload: (tile: Tile) => any;
|
|
14
14
|
onTileError: (tile: Tile, error: Error) => any;
|
|
15
|
+
trajectoryLoader: (trajectory: Trajectory) => Promise<void>;
|
|
16
|
+
trajectoryUnloader: (trajectory: Trajectory) => Promise<void>;
|
|
17
|
+
onTrajectoryLoad: (trajectory: Trajectory) => any;
|
|
18
|
+
onTrajectoryUnload: (trajectory: Trajectory) => any;
|
|
19
|
+
onTrajectoryError: (trajectory: Trajectory, error: Error) => any;
|
|
15
20
|
}
|
|
16
21
|
export declare class Tileset {
|
|
17
22
|
asset: {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
import type { Trajectory } from './trajectory';
|
|
3
|
+
import { Fetcher } from '../../utils/ajax';
|
|
4
|
+
/**
|
|
5
|
+
* 轨迹的两套自定义着色器原为 GLSL `ShaderMaterial`,WebGPURenderer 只支持 NodeMaterial
|
|
6
|
+
* (其它材质类型会被退化成空白 NodeMaterial),这里按 GLSL 逐层翻译为 TSL:
|
|
7
|
+
*
|
|
8
|
+
* 管道 TRAJECTOR_PIPE:
|
|
9
|
+
* vertex: `vUv = uv;` + `transformed += normalize(objectNormal) * displacementScalar`
|
|
10
|
+
* fragment: `if (mod(abs(vUv.x * totalLength + dashOffset), dashSize.x + dashSize.y) > dashSize.x) discard;`
|
|
11
|
+
* `vec4 diffuseColor = vec4(mix(diffuse, diffuse2, vUv.x), opacity);`
|
|
12
|
+
* 圆球 TRAJECTOR_SPHERE:
|
|
13
|
+
* vertex: `transformed += normalize(objectNormal) * displacementScalar`
|
|
14
|
+
* fragment: `vec4 diffuseColor = vec4(diffuse, opacity);`
|
|
15
|
+
*
|
|
16
|
+
* 说明:
|
|
17
|
+
* - 原 shader 里的 `<tonemapping_fragment>` / `<colorspace_fragment>` 由渲染器的 Output 通道统一处理
|
|
18
|
+
* (WebGPURenderer 把 tone mapping 与输出色彩空间放到独立的输出 pass),<fog_fragment> /
|
|
19
|
+
* `<premultiplied_alpha_fragment>` 对应 NodeMaterial 的 `fog` / `premultipliedAlpha` 属性(默认 fog 生效)。
|
|
20
|
+
* - 颜色不再调用 `convertSRGBToLinear()`:r152+ 的 `new THREE.Color(hex)` 已经按 sRGB 解释并转到线性工作空间,
|
|
21
|
+
* 再转换一次会变暗。
|
|
22
|
+
* - `uniform()` 生成的 uniform 节点保留 `.value` 读写,所以材质上挂的 `uniforms` 与 GLSL 版本用法一致
|
|
23
|
+
* (见 trajectory-node.ts 的 dashOffset 动画)。
|
|
24
|
+
*/
|
|
25
|
+
declare function createPipeUniforms(): {
|
|
26
|
+
diffuse: THREE.UniformNode<"color", THREE.Color>;
|
|
27
|
+
diffuse2: THREE.UniformNode<"color", THREE.Color>;
|
|
28
|
+
opacity: THREE.UniformNode<"float", number>;
|
|
29
|
+
displacementScalar: THREE.UniformNode<"float", number>;
|
|
30
|
+
totalLength: THREE.UniformNode<"float", number>;
|
|
31
|
+
dashSize: THREE.UniformNode<"vec2", THREE.Vector2>;
|
|
32
|
+
dashOffset: THREE.UniformNode<"float", number>;
|
|
33
|
+
};
|
|
34
|
+
declare function createSphereUniforms(): {
|
|
35
|
+
diffuse: THREE.UniformNode<"color", THREE.Color>;
|
|
36
|
+
opacity: THREE.UniformNode<"float", number>;
|
|
37
|
+
displacementScalar: THREE.UniformNode<"float", number>;
|
|
38
|
+
};
|
|
39
|
+
export type TrajectoryPipeUniforms = ReturnType<typeof createPipeUniforms>;
|
|
40
|
+
export type TrajectorySphereUniforms = ReturnType<typeof createSphereUniforms>;
|
|
41
|
+
export type TrajectoryPipeMaterial = THREE.NodeMaterial & {
|
|
42
|
+
uniforms: TrajectoryPipeUniforms;
|
|
43
|
+
};
|
|
44
|
+
export type TrajectorySphereMaterial = THREE.NodeMaterial & {
|
|
45
|
+
uniforms: TrajectorySphereUniforms;
|
|
46
|
+
};
|
|
47
|
+
export declare function loadTrajectory<T extends Trajectory>(trajectory: T, options: {
|
|
48
|
+
fetcher: Fetcher;
|
|
49
|
+
search?: string;
|
|
50
|
+
renderer?: THREE.WebGPURenderer;
|
|
51
|
+
}): Promise<T>;
|
|
52
|
+
export declare function unloadTrajectory(trajectory: Trajectory): void;
|
|
53
|
+
export {};
|
package/five/texture/loader.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ export declare class TextureLoader {
|
|
|
27
27
|
options?: ImageURLOptions;
|
|
28
28
|
};
|
|
29
29
|
format?: THREE.PixelFormat;
|
|
30
|
+
/**
|
|
31
|
+
* 色彩空间
|
|
32
|
+
* @description 缺省为 `SRGBColorSpace`(颜色贴图)。非颜色数据(如 gainmap)应显式传 `NoColorSpace`,
|
|
33
|
+
* 否则会被当成 sRGB 解码(WebGPU 下会创建 `rgba8unorm-srgb` 做硬件解码)。
|
|
34
|
+
*/
|
|
35
|
+
colorSpace?: THREE.ColorSpace;
|
|
30
36
|
minFilter?: THREE.TextureFilter;
|
|
31
37
|
magFilter?: THREE.TextureFilter;
|
|
32
38
|
generateMipmaps?: boolean;
|
package/five/types/cube.d.ts
CHANGED
package/five/utils/detector.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
declare const userAgent: string;
|
|
2
|
+
declare const isHdrHighDynamicRange: () => boolean;
|
|
2
3
|
/**
|
|
3
4
|
* 是否可以使用 webgl
|
|
4
5
|
*/
|
|
5
6
|
declare const canWebGL: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 是否可以使用 webgpu
|
|
9
|
+
* @description
|
|
10
|
+
* 初始值基于 `navigator.gpu` 是否存在做同步判断,随后通过 `navigator.gpu.requestAdapter()`
|
|
11
|
+
* 异步校正(部分设备/浏览器声明了 `navigator.gpu` 但实际无可用 adapter)。
|
|
12
|
+
* 因此该值在页面刚加载的极短时间内可能还未完成校正,如需强一致的判断请使用 `canWebGPUAsync`。
|
|
13
|
+
*/
|
|
14
|
+
declare let canWebGPU: boolean;
|
|
15
|
+
declare const canWebGPUAsync: Promise<boolean>;
|
|
6
16
|
/**
|
|
7
17
|
* 是否可以 pushState
|
|
8
18
|
*/
|
|
@@ -11,4 +21,4 @@ declare const canPushState: boolean;
|
|
|
11
21
|
* 是否是通过手机访问
|
|
12
22
|
*/
|
|
13
23
|
declare const isMobile: boolean;
|
|
14
|
-
export { userAgent, canWebGL, canPushState, isMobile, };
|
|
24
|
+
export { userAgent, isHdrHighDynamicRange, canWebGL, canWebGPU, canWebGPUAsync, canPushState, isMobile, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toError(error: any): Error;
|
package/five/utils/event.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ export interface BaseEvent {
|
|
|
12
12
|
type: string;
|
|
13
13
|
timeStamp: number;
|
|
14
14
|
preventDefault(): void;
|
|
15
|
-
defaultPrevented: boolean;
|
|
15
|
+
readonly defaultPrevented: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface BaseExtendableEvent extends BaseEvent {
|
|
18
|
+
waitUntil(f: Promise<any>): void;
|
|
16
19
|
}
|
|
17
20
|
export interface IntersectEvent extends BaseEvent {
|
|
18
21
|
object: THREE.Object3D;
|
|
@@ -29,6 +32,17 @@ export interface PanoEvent extends StateEvent {
|
|
|
29
32
|
options: MovePanoOptions;
|
|
30
33
|
error: Error | null;
|
|
31
34
|
}
|
|
35
|
+
/** 全景图准备事件 */
|
|
36
|
+
export interface PanoPrepareEvent extends BaseExtendableEvent {
|
|
37
|
+
/** 切换时选项 */
|
|
38
|
+
options: MovePanoOptions;
|
|
39
|
+
/** 切换前模态 */
|
|
40
|
+
prevMode: Mode;
|
|
41
|
+
/** 切换前的全景图 */
|
|
42
|
+
prevPano: Pano;
|
|
43
|
+
/** 全景图 */
|
|
44
|
+
pano: Pano;
|
|
45
|
+
}
|
|
32
46
|
export interface PanoTextureEvent extends BaseEvent {
|
|
33
47
|
pano: Pano;
|
|
34
48
|
progress: number;
|
|
@@ -157,3 +171,5 @@ export interface NetworkResourceEvent extends BaseEvent {
|
|
|
157
171
|
detail: string;
|
|
158
172
|
}
|
|
159
173
|
export declare function createEvent<T extends BaseEvent = BaseEvent>(type: string, eventArgs: Omit<T, keyof BaseEvent>): T;
|
|
174
|
+
export declare function createExtendableEvent<T extends BaseExtendableEvent = BaseExtendableEvent>(type: string, eventArgs: Omit<T, keyof BaseExtendableEvent>): T;
|
|
175
|
+
export declare function waitForExtendableEvent(event: BaseExtendableEvent): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface GainmapCfgData {
|
|
2
|
+
/** gainmap 最大亮度增益 */
|
|
3
|
+
maxContentBoost: number;
|
|
4
|
+
/** gainmap 最小亮度增益(通常为 1) */
|
|
5
|
+
minContentBoost: number;
|
|
6
|
+
/** 显示器 HDR 容量下限(通常为 1) */
|
|
7
|
+
hdrCapacityMin: number;
|
|
8
|
+
/** 显示器 HDR 容量上限 */
|
|
9
|
+
hdrCapacityMax: number;
|
|
10
|
+
/** gainmap gamma 值 */
|
|
11
|
+
gamma: number;
|
|
12
|
+
/** SDR 偏移,缺省 1/64(UltraHDR 规范) */
|
|
13
|
+
offsetSdr: number;
|
|
14
|
+
/** HDR 偏移,缺省 1/64(UltraHDR 规范) */
|
|
15
|
+
offsetHdr: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `GainmapCfgData` 的默认值(UltraHDR 规范默认值)
|
|
19
|
+
*
|
|
20
|
+
* offset 取规范默认 1/64:编码/解码 offset 必须一致,数据里显式提供时以数据为准
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEFAULT_GAINMAP_CFG_DATA: Readonly<GainmapCfgData>;
|
|
23
|
+
export declare function parseGainmapCfgData(input: unknown): GainmapCfgData;
|
package/five/work/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { parseWork, type ParseOptions, Work, type WorkCubeImage, type WorkImage, type WorkInitial, type WorkModel, type WorkModelLayer, type WorkObserver, type WorkTile, type WorkVideo, } from './work';
|
|
1
|
+
export { parseWork, type ParseOptions, Work, type WorkCubeHdrGainmapImage, type WorkCubeImage, type WorkImage, type WorkInitial, type WorkModel, type WorkModelLayer, type WorkObserver, type WorkTile, type WorkVideo, } from './work';
|
|
2
2
|
export { type WorkInitialJson, type WorkJson, type WorkModelJson, type WorkModelLayerJson, type WorkObserverJson, type WorkPanoramaJson, type WorkPanoramasJson, } from './workJsonType';
|
|
3
3
|
export { workToJson, } from './workJson';
|
|
4
4
|
export { type LoosePanoWork, type LooseWork, type LooseWorkInitial, type LooseWorkModel, type LooseWorkObserver, type LooseWorkPanorama, type LooseWorkVideo, type LooseWorkWithExtrinsics, } from './looseWorkType';
|
package/five/work/work.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as THREE from "three/webgpu";
|
|
|
2
2
|
import type { Mode } from "../application/mode";
|
|
3
3
|
import type { TilesetHeader } from "../model/tile3d/header";
|
|
4
4
|
import type { LooseWork, LoosePanoWork } from "./looseWorkType";
|
|
5
|
-
import { CubeFace
|
|
5
|
+
import { CubeFace } from "../types/cube";
|
|
6
6
|
import type { PanoId } from "../utils/pano";
|
|
7
7
|
/** 全景视频贴片 */
|
|
8
8
|
export interface WorkVideo {
|
|
@@ -14,9 +14,18 @@ export interface WorkVideo {
|
|
|
14
14
|
/** 视频源长宽尺寸 */
|
|
15
15
|
size: THREE.Vector2;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
/** HDR gainmap 六视图 */
|
|
18
|
+
export interface WorkCubeHdrGainmapImage extends Record<CubeFace, string> {
|
|
19
|
+
/** HDR 配置数据地址 */
|
|
20
|
+
cfg: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkCubeImage extends Record<CubeFace, string> {
|
|
18
23
|
work: Work;
|
|
19
|
-
|
|
24
|
+
/**
|
|
25
|
+
* HDR gainmap 六视图 + 配置
|
|
26
|
+
* @description 该点位无 HDR 数据时不存在该字段
|
|
27
|
+
*/
|
|
28
|
+
gainmap?: WorkCubeHdrGainmapImage;
|
|
20
29
|
}
|
|
21
30
|
export interface WorkTile extends WorkCubeImage {
|
|
22
31
|
/** 层级 */
|
|
@@ -183,13 +192,17 @@ export interface Work {
|
|
|
183
192
|
observers: readonly WorkObserver[];
|
|
184
193
|
}
|
|
185
194
|
export declare class Work {
|
|
186
|
-
|
|
195
|
+
observerBox: THREE.Box3;
|
|
196
|
+
readonly jsonp: boolean;
|
|
197
|
+
readonly shortPath: boolean;
|
|
198
|
+
readonly disableGainmap: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated 标准数据不混合 panoHDR 数据。而是直接包含 hdr 标识
|
|
201
|
+
*/
|
|
187
202
|
panoHDR?: {
|
|
188
203
|
baseURL: string;
|
|
189
204
|
manifest: any;
|
|
190
205
|
};
|
|
191
|
-
shortPath: boolean;
|
|
192
|
-
observerBox: THREE.Box3;
|
|
193
206
|
/**
|
|
194
207
|
* 控制参数
|
|
195
208
|
* @deprecated 通过 work.transform 替换
|
|
@@ -231,7 +244,17 @@ export type ParseOptions = {
|
|
|
231
244
|
shortPath?: boolean;
|
|
232
245
|
/** 资源使用 jsonp 方式发布 */
|
|
233
246
|
jsonp?: boolean;
|
|
234
|
-
/**
|
|
247
|
+
/**
|
|
248
|
+
* 不解析 HDR gainmap 数据,点位按「无 HDR」处理
|
|
249
|
+
* @description 显式 `gainmap_*` 字段、`hdr` 标识推导、`panoHDR` 注入的 gainmap 都会被跳过,
|
|
250
|
+
* 因此 `images.gainmap` / `tile.gainmap` 不存在;此时即使 `useHDR` 打开也按 SDR 渲染。
|
|
251
|
+
* 注意:`work.toJSON()` 的 `hdr` 标记由 gainmap 是否存在推导,会一并变为 false。
|
|
252
|
+
*/
|
|
253
|
+
disableGainmap?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* 全景 HDR
|
|
256
|
+
* @deprecated 标准数据不混合 panoHDR 数据。而是直接包含 hdr 标识
|
|
257
|
+
*/
|
|
235
258
|
panoHDR?: {
|
|
236
259
|
baseURL: string;
|
|
237
260
|
manifest: any;
|
|
@@ -58,13 +58,14 @@ export interface WorkPanoramaJson {
|
|
|
58
58
|
loadable?: boolean;
|
|
59
59
|
derived_id?: number;
|
|
60
60
|
derived_id_str?: string;
|
|
61
|
-
size_list: number[];
|
|
62
61
|
up: string;
|
|
63
62
|
down: string;
|
|
64
63
|
right: string;
|
|
65
64
|
left: string;
|
|
66
65
|
front: string;
|
|
67
66
|
back: string;
|
|
67
|
+
size_list: number[];
|
|
68
|
+
hdr?: boolean;
|
|
68
69
|
video?: {
|
|
69
70
|
source: string;
|
|
70
71
|
matrix: number[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as THREE from "three/webgpu";
|
|
2
|
+
/**
|
|
3
|
+
* GLTF 对象
|
|
4
|
+
*/
|
|
5
|
+
declare class GLTFObject extends THREE.Group {
|
|
6
|
+
needsRender: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* mixer 为对应当前对象的动画混合器
|
|
9
|
+
* @description
|
|
10
|
+
* 通过 `gltf.animations` 可以获取动画帧。
|
|
11
|
+
* 通过 `gltf.scene.mixer.clipAction(gltf.animations[0]).play()` 即可播放动画。
|
|
12
|
+
*/
|
|
13
|
+
mixer: THREE.AnimationMixer;
|
|
14
|
+
constructor(rootObject?: THREE.Object3D);
|
|
15
|
+
clone(): this;
|
|
16
|
+
}
|
|
17
|
+
export { GLTFObject };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as THREE from "three/webgpu";
|
|
2
|
+
import type { LoadResultType } from "@realsee/five-webgpu";
|
|
3
|
+
import { GLTFObject } from "./gltf-object";
|
|
4
|
+
/**
|
|
5
|
+
* GLTFLoader 返回数据
|
|
6
|
+
* @description
|
|
7
|
+
* 一般情况下,gltf.scene 为模型对象,直接通过 `five.scene.add(gltf.scene)` 即可添加到场景
|
|
8
|
+
* Five 的模型单位 1 为 1米,载入的模型单位标准不一,请自行 scale。
|
|
9
|
+
* 如果涉及模型内置动画,GLTF 已经帮你封装了,通过 `gltf.animations` 可以获取动画帧。gltf.scene.mixer 为对应的 动画混合器。
|
|
10
|
+
* 通过 `gltf.scene.mixer.clipAction(gltf.animations[0]).play()` 即可播放动画。
|
|
11
|
+
*
|
|
12
|
+
* 数据由 `@realsee/five-webgpu` 的 `loadGltf` 提供,字段与 `LoadResultType` 保持一致。
|
|
13
|
+
* 注意 `loadGltf` 以 `{ modelUpAxis: 'Y', upAxis: 'Y' }` 加载,模型保持 glTF 原始的 Y-up 朝向,不会自动旋转到 Five 的 Z-up 坐标系。
|
|
14
|
+
*/
|
|
15
|
+
interface GLTF extends LoadResultType<GLTFObject> {
|
|
16
|
+
/** 场景列表,本实现中固定为 `[ scene ]` */
|
|
17
|
+
scenes: GLTFObject[];
|
|
18
|
+
/** `loadGltf` 不提供相机信息,该字段仅为兼容旧 API 保留,运行时为 `undefined` */
|
|
19
|
+
cameras?: THREE.Camera[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* GLTF 模型加载器
|
|
23
|
+
* @description
|
|
24
|
+
* 实现基于 `@realsee/five-webgpu` 的 `loadGltf`,因此不再接受 LoadingManager 参数,也不再提供 parse 方法。
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```
|
|
28
|
+
* const gltfLoader = new GLTFLoader();
|
|
29
|
+
* gltfLoader.load("https://vr-public.realsee-cdn.cn/release/static/image/release/five/demo/gltf/plants/scene.gltf", ({ scene }) => {
|
|
30
|
+
* five.scene.add(scene);
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare class GLTFLoader {
|
|
35
|
+
static get version(): string;
|
|
36
|
+
/**
|
|
37
|
+
* 加载模型
|
|
38
|
+
* @param url - 模型 URL
|
|
39
|
+
* @param onLoad - 加载完成回调
|
|
40
|
+
* @param onProgress - 加载进度回调
|
|
41
|
+
* @param onError - 加载错误回调
|
|
42
|
+
*/
|
|
43
|
+
load(url: string, onLoad: (gltf: GLTF) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
|
|
44
|
+
}
|
|
45
|
+
export { GLTFObject, GLTFLoader, GLTF };
|