@hztxi/cesium-engine 25.0.7 → 26.2.1
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/Build/Workers/chunk-2NCNUVAT.js +56 -0
- package/Build/Workers/chunk-2ZYRUVVU.js +301 -0
- package/Build/Workers/chunk-36IU7N4V.js +1284 -0
- package/Build/Workers/chunk-3BDLET5S.js +198 -0
- package/Build/Workers/chunk-3PRHI4KX.js +241 -0
- package/Build/Workers/chunk-3R6E2SH4.js +672 -0
- package/Build/Workers/chunk-3ZKKXEXL.js +415 -0
- package/Build/Workers/chunk-47KVKPTO.js +415 -0
- package/Build/Workers/chunk-4N227IPR.js +973 -0
- package/Build/Workers/chunk-4P6OAPBM.js +97 -0
- package/Build/Workers/chunk-4ZOLEPZK.js +519 -0
- package/Build/Workers/chunk-5EF3WWQG.js +352 -0
- package/Build/Workers/chunk-5I76476T.js +288 -0
- package/Build/Workers/chunk-5PBZKBAP.js +511 -0
- package/Build/Workers/chunk-5RVAAW26.js +82 -0
- package/Build/Workers/chunk-5VWK76PO.js +511 -0
- package/Build/Workers/chunk-77DBX23X.js +455 -0
- package/Build/Workers/chunk-7GQOWCSN.js +959 -0
- package/Build/Workers/chunk-7J2ONMKC.js +198 -0
- package/Build/Workers/chunk-7MHUHXZZ.js +219 -0
- package/Build/Workers/chunk-7MQPHOAS.js +455 -0
- package/Build/Workers/chunk-7NJ5O7TP.js +387 -0
- package/Build/Workers/chunk-7Y642MCO.js +352 -0
- package/Build/Workers/chunk-7ZFKBLUE.js +1054 -0
- package/Build/Workers/chunk-A7LGY5XS.js +140 -0
- package/Build/Workers/chunk-AN2NVYL6.js +1483 -0
- package/Build/Workers/chunk-B7PT2VL5.js +630 -0
- package/Build/Workers/chunk-C6XQGBPV.js +476 -0
- package/Build/Workers/chunk-CAEC5DA2.js +57 -0
- package/Build/Workers/chunk-CBCOHH5O.js +837 -0
- package/Build/Workers/chunk-CEMXKBQO.js +1800 -0
- package/Build/Workers/chunk-CKW3STKA.js +1067 -0
- package/Build/Workers/chunk-CV5RICKT.js +1992 -0
- package/Build/Workers/chunk-DBWSISJT.js +56 -0
- package/Build/Workers/chunk-DSBSPPPJ.js +1344 -0
- package/Build/Workers/chunk-DSGLDRTI.js +278 -0
- package/Build/Workers/chunk-DXD7OPSP.js +1992 -0
- package/Build/Workers/chunk-DXECZBSA.js +368 -0
- package/Build/Workers/chunk-DZIRO6ZK.js +682 -0
- package/Build/Workers/chunk-E4CRPGX5.js +140 -0
- package/Build/Workers/chunk-E4IVMEBH.js +52 -0
- package/Build/Workers/chunk-ECN3VUMA.js +73 -0
- package/Build/Workers/chunk-ECSKVHUB.js +476 -0
- package/Build/Workers/chunk-EL4B5CSQ.js +162 -0
- package/Build/Workers/chunk-FAYBQGKO.js +219 -0
- package/Build/Workers/chunk-FGCXPEZM.js +3201 -0
- package/Build/Workers/chunk-FHCRXPA6.js +44 -0
- package/Build/Workers/chunk-FQ42MT7M.js +58 -0
- package/Build/Workers/chunk-FQDYQG4P.js +1284 -0
- package/Build/Workers/chunk-FTCBY5HH.js +138 -0
- package/Build/Workers/chunk-GI5RWJAY.js +101 -0
- package/Build/Workers/chunk-GNLMSDRO.js +945 -0
- package/Build/Workers/chunk-GVUJ6O3R.js +73 -0
- package/Build/Workers/chunk-HCGU7OCG.js +97 -0
- package/Build/Workers/chunk-HRIPVWSC.js +58 -0
- package/Build/Workers/chunk-IC3BR6SC.js +102 -0
- package/Build/Workers/chunk-IU3YAYPT.js +1344 -0
- package/Build/Workers/chunk-J7MZR7B2.js +1483 -0
- package/Build/Workers/chunk-KSIEJYNL.js +3822 -0
- package/Build/Workers/chunk-KT3GG7AW.js +754 -0
- package/Build/Workers/chunk-KYCEM22I.js +1800 -0
- package/Build/Workers/chunk-LJTQW46H.js +57 -0
- package/Build/Workers/chunk-LMQGYJME.js +672 -0
- package/Build/Workers/chunk-LOBYJQA4.js +76 -0
- package/Build/Workers/chunk-LOF32O7F.js +163 -0
- package/Build/Workers/chunk-LOTIJA7D.js +124 -0
- package/Build/Workers/chunk-M7Z3MPAX.js +973 -0
- package/Build/Workers/chunk-MHNLTQHO.js +3201 -0
- package/Build/Workers/chunk-ML7OMD72.js +2342 -0
- package/Build/Workers/chunk-NBTGXEMT.js +945 -0
- package/Build/Workers/chunk-NQZC37F7.js +38 -0
- package/Build/Workers/chunk-O3X3D2Z3.js +352 -0
- package/Build/Workers/chunk-OBUIHPKF.js +352 -0
- package/Build/Workers/chunk-PAEWNYIV.js +138 -0
- package/Build/Workers/chunk-PANJ7YH6.js +102 -0
- package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
- package/Build/Workers/chunk-PIIUGRQD.js +387 -0
- package/Build/Workers/chunk-POKD22OT.js +2719 -0
- package/Build/Workers/chunk-PQMA7MFS.js +9237 -0
- package/Build/Workers/chunk-PURIPUSY.js +682 -0
- package/Build/Workers/chunk-QQZPPXY4.js +3822 -0
- package/Build/Workers/chunk-QXLQLGL2.js +1067 -0
- package/Build/Workers/chunk-RC4YC3VU.js +278 -0
- package/Build/Workers/chunk-RGNNWVR6.js +171 -0
- package/Build/Workers/chunk-SBBIEHYT.js +44 -0
- package/Build/Workers/chunk-SWVZTU6X.js +305 -0
- package/Build/Workers/chunk-T3EUPM5A.js +454 -0
- package/Build/Workers/chunk-TA6IU2XL.js +171 -0
- package/Build/Workers/chunk-TLSGD5TR.js +280 -0
- package/Build/Workers/chunk-TOXDLWKZ.js +368 -0
- package/Build/Workers/chunk-TZBM6TAB.js +124 -0
- package/Build/Workers/chunk-U2OY6MX6.js +398 -0
- package/Build/Workers/chunk-UCY4B5EV.js +288 -0
- package/Build/Workers/chunk-V52FEPCV.js +754 -0
- package/Build/Workers/chunk-VBEXZBG5.js +147 -0
- package/Build/Workers/chunk-VC76B6GM.js +959 -0
- package/Build/Workers/chunk-VCUOYHWC.js +519 -0
- package/Build/Workers/chunk-VJIL5H6K.js +2719 -0
- package/Build/Workers/chunk-VMF7KOGY.js +162 -0
- package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
- package/Build/Workers/chunk-XHT5SVP4.js +52 -0
- package/Build/Workers/chunk-XITBARMZ.js +2342 -0
- package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
- package/Build/Workers/chunk-XZ6HDXKM.js +76 -0
- package/Build/Workers/chunk-Y7NDFEQ3.js +398 -0
- package/Build/Workers/chunk-YBBQDYX2.js +301 -0
- package/Build/Workers/chunk-YHPYPVAB.js +837 -0
- package/Build/Workers/chunk-YNKK6BXY.js +454 -0
- package/Build/Workers/chunk-YRAJ74HR.js +305 -0
- package/Build/Workers/chunk-YULTZK5O.js +147 -0
- package/Build/Workers/chunk-YUNQYP3Z.js +9237 -0
- package/Build/Workers/chunk-Z7BONRW2.js +241 -0
- package/Build/Workers/chunk-ZK2R3DEJ.js +1054 -0
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +18 -18
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +39 -39
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createCorridorGeometry.js +36 -37
- package/Build/Workers/createCorridorOutlineGeometry.js +34 -35
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -20
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +20 -20
- package/Build/Workers/createGeometry.js +25 -24
- package/Build/Workers/createGroundPolylineGeometry.js +26 -26
- package/Build/Workers/createMvtTile.js +111 -19
- package/Build/Workers/createPlaneGeometry.js +18 -18
- package/Build/Workers/createPlaneOutlineGeometry.js +17 -17
- package/Build/Workers/createPolygonGeometry.js +36 -36
- package/Build/Workers/createPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createPolylineGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeGeometry.js +38 -36
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +32 -31
- package/Build/Workers/createRectangleGeometry.js +29 -29
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -23
- package/Build/Workers/createSimplePolylineGeometry.js +26 -26
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
- package/Build/Workers/createVerticesFromHeightmap.js +23 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
- package/Build/Workers/createWallGeometry.js +26 -26
- package/Build/Workers/createWallOutlineGeometry.js +26 -26
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +993 -2334
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingRectangle.js +6 -8
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/Color.js +1 -0
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/CoplanarPolygonGeometry.js +2 -2
- package/Source/Core/CorridorGeometry.js +2 -4
- package/Source/Core/CorridorOutlineGeometry.js +1 -3
- package/Source/Core/EarthOrientationParameters.js +2 -2
- package/Source/Core/EllipseGeometryLibrary.js +2 -2
- package/Source/Core/EllipsoidGeodesic.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +58 -50
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/JulianDate.js +1 -1
- package/Source/Core/LagrangePolynomialApproximation.js +55 -52
- package/Source/Core/LinearApproximation.js +69 -66
- package/Source/Core/MapProjection.js +1 -0
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +3 -3
- package/Source/Core/Matrix3.js +3 -3
- package/Source/Core/Matrix4.js +1 -1
- package/Source/Core/OrthographicFrustum.js +1 -1
- package/Source/Core/PerspectiveFrustum.js +1 -1
- package/Source/Core/PolygonGeometry.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +180 -168
- package/Source/Core/TimeIntervalCollection.js +1 -3
- package/Source/Core/Tipsify.js +1 -1
- package/Source/Core/Transforms.js +5 -1
- package/Source/Core/VectorPipeline.js +1117 -0
- package/Source/Core/VectorProvider.js +429 -0
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +14 -0
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/GeoJsonDataSource.js +0 -1
- package/Source/DataSources/GeometryVisualizer.js +1 -1
- package/Source/DataSources/KmlDataSource.js +529 -557
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/DataSources/PolylineVisualizer.js +1 -1
- package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
- package/Source/Renderer/AutomaticUniforms.js +23 -0
- package/Source/Renderer/Context.js +9 -3
- package/Source/Renderer/DrawCommand.js +22 -0
- package/Source/Renderer/Framebuffer.js +4 -0
- package/Source/Renderer/Pass.js +11 -9
- package/Source/Renderer/Texture.js +12 -1
- package/Source/Renderer/UniformState.js +7 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +2 -1
- package/Source/Scene/BillboardCollection.js +15 -5
- package/Source/Scene/BillboardTexture.js +5 -3
- package/Source/Scene/BufferPointCollection.js +11 -1
- package/Source/Scene/BufferPolygonCollection.js +26 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +105 -32
- package/Source/Scene/Camera.js +85 -9
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/CameraFlightPath.js +7 -4
- package/Source/Scene/Cesium3DTile.js +102 -4
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/Cesium3DTileStyle.js +40 -0
- package/Source/Scene/Cesium3DTileset.js +213 -8
- package/Source/Scene/Cesium3DTilesetTraversal.js +14 -0
- package/Source/Scene/ClippingPlaneCollection.js +4 -4
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/Controllers/Controller.js +63 -0
- package/Source/Scene/Controllers/ControllerHost.js +78 -0
- package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
- package/Source/Scene/Controllers/MouseButton.js +32 -0
- package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
- package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
- package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
- package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
- package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
- package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
- package/Source/Scene/DerivedCommand.js +98 -0
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/FrameState.js +17 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/Globe.js +22 -1
- package/Source/Scene/GlobeDepth.js +27 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +637 -540
- package/Source/Scene/GlobeSurfaceTile.js +575 -398
- package/Source/Scene/GlobeSurfaceTileProvider.js +1412 -1184
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +146 -3
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SLayer.js +1 -1
- package/Source/Scene/I3SNode.js +2 -2
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +190 -6
- package/Source/Scene/Implicit3DTileContent.js +192 -216
- package/Source/Scene/ImplicitTileCoordinates.js +17 -0
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +4 -1
- package/Source/Scene/MVTDataProvider.js +555 -0
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +82 -312
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- package/Source/Scene/Model/I3dmLoader.js +1 -1
- package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
- package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
- package/Source/Scene/Model/Model.js +45 -10
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelDrawCommand.js +180 -8
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelSceneGraph.js +21 -0
- package/Source/Scene/Model/ModelUtility.js +5 -0
- package/Source/Scene/Model/PickingPipelineStage.js +29 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +645 -153
- package/Source/Scene/ModelComponents.js +112 -0
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/MvtLabelCandidates.js +295 -0
- package/Source/Scene/MvtLabelManager.js +1069 -0
- package/Source/Scene/Picking.js +19 -3
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +1 -1
- package/Source/Scene/PolylineCollection.js +5 -3
- package/Source/Scene/PostProcessStage.js +4 -2
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +21 -18
- package/Source/Scene/Scene.js +237 -11
- package/Source/Scene/SceneTransforms.js +6 -5
- package/Source/Scene/ShadowMap.js +9 -3
- package/Source/Scene/ShadowMapShader.js +50 -2
- package/Source/Scene/SnapFramebuffer.js +121 -0
- package/Source/Scene/Snapping.js +184 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +543 -0
- package/Source/Scene/Vector3DTileContent.js +207 -237
- package/Source/Scene/VectorGltf3DTileContent.js +185 -45
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/buildVectorGltfFromMVT.js +1208 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/decodeMVT.js +877 -0
- package/Source/Scene/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +114 -64
- package/Source/Scene/renderBufferPolygonCollection.js +245 -53
- package/Source/Scene/renderBufferPolylineCollection.js +271 -145
- package/Source/Shaders/BillboardCollectionVS.glsl +23 -25
- package/Source/Shaders/BillboardCollectionVS.js +23 -25
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +13 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +22 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +23 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/GlobeFS.glsl +10 -6
- package/Source/Shaders/GlobeFS.js +10 -6
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
- package/Source/Shaders/Model/MaterialStageFS.js +8 -2
- package/Source/Shaders/Model/ModelFS.glsl +105 -0
- package/Source/Shaders/Model/ModelFS.js +105 -0
- package/Source/Shaders/VectorCommon.glsl +178 -0
- package/Source/Shaders/VectorCommon.js +180 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/Source/Workers/createMvtTile.js +39 -0
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.js +113 -83
- package/package.json +13 -13
package/Source/Scene/Picking.js
CHANGED
|
@@ -247,6 +247,7 @@ const scratchColorZero = new Color(0.0, 0.0, 0.0, 0.0);
|
|
|
247
247
|
* height will default to the value of <code>width</code>
|
|
248
248
|
* @param {BoundingRectangle} result The result rectangle
|
|
249
249
|
* @returns {BoundingRectangle} The result rectangle
|
|
250
|
+
* @ignore
|
|
250
251
|
*/
|
|
251
252
|
function computePickingDrawingBufferRectangle(
|
|
252
253
|
drawingBufferHeight,
|
|
@@ -265,21 +266,31 @@ function computePickingDrawingBufferRectangle(
|
|
|
265
266
|
/**
|
|
266
267
|
* Setup needed before picking.
|
|
267
268
|
*
|
|
269
|
+
* Exported for use by Snapping, which performs the same offscreen pick render
|
|
270
|
+
* but targets the snap framebuffer and flags the pass as a snapping pass.
|
|
271
|
+
*
|
|
268
272
|
* @param {Scene} scene
|
|
269
273
|
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
270
274
|
* @param {BoundingRectangle} drawingBufferRectangle The output drawing buffer recangle.
|
|
271
275
|
* @param {number} [width=3] Width of the pick rectangle.
|
|
272
276
|
* @param {number} [height=3] Height of the pick rectangle.
|
|
277
|
+
* @param {object} [options] Object with the following properties:
|
|
278
|
+
* @param {PickFramebuffer|SnapFramebuffer} [options.framebuffer] The framebuffer to render into. Defaults to the view's pick framebuffer.
|
|
279
|
+
* @param {boolean} [options.snap=false] If <code>true</code>, mark the pass as a snapping pass (sets <code>frameState.passes.snap</code>).
|
|
280
|
+
*
|
|
281
|
+
* @private
|
|
273
282
|
*/
|
|
274
|
-
function pickBegin(
|
|
283
|
+
export function pickBegin(
|
|
275
284
|
scene,
|
|
276
285
|
windowPosition,
|
|
277
286
|
drawingBufferRectangle,
|
|
278
287
|
width,
|
|
279
288
|
height,
|
|
289
|
+
options,
|
|
280
290
|
) {
|
|
281
291
|
const { context, frameState, defaultView } = scene;
|
|
282
292
|
const { viewport, pickFramebuffer } = defaultView;
|
|
293
|
+
const framebuffer = options?.framebuffer ?? pickFramebuffer;
|
|
283
294
|
|
|
284
295
|
scene.view = defaultView;
|
|
285
296
|
|
|
@@ -316,13 +327,14 @@ function pickBegin(
|
|
|
316
327
|
);
|
|
317
328
|
frameState.invertClassification = false;
|
|
318
329
|
frameState.passes.pick = true;
|
|
330
|
+
frameState.passes.snap = options?.snap ?? false;
|
|
319
331
|
frameState.tilesetPassState = pickTilesetPassState;
|
|
320
332
|
|
|
321
333
|
context.uniformState.update(frameState);
|
|
322
334
|
|
|
323
335
|
scene.updateEnvironment();
|
|
324
336
|
|
|
325
|
-
passState =
|
|
337
|
+
passState = framebuffer.begin(drawingBufferRectangle, viewport);
|
|
326
338
|
|
|
327
339
|
scene.updateAndExecuteCommands(passState, scratchColorZero);
|
|
328
340
|
scene.resolveFramebuffers(passState);
|
|
@@ -332,8 +344,10 @@ function pickBegin(
|
|
|
332
344
|
* Teardown needed after picking.
|
|
333
345
|
*
|
|
334
346
|
* @param {Scene} scene
|
|
347
|
+
*
|
|
348
|
+
* @private
|
|
335
349
|
*/
|
|
336
|
-
function pickEnd(scene) {
|
|
350
|
+
export function pickEnd(scene) {
|
|
337
351
|
const { context } = scene;
|
|
338
352
|
context.endFrame();
|
|
339
353
|
}
|
|
@@ -808,6 +822,7 @@ Picking.prototype.pickPosition = function (scene, windowPosition, result) {
|
|
|
808
822
|
* @param {object[]} pickedAttributes
|
|
809
823
|
* @param {object[]} pickedFeatures
|
|
810
824
|
* @returns {boolean} whether picking should end
|
|
825
|
+
* @ignore
|
|
811
826
|
*/
|
|
812
827
|
function addDrillPickedResults(
|
|
813
828
|
pickedResults,
|
|
@@ -875,6 +890,7 @@ function addDrillPickedResults(
|
|
|
875
890
|
* @param {function(number): object[]} pickCallback Pick callback to execute each iteration
|
|
876
891
|
* @param {number} [limit=Number.MAX_VALUE] If supplied, stop drilling after collecting this many picks
|
|
877
892
|
* @returns {object[]} List of picked results
|
|
893
|
+
* @ignore
|
|
878
894
|
*/
|
|
879
895
|
function drillPick(pickCallback, limit) {
|
|
880
896
|
// PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import defined from "../Core/defined.js";
|
|
2
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
3
|
+
import PixelFormat from "../Core/PixelFormat.js";
|
|
4
|
+
import Color from "../Core/Color.js";
|
|
5
|
+
import PixelDatatype from "../Renderer/PixelDatatype.js";
|
|
6
|
+
import FramebufferManager from "../Renderer/FramebufferManager.js";
|
|
7
|
+
import ClearCommand from "../Renderer/ClearCommand.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates and manages a framebuffer for the planar fill feature-ID pre-pass.
|
|
11
|
+
*
|
|
12
|
+
* During this pass, non-behind planar fill geometry writes its per-fragment
|
|
13
|
+
* feature ID into a screen-sized texture. Later, primitives with
|
|
14
|
+
* <code>behind: true</code> (BENTLEY_materials_planar_fill) sample this
|
|
15
|
+
* texture to check whether the pixel they are about to overwrite belongs to
|
|
16
|
+
* the same logical object (same feature ID). Only then do they apply an
|
|
17
|
+
* additional depth offset, pushing the fill behind its own object's edges
|
|
18
|
+
* and non-behind fills — but NOT behind other objects.
|
|
19
|
+
*
|
|
20
|
+
* Layout:
|
|
21
|
+
* Color attachment 0 – R32F (single RED channel): encoded feature ID.
|
|
22
|
+
* Depth-stencil attachment – shared with the main scene for correct depth testing.
|
|
23
|
+
*
|
|
24
|
+
* @alias PlanarFillIdFramebuffer
|
|
25
|
+
* @constructor
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
function PlanarFillIdFramebuffer() {
|
|
29
|
+
this._framebufferManager = new FramebufferManager({
|
|
30
|
+
colorAttachmentsLength: 1,
|
|
31
|
+
createColorAttachments: true,
|
|
32
|
+
depthStencil: true,
|
|
33
|
+
supportsDepthTexture: true,
|
|
34
|
+
color: true,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
this._framebuffer = undefined;
|
|
38
|
+
this._idTexture = undefined;
|
|
39
|
+
this._depthStencilTexture = undefined;
|
|
40
|
+
|
|
41
|
+
this._clearCommand = new ClearCommand({
|
|
42
|
+
color: new Color(0.0, 0.0, 0.0, 0.0),
|
|
43
|
+
depth: 1.0,
|
|
44
|
+
stencil: 0,
|
|
45
|
+
owner: this,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
Object.defineProperties(PlanarFillIdFramebuffer.prototype, {
|
|
50
|
+
/**
|
|
51
|
+
* Gets the underlying framebuffer.
|
|
52
|
+
* @memberof PlanarFillIdFramebuffer.prototype
|
|
53
|
+
* @type {Framebuffer}
|
|
54
|
+
* @readonly
|
|
55
|
+
*/
|
|
56
|
+
framebuffer: {
|
|
57
|
+
get: function () {
|
|
58
|
+
return this._framebuffer;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets the feature-ID texture (color attachment 0).
|
|
64
|
+
* @memberof PlanarFillIdFramebuffer.prototype
|
|
65
|
+
* @type {Texture}
|
|
66
|
+
* @readonly
|
|
67
|
+
*/
|
|
68
|
+
idTexture: {
|
|
69
|
+
get: function () {
|
|
70
|
+
return this._idTexture;
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Gets the depth-stencil texture.
|
|
76
|
+
* @memberof PlanarFillIdFramebuffer.prototype
|
|
77
|
+
* @type {Texture}
|
|
78
|
+
* @readonly
|
|
79
|
+
*/
|
|
80
|
+
depthStencilTexture: {
|
|
81
|
+
get: function () {
|
|
82
|
+
return this._depthStencilTexture;
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Updates (creates / resizes) the framebuffer to match the viewport.
|
|
89
|
+
*
|
|
90
|
+
* @param {Context} context
|
|
91
|
+
* @param {BoundingRectangle} viewport
|
|
92
|
+
* @param {boolean} hdr
|
|
93
|
+
* @returns {boolean} <code>true</code> if the framebuffer was recreated.
|
|
94
|
+
*/
|
|
95
|
+
PlanarFillIdFramebuffer.prototype.update = function (context, viewport, hdr) {
|
|
96
|
+
const width = viewport.width;
|
|
97
|
+
const height = viewport.height;
|
|
98
|
+
|
|
99
|
+
// Feature IDs are integers, so a 32-bit float channel provides plenty of range
|
|
100
|
+
// for feature IDs. A single RED channel (R32F) is used since only one value is
|
|
101
|
+
// stored per pixel. Rendering to R32F requires EXT_color_buffer_float, which is
|
|
102
|
+
// available in WebGL2 on all browsers CesiumJS supports; the UNSIGNED_BYTE fallback
|
|
103
|
+
// below only exists for stubbed WebGL contexts possibly used in tests.
|
|
104
|
+
const pixelDatatype = context.colorBufferFloat
|
|
105
|
+
? PixelDatatype.FLOAT
|
|
106
|
+
: PixelDatatype.UNSIGNED_BYTE;
|
|
107
|
+
|
|
108
|
+
const changed = this._framebufferManager.update(
|
|
109
|
+
context,
|
|
110
|
+
width,
|
|
111
|
+
height,
|
|
112
|
+
1, // no MSAA
|
|
113
|
+
pixelDatatype,
|
|
114
|
+
PixelFormat.RED,
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
if (this._framebufferManager.framebuffer) {
|
|
118
|
+
this._framebuffer = this._framebufferManager.framebuffer;
|
|
119
|
+
this._idTexture = this._framebufferManager.getColorTexture(0);
|
|
120
|
+
this._depthStencilTexture =
|
|
121
|
+
this._framebufferManager.getDepthStencilTexture();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return changed;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Returns a ClearCommand that targets this framebuffer.
|
|
129
|
+
*
|
|
130
|
+
* @param {Color} [clearColor] Override the clear color (default: transparent black).
|
|
131
|
+
* @returns {ClearCommand}
|
|
132
|
+
*/
|
|
133
|
+
PlanarFillIdFramebuffer.prototype.getClearCommand = function (clearColor) {
|
|
134
|
+
this._clearCommand.framebuffer = this._framebuffer;
|
|
135
|
+
if (defined(clearColor)) {
|
|
136
|
+
Color.clone(clearColor, this._clearCommand.color);
|
|
137
|
+
}
|
|
138
|
+
return this._clearCommand;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Releases GPU resources without destroying this object; a later call to
|
|
143
|
+
* {@link PlanarFillIdFramebuffer#update} recreates them.
|
|
144
|
+
*/
|
|
145
|
+
PlanarFillIdFramebuffer.prototype.releaseResources = function () {
|
|
146
|
+
if (!defined(this._framebuffer)) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this._framebufferManager.destroy();
|
|
150
|
+
this._framebuffer = undefined;
|
|
151
|
+
this._idTexture = undefined;
|
|
152
|
+
this._depthStencilTexture = undefined;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @returns {boolean}
|
|
157
|
+
*/
|
|
158
|
+
PlanarFillIdFramebuffer.prototype.isDestroyed = function () {
|
|
159
|
+
return false;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Destroys WebGL resources.
|
|
164
|
+
*/
|
|
165
|
+
PlanarFillIdFramebuffer.prototype.destroy = function () {
|
|
166
|
+
this._framebufferManager =
|
|
167
|
+
this._framebufferManager && this._framebufferManager.destroy();
|
|
168
|
+
this._clearCommand = undefined;
|
|
169
|
+
return destroyObject(this);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export default PlanarFillIdFramebuffer;
|
|
@@ -105,7 +105,6 @@ PntsParser.parse = function (arrayBuffer, byteOffset) {
|
|
|
105
105
|
);
|
|
106
106
|
// Copy the batchTableBinary section and let the underlying ArrayBuffer be freed
|
|
107
107
|
batchTableBinary = new Uint8Array(batchTableBinary);
|
|
108
|
-
byteOffset += batchTableBinaryByteLength;
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
|
|
@@ -214,6 +213,7 @@ PntsParser.parse = function (arrayBuffer, byteOffset) {
|
|
|
214
213
|
* a one-time warning will be printed.
|
|
215
214
|
*
|
|
216
215
|
* @param {object} parsedContent The parsed content
|
|
216
|
+
* @ignore
|
|
217
217
|
*/
|
|
218
218
|
function removeInvalidBinaryBodyReferences(parsedContent) {
|
|
219
219
|
const batchTableJson = parsedContent.batchTableJson;
|
|
@@ -431,7 +431,8 @@ PolylineCollection.prototype.update = function (frameState) {
|
|
|
431
431
|
|
|
432
432
|
const columbusRepeatWorlds =
|
|
433
433
|
frameState.columbusRepeatWorlds === true &&
|
|
434
|
-
frameState.mode === SceneMode.
|
|
434
|
+
(frameState.mode === SceneMode.SCENE2D ||
|
|
435
|
+
frameState.mode === SceneMode.COLUMBUS_VIEW);
|
|
435
436
|
if (this._columbusRepeatWorlds !== columbusRepeatWorlds) {
|
|
436
437
|
// Toggling repeat worlds changes whether polylines are split at the IDL,
|
|
437
438
|
// which changes vertex buffer sizes; rebuild the vertex arrays.
|
|
@@ -1802,10 +1803,11 @@ PolylineBucket.prototype.getSegments = function (polyline, projection) {
|
|
|
1802
1803
|
|
|
1803
1804
|
if (
|
|
1804
1805
|
newPositions.length > 0 &&
|
|
1805
|
-
this.mode === SceneMode.
|
|
1806
|
+
(this.mode === SceneMode.SCENE2D ||
|
|
1807
|
+
this.mode === SceneMode.COLUMBUS_VIEW) &&
|
|
1806
1808
|
polyline._polylineCollection._columbusRepeatWorlds === true
|
|
1807
1809
|
) {
|
|
1808
|
-
//
|
|
1810
|
+
// Repeat worlds: the IDL split is disabled in this mode, so lift
|
|
1809
1811
|
// consecutive projected u values onto the same world copy. The line stays
|
|
1810
1812
|
// in the primary world; the scene renders the visible world copies by
|
|
1811
1813
|
// shifting the camera, so a line crossing the seam needs no per-copy
|
|
@@ -640,8 +640,10 @@ function createStageOutputTextureFunction(stage, name) {
|
|
|
640
640
|
function updateUniformTextures(stage, context) {
|
|
641
641
|
const texturesToRelease = stage._texturesToRelease;
|
|
642
642
|
for (let i = 0; i < texturesToRelease.length; ++i) {
|
|
643
|
-
|
|
644
|
-
|
|
643
|
+
const texture = texturesToRelease[i];
|
|
644
|
+
if (defined(texture)) {
|
|
645
|
+
texture.destroy();
|
|
646
|
+
}
|
|
645
647
|
}
|
|
646
648
|
texturesToRelease.length = 0;
|
|
647
649
|
|
|
@@ -1781,11 +1781,12 @@ function updateHeights(primitive, frameState) {
|
|
|
1781
1781
|
);
|
|
1782
1782
|
|
|
1783
1783
|
if (defined(position)) {
|
|
1784
|
-
//
|
|
1784
|
+
// `pick` wrote into the module-level `scratchPosition`, so `position`
|
|
1785
|
+
// aliases it — clone before caching or the next pick mutates every entry.
|
|
1785
1786
|
tile.setPositionCacheEntry(
|
|
1786
1787
|
data.positionCartographic,
|
|
1787
1788
|
primitive.maximumScreenSpaceError,
|
|
1788
|
-
position,
|
|
1789
|
+
Cartesian3.clone(position),
|
|
1789
1790
|
);
|
|
1790
1791
|
}
|
|
1791
1792
|
}
|
|
@@ -419,7 +419,7 @@ ResourceCache.getSpzLoader = function (options) {
|
|
|
419
419
|
|
|
420
420
|
const cacheKey = ResourceCacheKey.getSpzCacheKey({
|
|
421
421
|
gltf: gltf,
|
|
422
|
-
|
|
422
|
+
spz: spz,
|
|
423
423
|
gltfResource: gltfResource,
|
|
424
424
|
baseResource: baseResource,
|
|
425
425
|
});
|
|
@@ -453,13 +453,14 @@ ResourceCache.getSpzLoader = function (options) {
|
|
|
453
453
|
* @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
|
|
454
454
|
* @param {object} [options.primitive] The primitive containing the Draco extension.
|
|
455
455
|
* @param {object} [options.draco] The Draco extension object.
|
|
456
|
+
* @param {object} [options.spz] The SPZ extension object.
|
|
456
457
|
* @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
|
|
457
458
|
* @param {number} [options.accessorId] The accessor ID.
|
|
458
459
|
* @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.
|
|
459
460
|
* @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.
|
|
460
461
|
* @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
|
|
461
462
|
* @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
|
|
462
|
-
* @exception {DeveloperError}
|
|
463
|
+
* @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
|
|
463
464
|
* @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
|
|
464
465
|
* @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.
|
|
465
466
|
*
|
|
@@ -503,9 +504,11 @@ ResourceCache.getVertexBufferLoader = function (options) {
|
|
|
503
504
|
const hasAccessorId = defined(accessorId);
|
|
504
505
|
const hasSpz = defined(spz);
|
|
505
506
|
|
|
506
|
-
|
|
507
|
+
const sourceCount =
|
|
508
|
+
Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
|
|
509
|
+
if (sourceCount !== 1) {
|
|
507
510
|
throw new DeveloperError(
|
|
508
|
-
"
|
|
511
|
+
"Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
|
|
509
512
|
);
|
|
510
513
|
}
|
|
511
514
|
|
|
@@ -3,8 +3,8 @@ import Frozen from "../Core/Frozen.js";
|
|
|
3
3
|
import defined from "../Core/defined.js";
|
|
4
4
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
5
5
|
import getAbsoluteUri from "../Core/getAbsoluteUri.js";
|
|
6
|
+
import findMeshoptExtension from "./findMeshoptExtension.js";
|
|
6
7
|
import GltfLoaderUtil from "./GltfLoaderUtil.js";
|
|
7
|
-
import hasExtension from "./hasExtension.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Compute cache keys for resources in {@link ResourceCache}.
|
|
@@ -22,8 +22,8 @@ function getExternalResourceCacheKey(resource) {
|
|
|
22
22
|
function getBufferViewCacheKey(bufferView) {
|
|
23
23
|
let { byteOffset, byteLength } = bufferView;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const meshopt = findMeshoptExtension(bufferView);
|
|
26
|
+
if (defined(meshopt)) {
|
|
27
27
|
byteOffset = meshopt.byteOffset ?? 0;
|
|
28
28
|
byteLength = meshopt.byteLength;
|
|
29
29
|
}
|
|
@@ -71,8 +71,8 @@ function getDracoCacheKey(gltf, draco, gltfResource, baseResource) {
|
|
|
71
71
|
return `${bufferCacheKey}-range-${bufferViewCacheKey}`;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function getSpzCacheKey(gltf,
|
|
75
|
-
const bufferViewId =
|
|
74
|
+
function getSpzCacheKey(gltf, spz, gltfResource, baseResource) {
|
|
75
|
+
const bufferViewId = spz.bufferView;
|
|
76
76
|
const bufferView = gltf.bufferViews[bufferViewId];
|
|
77
77
|
const bufferId = bufferView.buffer;
|
|
78
78
|
const buffer = gltf.buffers[bufferId];
|
|
@@ -247,8 +247,8 @@ ResourceCacheKey.getBufferViewCacheKey = function (options) {
|
|
|
247
247
|
const bufferView = gltf.bufferViews[bufferViewId];
|
|
248
248
|
let bufferId = bufferView.buffer;
|
|
249
249
|
const buffer = gltf.buffers[bufferId];
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
const meshopt = findMeshoptExtension(bufferView);
|
|
251
|
+
if (defined(meshopt)) {
|
|
252
252
|
bufferId = meshopt.buffer;
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -292,16 +292,16 @@ ResourceCacheKey.getDracoCacheKey = function (options) {
|
|
|
292
292
|
|
|
293
293
|
ResourceCacheKey.getSpzCacheKey = function (options) {
|
|
294
294
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
295
|
-
const { gltf,
|
|
295
|
+
const { gltf, spz, gltfResource, baseResource } = options;
|
|
296
296
|
|
|
297
297
|
//>>includeStart('debug', pragmas.debug);
|
|
298
298
|
Check.typeOf.object("options.gltf", gltf);
|
|
299
|
-
Check.typeOf.object("options.
|
|
299
|
+
Check.typeOf.object("options.spz", spz);
|
|
300
300
|
Check.typeOf.object("options.gltfResource", gltfResource);
|
|
301
301
|
Check.typeOf.object("options.baseResource", baseResource);
|
|
302
302
|
//>>includeEnd('debug');
|
|
303
303
|
|
|
304
|
-
return `spz:${getSpzCacheKey(gltf,
|
|
304
|
+
return `spz:${getSpzCacheKey(gltf, spz, gltfResource, baseResource)}`;
|
|
305
305
|
};
|
|
306
306
|
/**
|
|
307
307
|
* Gets the vertex buffer cache key.
|
|
@@ -313,11 +313,12 @@ ResourceCacheKey.getSpzCacheKey = function (options) {
|
|
|
313
313
|
* @param {FrameState} options.frameState The frame state.
|
|
314
314
|
* @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
|
|
315
315
|
* @param {object} [options.draco] The Draco extension object.
|
|
316
|
+
* @param {object} [options.spz] The SPZ extension object.
|
|
316
317
|
* @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
|
|
317
318
|
* @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.
|
|
318
319
|
* @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
|
|
319
320
|
* @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
|
|
320
|
-
* @exception {DeveloperError}
|
|
321
|
+
* @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
|
|
321
322
|
* @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
|
|
322
323
|
*
|
|
323
324
|
* @returns {string} The vertex buffer cache key.
|
|
@@ -350,9 +351,11 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
|
|
|
350
351
|
const hasAttributeSemantic = defined(attributeSemantic);
|
|
351
352
|
const hasSpz = defined(spz);
|
|
352
353
|
|
|
353
|
-
|
|
354
|
+
const sourceCount =
|
|
355
|
+
Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
|
|
356
|
+
if (sourceCount !== 1) {
|
|
354
357
|
throw new DeveloperError(
|
|
355
|
-
"
|
|
358
|
+
"Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
|
|
356
359
|
);
|
|
357
360
|
}
|
|
358
361
|
|
|
@@ -388,6 +391,11 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
|
|
|
388
391
|
cacheKeySuffix += "-typed-array";
|
|
389
392
|
}
|
|
390
393
|
|
|
394
|
+
if (defined(spz)) {
|
|
395
|
+
const spzCacheKey = getSpzCacheKey(gltf, spz, gltfResource, baseResource);
|
|
396
|
+
return `vertex-buffer:${spzCacheKey}-spz-${attributeSemantic}${cacheKeySuffix}`;
|
|
397
|
+
}
|
|
398
|
+
|
|
391
399
|
if (defined(draco)) {
|
|
392
400
|
const dracoCacheKey = getDracoCacheKey(
|
|
393
401
|
gltf,
|
|
@@ -398,11 +406,6 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
|
|
|
398
406
|
return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`;
|
|
399
407
|
}
|
|
400
408
|
|
|
401
|
-
if (spz) {
|
|
402
|
-
const spzCacheKey = getSpzCacheKey(gltf, spz, gltfResource, baseResource);
|
|
403
|
-
return `vertex-buffer:${spzCacheKey}-spz-${attributeSemantic}${cacheKeySuffix}`;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
409
|
const bufferView = gltf.bufferViews[bufferViewId];
|
|
407
410
|
const bufferId = bufferView.buffer;
|
|
408
411
|
const buffer = gltf.buffers[bufferId];
|