@cesium/engine 26.2.0 → 26.3.1-wasm.0
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/ThirdParty/Workers/zip-web-worker.js +707 -600
- package/Build/Workers/chunk-2P3WKV6V.js +290 -0
- package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
- package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
- package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
- package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
- package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
- package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
- package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
- package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
- package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
- package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
- package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
- package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
- package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
- package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
- package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
- package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
- package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
- package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
- package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
- package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
- package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
- package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
- package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
- package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
- package/Build/Workers/chunk-NYKURYFR.js +2131 -0
- package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
- package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
- package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
- package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
- package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
- package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
- package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
- package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
- package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
- package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
- package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
- package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
- package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
- package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
- package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
- package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
- package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
- package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
- package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
- package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
- package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
- package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
- package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
- package/Build/Workers/chunk-YUICDZKO.js +2660 -0
- package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
- package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
- package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
- package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
- package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
- package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +20 -19
- package/Build/Workers/createCircleGeometry.js +28 -27
- package/Build/Workers/createCircleOutlineGeometry.js +21 -20
- package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
- package/Build/Workers/createCorridorGeometry.js +31 -31
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
- 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 +18 -18
- package/Build/Workers/createGeometry.js +27 -26
- package/Build/Workers/createGroundPolylineGeometry.js +27 -26
- package/Build/Workers/createPlaneGeometry.js +18 -17
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +35 -35
- package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
- package/Build/Workers/createPolylineGeometry.js +28 -29
- package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
- package/Build/Workers/createRectangleGeometry.js +30 -30
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
- package/Build/Workers/createSimplePolylineGeometry.js +26 -27
- 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 +17 -16
- 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 +17 -16
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
- package/Build/Workers/createVerticesFromHeightmap.js +24 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +27 -28
- package/Build/Workers/createWallOutlineGeometry.js +26 -27
- package/Build/Workers/decodeDraco.js +16 -12
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
- package/Build/Workers/decodeI3S.js +17 -12
- package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
- package/Build/Workers/decodeSpz.js +1960 -0
- package/Build/Workers/gaussianSplatSorter.js +13 -6
- package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
- package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
- package/Build/Workers/transcodeKTX2.js +26 -12
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +5 -0
- package/Source/Core/IonSnapGeometryType.js +59 -0
- package/Source/Core/IonSnapHeat.js +33 -0
- package/Source/Core/IonSnapMode.js +45 -0
- package/Source/Core/IonSnapParentGeometryType.js +52 -0
- package/Source/Core/IonSnapService.js +369 -0
- package/Source/Core/KTX2Transcoder.js +99 -5
- package/Source/Core/Resource.js +2 -0
- package/Source/Core/SnapService.js +63 -0
- package/Source/Core/TaskProcessor.js +249 -129
- package/Source/Core/TrustedServers.js +34 -1
- package/Source/Core/VectorPipeline.js +139 -45
- package/Source/Core/VectorProvider.js +311 -71
- package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
- package/Source/Core/fetchWebAssemblyBinary.js +52 -0
- package/Source/Renderer/AutomaticUniforms.js +44 -2
- package/Source/Renderer/ShaderBuilder.js +1 -1
- package/Source/Renderer/UniformState.js +47 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BufferPointCollection.js +4 -7
- package/Source/Scene/BufferPolygonCollection.js +56 -27
- package/Source/Scene/BufferPolylineCollection.js +61 -8
- package/Source/Scene/BufferPolylineMaterial.js +6 -5
- package/Source/Scene/BufferPrimitiveCollection.js +199 -29
- package/Source/Scene/Cesium3DTile.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +61 -8
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
- package/Source/Scene/Cesium3DTilesetCache.js +15 -0
- package/Source/Scene/ClippingPolygon.js +154 -100
- package/Source/Scene/ClippingPolygonCollection.js +352 -694
- package/Source/Scene/CreditDisplay.js +62 -0
- package/Source/Scene/GaussianSplatPrimitive.js +153 -66
- package/Source/Scene/GeoJsonPrimitive.js +114 -24
- package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
- package/Source/Scene/GlobeSurfaceTile.js +14 -1
- package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
- package/Source/Scene/GltfBufferViewLoader.js +25 -13
- package/Source/Scene/GltfLoader.js +56 -6
- package/Source/Scene/GltfSpzLoader.js +5 -4
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/MVTDataProvider.js +9 -0
- package/Source/Scene/Model/Model.js +242 -16
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
- package/Source/Scene/Model/ModelRenderResources.js +2 -3
- package/Source/Scene/Model/ModelSceneGraph.js +10 -1
- package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
- package/Source/Scene/Model/PickingPipelineStage.js +4 -0
- package/Source/Scene/PostProcessStage.js +22 -3
- package/Source/Scene/Scene.js +56 -1
- package/Source/Scene/Snapping.js +57 -0
- package/Source/Scene/SpzDecoder.js +106 -0
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
- package/Source/Scene/VectorGltf3DTileContent.js +10 -2
- package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
- package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
- package/Source/Scene/renderBufferPolylineCollection.js +5 -1
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
- package/Source/Shaders/GlobeFS.glsl +10 -9
- package/Source/Shaders/GlobeFS.js +11 -9
- package/Source/Shaders/GlobeVS.glsl +0 -32
- package/Source/Shaders/GlobeVS.js +0 -32
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
- package/Source/Shaders/Model/ModelFS.glsl +4 -0
- package/Source/Shaders/Model/ModelFS.js +4 -0
- package/Source/Shaders/Model/ModelVS.glsl +7 -2
- package/Source/Shaders/Model/ModelVS.js +7 -2
- package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
- package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
- package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
- package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
- package/Source/Shaders/VectorCommon.glsl +177 -50
- package/Source/Shaders/VectorCommon.js +251 -19
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createTaskProcessorWorker.js +2 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
- package/Source/Workers/decodeDraco.js +7 -3
- package/Source/Workers/decodeI3S.js +7 -3
- package/Source/Workers/decodeMeshopt.js +21 -0
- package/Source/Workers/decodeSpz.js +20 -0
- package/Source/Workers/gaussianSplatSorter.js +7 -3
- package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
- package/Source/Workers/transcodeKTX2.js +22 -5
- package/index.d.ts +649 -55
- package/index.js +23 -13
- package/package.json +6 -6
- package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
- package/Build/Workers/chunk-2H5264K7.js +0 -1284
- package/Build/Workers/chunk-2H73KDBM.js +0 -511
- package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
- package/Build/Workers/chunk-36NI5E6W.js +0 -3820
- package/Build/Workers/chunk-37SW7SYS.js +0 -778
- package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
- package/Build/Workers/chunk-3LB4UVPU.js +0 -387
- package/Build/Workers/chunk-3PONLKEL.js +0 -778
- package/Build/Workers/chunk-3QR662HH.js +0 -3820
- package/Build/Workers/chunk-3SX2WYSO.js +0 -973
- package/Build/Workers/chunk-3UDN6LYX.js +0 -476
- package/Build/Workers/chunk-47MCBSXI.js +0 -9237
- package/Build/Workers/chunk-4E626OCE.js +0 -1067
- package/Build/Workers/chunk-4NW2MJKH.js +0 -455
- package/Build/Workers/chunk-52YK5BSN.js +0 -198
- package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
- package/Build/Workers/chunk-5YPQBFRD.js +0 -519
- package/Build/Workers/chunk-6FHT43QR.js +0 -140
- package/Build/Workers/chunk-6HK6IXK2.js +0 -138
- package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
- package/Build/Workers/chunk-7A2OGDHT.js +0 -305
- package/Build/Workers/chunk-7CGEQUM2.js +0 -305
- package/Build/Workers/chunk-7D2HZKH7.js +0 -455
- package/Build/Workers/chunk-7I325HV6.js +0 -1344
- package/Build/Workers/chunk-7KVKHY7O.js +0 -147
- package/Build/Workers/chunk-7TKLTCZW.js +0 -219
- package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
- package/Build/Workers/chunk-7W6DUHAB.js +0 -693
- package/Build/Workers/chunk-7XM5JK5F.js +0 -162
- package/Build/Workers/chunk-7YG3ND3P.js +0 -454
- package/Build/Workers/chunk-A3O6EDBK.js +0 -73
- package/Build/Workers/chunk-A6X24AZI.js +0 -1992
- package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
- package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
- package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
- package/Build/Workers/chunk-AHWAZRBV.js +0 -82
- package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
- package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
- package/Build/Workers/chunk-BKPQFCXH.js +0 -511
- package/Build/Workers/chunk-BSPCI2LO.js +0 -959
- package/Build/Workers/chunk-BUJWSX5S.js +0 -301
- package/Build/Workers/chunk-C7JQVRLM.js +0 -497
- package/Build/Workers/chunk-C7QDUNI3.js +0 -138
- package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
- package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
- package/Build/Workers/chunk-CLCTQVVL.js +0 -241
- package/Build/Workers/chunk-CQNFIAZU.js +0 -56
- package/Build/Workers/chunk-DBD5WWG2.js +0 -959
- package/Build/Workers/chunk-DZBQUULR.js +0 -138
- package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
- package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
- package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
- package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
- package/Build/Workers/chunk-ELE6SC2C.js +0 -837
- package/Build/Workers/chunk-ENNFMWDW.js +0 -789
- package/Build/Workers/chunk-EOWDZN5S.js +0 -288
- package/Build/Workers/chunk-ERKUET22.js +0 -3201
- package/Build/Workers/chunk-F2IMBMZY.js +0 -241
- package/Build/Workers/chunk-F4CSNRZO.js +0 -219
- package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
- package/Build/Workers/chunk-FDK4K5IA.js +0 -280
- package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
- package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
- package/Build/Workers/chunk-FQ42MT7M.js +0 -58
- package/Build/Workers/chunk-GGNWQWSB.js +0 -301
- package/Build/Workers/chunk-GNKXEN4C.js +0 -682
- package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
- package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
- package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
- package/Build/Workers/chunk-H2WCFXLP.js +0 -241
- package/Build/Workers/chunk-HHV3MCGV.js +0 -162
- package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
- package/Build/Workers/chunk-HS6AD4P2.js +0 -398
- package/Build/Workers/chunk-HT6FASOT.js +0 -973
- package/Build/Workers/chunk-IDVHUDZT.js +0 -352
- package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
- package/Build/Workers/chunk-ILME5BXA.js +0 -301
- package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
- package/Build/Workers/chunk-IUIFLOYO.js +0 -44
- package/Build/Workers/chunk-J73T2VOY.js +0 -171
- package/Build/Workers/chunk-JALGQYDY.js +0 -288
- package/Build/Workers/chunk-JW6OZT4R.js +0 -288
- package/Build/Workers/chunk-JXYLJCTC.js +0 -124
- package/Build/Workers/chunk-K27QOAW6.js +0 -97
- package/Build/Workers/chunk-KMV25A63.js +0 -789
- package/Build/Workers/chunk-KZWFWJML.js +0 -2719
- package/Build/Workers/chunk-LCXRRALY.js +0 -387
- package/Build/Workers/chunk-LD64RPYV.js +0 -368
- package/Build/Workers/chunk-LGNDTZVX.js +0 -97
- package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
- package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
- package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
- package/Build/Workers/chunk-MEENMEAH.js +0 -198
- package/Build/Workers/chunk-NAWU5RF4.js +0 -162
- package/Build/Workers/chunk-NIWITKQK.js +0 -693
- package/Build/Workers/chunk-OA6MYL2C.js +0 -837
- package/Build/Workers/chunk-OBEU25PI.js +0 -1067
- package/Build/Workers/chunk-OHP4ELS7.js +0 -198
- package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
- package/Build/Workers/chunk-PD4GK4EM.js +0 -57
- package/Build/Workers/chunk-PEDU33QG.js +0 -2342
- package/Build/Workers/chunk-PVTSNNVI.js +0 -288
- package/Build/Workers/chunk-QHPZH22L.js +0 -241
- package/Build/Workers/chunk-QIZDWZK6.js +0 -301
- package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
- package/Build/Workers/chunk-QVLAFFJY.js +0 -56
- package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
- package/Build/Workers/chunk-R4K7EHOU.js +0 -171
- package/Build/Workers/chunk-R7JGHDD6.js +0 -789
- package/Build/Workers/chunk-RASQEYD4.js +0 -1483
- package/Build/Workers/chunk-RG4F5R57.js +0 -454
- package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
- package/Build/Workers/chunk-RYSQVJR6.js +0 -398
- package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
- package/Build/Workers/chunk-SDFHDNS4.js +0 -147
- package/Build/Workers/chunk-SF6K72D7.js +0 -124
- package/Build/Workers/chunk-SGRGNDOD.js +0 -682
- package/Build/Workers/chunk-SM2CDCYF.js +0 -198
- package/Build/Workers/chunk-SS5ABQGY.js +0 -102
- package/Build/Workers/chunk-T5QBPLE3.js +0 -414
- package/Build/Workers/chunk-TN35HP5B.js +0 -1067
- package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
- package/Build/Workers/chunk-TOAF47AQ.js +0 -102
- package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
- package/Build/Workers/chunk-TSDSILQB.js +0 -124
- package/Build/Workers/chunk-TVZD72WJ.js +0 -778
- package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
- package/Build/Workers/chunk-UEY73NRN.js +0 -38
- package/Build/Workers/chunk-UF46SZEZ.js +0 -789
- package/Build/Workers/chunk-UNRTMCET.js +0 -398
- package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
- package/Build/Workers/chunk-UVO6COT2.js +0 -352
- package/Build/Workers/chunk-V46YGZE6.js +0 -352
- package/Build/Workers/chunk-VAL7DYNR.js +0 -278
- package/Build/Workers/chunk-VDGOCROW.js +0 -57
- package/Build/Workers/chunk-VFWSSBPT.js +0 -511
- package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
- package/Build/Workers/chunk-VXWHPYQM.js +0 -837
- package/Build/Workers/chunk-VXYUBRSB.js +0 -219
- package/Build/Workers/chunk-VZLDLEWI.js +0 -387
- package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
- package/Build/Workers/chunk-WBSY7HDY.js +0 -837
- package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
- package/Build/Workers/chunk-WPRUWXGV.js +0 -693
- package/Build/Workers/chunk-WTO2ERBP.js +0 -414
- package/Build/Workers/chunk-WVHMDVG4.js +0 -959
- package/Build/Workers/chunk-XGA23TAX.js +0 -73
- package/Build/Workers/chunk-XLQZNQ4Z.js +0 -163
- package/Build/Workers/chunk-XLXSDIP5.js +0 -973
- package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
- package/Build/Workers/chunk-XQH66YJC.js +0 -147
- package/Build/Workers/chunk-XTA7BXJG.js +0 -682
- package/Build/Workers/chunk-XTIDAFRS.js +0 -476
- package/Build/Workers/chunk-XUEDWBUD.js +0 -682
- package/Build/Workers/chunk-XYFLRH3H.js +0 -124
- package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
- package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
- package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
- package/Build/Workers/chunk-YEYOSTJX.js +0 -219
- package/Build/Workers/chunk-YGFVAGYF.js +0 -630
- package/Build/Workers/chunk-YIIACKQO.js +0 -368
- package/Build/Workers/chunk-YJGSP6PE.js +0 -511
- package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
- package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
- package/Build/Workers/chunk-Z66EVE2A.js +0 -44
- package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
- package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
- package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
- package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
- package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
- package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
- package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
- package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
|
@@ -14,6 +14,7 @@ import ModelArticulation from "./ModelArticulation.js";
|
|
|
14
14
|
import ModelColorPipelineStage from "./ModelColorPipelineStage.js";
|
|
15
15
|
import ModelClippingPlanesPipelineStage from "./ModelClippingPlanesPipelineStage.js";
|
|
16
16
|
import ModelClippingPolygonsPipelineStage from "./ModelClippingPolygonsPipelineStage.js";
|
|
17
|
+
import ModelVectorLookupPipelineStage from "./ModelVectorLookupPipelineStage.js";
|
|
17
18
|
import ModelNode from "./ModelNode.js";
|
|
18
19
|
import ModelRuntimeNode from "./ModelRuntimeNode.js";
|
|
19
20
|
import ModelRuntimePrimitive from "./ModelRuntimePrimitive.js";
|
|
@@ -735,10 +736,18 @@ ModelSceneGraph.prototype.configurePipeline = function (frameState) {
|
|
|
735
736
|
modelPipelineStages.push(ModelClippingPlanesPipelineStage);
|
|
736
737
|
}
|
|
737
738
|
|
|
738
|
-
if
|
|
739
|
+
// Even if a model has a clipping polygon collection, the polygons may not overlap the model geometry,
|
|
740
|
+
// in which case the clipping polygon pipeline stage should not be added.
|
|
741
|
+
const hasClippingPolygonGeometry =
|
|
742
|
+
(model._clippingPolygonData?.polygonRings.length ?? 0) > 0;
|
|
743
|
+
if (model.isClippingPolygonsEnabled() && hasClippingPolygonGeometry) {
|
|
739
744
|
modelPipelineStages.push(ModelClippingPolygonsPipelineStage);
|
|
740
745
|
}
|
|
741
746
|
|
|
747
|
+
if (model.hasDrapedVectors()) {
|
|
748
|
+
modelPipelineStages.push(ModelVectorLookupPipelineStage);
|
|
749
|
+
}
|
|
750
|
+
|
|
742
751
|
if (model.hasSilhouette(frameState)) {
|
|
743
752
|
modelPipelineStages.push(ModelSilhouettePipelineStage);
|
|
744
753
|
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import Cartesian2 from "../../Core/Cartesian2.js";
|
|
4
|
+
import combine from "../../Core/combine.js";
|
|
5
|
+
import CesiumMath from "../../Core/Math.js";
|
|
6
|
+
import ShaderDestination from "../../Renderer/ShaderDestination.js";
|
|
7
|
+
import VectorCommon from "../../Shaders/VectorCommon.js";
|
|
8
|
+
import ModelVectorLookupStageVS from "../../Shaders/Model/ModelVectorLookupStageVS.js";
|
|
9
|
+
import ModelVectorLookupStageFS from "../../Shaders/Model/ModelVectorLookupStageFS.js";
|
|
10
|
+
|
|
11
|
+
/** @import FrameState from "../FrameState.js"; */
|
|
12
|
+
/** @import Model from "./Model.js"; */
|
|
13
|
+
/** @import ModelRenderResources from "./ModelRenderResources.js"; */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The model vector lookup stage drapes vector data, baked into
|
|
17
|
+
* per-content lookup textures by the scene's VectorProvider, onto the model's
|
|
18
|
+
* surface.
|
|
19
|
+
*
|
|
20
|
+
* @namespace ModelVectorLookupPipelineStage
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
const ModelVectorLookupPipelineStage = {
|
|
25
|
+
name: "ModelVectorLookupPipelineStage", // Helps with debugging
|
|
26
|
+
process: process,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const scratchCameraUv = new Cartesian2();
|
|
30
|
+
const scratchRectangleInverseSize = new Cartesian2();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Processes a model with baked vector lookup data. This modifies the
|
|
34
|
+
* following parts of the render resources:
|
|
35
|
+
*
|
|
36
|
+
* <ul>
|
|
37
|
+
* <li>adds the HAS_VECTOR_LOOKUP define to both shaders</li>
|
|
38
|
+
* <li>adds a vertex shader function computing the vertex's UV within the baked rectangle</li>
|
|
39
|
+
* <li>adds the shared vector lookup functions and a compositing function to the fragment shader</li>
|
|
40
|
+
* <li>adds the uniforms for the baked rectangle and the lookup textures</li>
|
|
41
|
+
* </ul>
|
|
42
|
+
*
|
|
43
|
+
* @param {ModelRenderResources} renderResources The render resources for this model.
|
|
44
|
+
* @param {Model} model The model.
|
|
45
|
+
* @param {FrameState} frameState The frameState.
|
|
46
|
+
*
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
function process(renderResources, model, frameState) {
|
|
50
|
+
const shaderBuilder = renderResources.shaderBuilder;
|
|
51
|
+
const vectorData = model._vectorData;
|
|
52
|
+
const hasPolylines = vectorData.hasPolylines;
|
|
53
|
+
const hasPolygons = vectorData.hasPolygons;
|
|
54
|
+
|
|
55
|
+
shaderBuilder.addDefine(
|
|
56
|
+
"HAS_VECTOR_LOOKUP",
|
|
57
|
+
undefined,
|
|
58
|
+
ShaderDestination.BOTH,
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
if (hasPolylines) {
|
|
62
|
+
shaderBuilder.addDefine(
|
|
63
|
+
"HAS_VECTOR_POLYLINES",
|
|
64
|
+
undefined,
|
|
65
|
+
ShaderDestination.FRAGMENT,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
if (vectorData.hasMeterWidths) {
|
|
69
|
+
shaderBuilder.addDefine(
|
|
70
|
+
"VECTOR_WIDTH_IN_METERS",
|
|
71
|
+
undefined,
|
|
72
|
+
ShaderDestination.FRAGMENT,
|
|
73
|
+
);
|
|
74
|
+
if (vectorData.hasPixelWidths) {
|
|
75
|
+
shaderBuilder.addDefine(
|
|
76
|
+
"VECTOR_WIDTH_MIXED_UNITS",
|
|
77
|
+
undefined,
|
|
78
|
+
ShaderDestination.FRAGMENT,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
shaderBuilder.addUniform(
|
|
82
|
+
"vec2",
|
|
83
|
+
"u_vectorMetersPerUv",
|
|
84
|
+
ShaderDestination.FRAGMENT,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (hasPolygons) {
|
|
90
|
+
shaderBuilder.addDefine(
|
|
91
|
+
"HAS_VECTOR_POLYGONS",
|
|
92
|
+
undefined,
|
|
93
|
+
ShaderDestination.FRAGMENT,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
shaderBuilder.addUniform(
|
|
98
|
+
"vec2",
|
|
99
|
+
"u_vectorCameraUv",
|
|
100
|
+
ShaderDestination.VERTEX,
|
|
101
|
+
);
|
|
102
|
+
shaderBuilder.addUniform(
|
|
103
|
+
"vec2",
|
|
104
|
+
"u_vectorRectangleInverseSize",
|
|
105
|
+
ShaderDestination.VERTEX,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
shaderBuilder.addVarying("vec2", "v_vectorUv");
|
|
109
|
+
shaderBuilder.addVertexLines(ModelVectorLookupStageVS);
|
|
110
|
+
// VectorCommon declares the lookup texture uniforms and sampling functions
|
|
111
|
+
// shared with the terrain path.
|
|
112
|
+
shaderBuilder.addFragmentLines(VectorCommon);
|
|
113
|
+
shaderBuilder.addFragmentLines(ModelVectorLookupStageFS);
|
|
114
|
+
|
|
115
|
+
// A re-bake replaces _vectorData, and its rectangle, without rebuilding draw
|
|
116
|
+
// commands, so the callbacks read the rectangle per call.
|
|
117
|
+
const buildRectangle = vectorData.rectangle;
|
|
118
|
+
|
|
119
|
+
const defaultTexture = function () {
|
|
120
|
+
return frameState.context.defaultTexture;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/** @type {Object<string, Function>} */
|
|
124
|
+
const uniformMap = {
|
|
125
|
+
// The UV coordinates of the camera within the baked rectangle.
|
|
126
|
+
u_vectorCameraUv: function () {
|
|
127
|
+
const rectangle = model._vectorData?.rectangle ?? buildRectangle;
|
|
128
|
+
const carto = frameState.camera.positionCartographic;
|
|
129
|
+
|
|
130
|
+
const halfWidth = rectangle.width * 0.5;
|
|
131
|
+
const centerLongitude = rectangle.west + halfWidth;
|
|
132
|
+
const longitudeOffset =
|
|
133
|
+
CesiumMath.negativePiToPi(carto.longitude - centerLongitude) +
|
|
134
|
+
halfWidth;
|
|
135
|
+
return Cartesian2.fromElements(
|
|
136
|
+
longitudeOffset / rectangle.width,
|
|
137
|
+
(carto.latitude - rectangle.south) / rectangle.height,
|
|
138
|
+
scratchCameraUv,
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
u_vectorRectangleInverseSize: function () {
|
|
142
|
+
const rectangle = model._vectorData?.rectangle ?? buildRectangle;
|
|
143
|
+
return Cartesian2.fromElements(
|
|
144
|
+
1.0 / rectangle.width,
|
|
145
|
+
1.0 / rectangle.height,
|
|
146
|
+
scratchRectangleInverseSize,
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
u_vectorColorTexture: function () {
|
|
150
|
+
return model._vectorData?.colorTexture ?? defaultTexture();
|
|
151
|
+
},
|
|
152
|
+
u_vectorPickColorTexture: function () {
|
|
153
|
+
return model._vectorData?.pickColorTexture ?? defaultTexture();
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
if (hasPolylines) {
|
|
158
|
+
uniformMap.u_vectorSegmentTexture = function () {
|
|
159
|
+
return model._vectorData?.polylineSegmentTexture ?? defaultTexture();
|
|
160
|
+
};
|
|
161
|
+
uniformMap.u_vectorWidthTexture = function () {
|
|
162
|
+
return model._vectorData?.widthTexture ?? defaultTexture();
|
|
163
|
+
};
|
|
164
|
+
uniformMap.u_vectorSegmentPrimitiveIndicesTexture = function () {
|
|
165
|
+
return (
|
|
166
|
+
model._vectorData?.polylineSegmentPrimitiveIndicesTexture ??
|
|
167
|
+
defaultTexture()
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
uniformMap.u_vectorGridCellIndicesTexture = function () {
|
|
171
|
+
return (
|
|
172
|
+
model._vectorData?.polylineGridCellIndicesTexture ?? defaultTexture()
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
if (vectorData.hasMeterWidths) {
|
|
177
|
+
uniformMap.u_vectorMetersPerUv = function () {
|
|
178
|
+
return model._vectorData.metersPerUv;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (hasPolygons) {
|
|
184
|
+
uniformMap.u_vectorPolygonEdgeTexture = function () {
|
|
185
|
+
return model._vectorData?.polygonEdgeTexture ?? defaultTexture();
|
|
186
|
+
};
|
|
187
|
+
uniformMap.u_vectorPolygonEdgePrimitiveIndicesTexture = function () {
|
|
188
|
+
return (
|
|
189
|
+
model._vectorData?.polygonEdgePrimitiveIndicesTexture ??
|
|
190
|
+
defaultTexture()
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
uniformMap.u_vectorPolygonGridCellIndicesTexture = function () {
|
|
194
|
+
return (
|
|
195
|
+
model._vectorData?.polygonGridCellIndicesTexture ?? defaultTexture()
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
renderResources.uniformMap = /** @type {Object<string, Function>} */ (
|
|
201
|
+
combine(uniformMap, renderResources.uniformMap)
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export default ModelVectorLookupPipelineStage;
|
|
@@ -93,6 +93,10 @@ PickingPipelineStage.process = function (
|
|
|
93
93
|
renderResources.pickId = "czm_pickColor";
|
|
94
94
|
renderResources.snapId = snapIdFromPickId(renderResources.pickId);
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
if (!defined(model.classificationType) && model.hasDrapedVectors()) {
|
|
98
|
+
renderResources.pickId = `vectorPickColorOver(${renderResources.pickId})`;
|
|
99
|
+
}
|
|
96
100
|
};
|
|
97
101
|
|
|
98
102
|
/**
|
|
@@ -7,8 +7,10 @@ import Frozen from "../Core/Frozen.js";
|
|
|
7
7
|
import defined from "../Core/defined.js";
|
|
8
8
|
import destroyObject from "../Core/destroyObject.js";
|
|
9
9
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
10
|
+
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
10
11
|
import PixelFormat from "../Core/PixelFormat.js";
|
|
11
12
|
import Resource from "../Core/Resource.js";
|
|
13
|
+
import ContextLimits from "../Renderer/ContextLimits.js";
|
|
12
14
|
import PassState from "../Renderer/PassState.js";
|
|
13
15
|
import PixelDatatype from "../Renderer/PixelDatatype.js";
|
|
14
16
|
import RenderState from "../Renderer/RenderState.js";
|
|
@@ -796,6 +798,19 @@ function createSelectedTexture(stage, context) {
|
|
|
796
798
|
}
|
|
797
799
|
}
|
|
798
800
|
|
|
801
|
+
// The selected ids are stored in a texture that is one texel per id, so the
|
|
802
|
+
// number of ids cannot exceed the maximum texture width supported by the
|
|
803
|
+
// hardware. Clamp instead of throwing so that a very large selection
|
|
804
|
+
// degrades gracefully (ids beyond the limit are not highlighted).
|
|
805
|
+
const maximumTextureSize = ContextLimits.maximumTextureSize;
|
|
806
|
+
if (textureLength > maximumTextureSize) {
|
|
807
|
+
PostProcessStage._oneTimeWarning(
|
|
808
|
+
"postProcessStageSelectedTextureSize",
|
|
809
|
+
`The number of selected feature ids (${textureLength}) exceeds the maximum texture size (${maximumTextureSize}). Features beyond the limit will not have the post-process effect applied.`,
|
|
810
|
+
);
|
|
811
|
+
textureLength = maximumTextureSize;
|
|
812
|
+
}
|
|
813
|
+
|
|
799
814
|
if (features.length === 0 || textureLength === 0) {
|
|
800
815
|
// max pick id is reserved
|
|
801
816
|
const empty = new Uint8Array([255, 255, 255, 255]);
|
|
@@ -814,13 +829,14 @@ function createSelectedTexture(stage, context) {
|
|
|
814
829
|
}
|
|
815
830
|
|
|
816
831
|
let offset = 0;
|
|
817
|
-
const
|
|
818
|
-
|
|
832
|
+
const idByteLength = textureLength * 4;
|
|
833
|
+
const ids = new Uint8Array(idByteLength);
|
|
834
|
+
for (let i = 0; i < features.length && offset < idByteLength; ++i) {
|
|
819
835
|
const feature = features[i];
|
|
820
836
|
if (defined(feature.pickIds)) {
|
|
821
837
|
const pickIds = feature.pickIds;
|
|
822
838
|
const pickIdsLength = pickIds.length;
|
|
823
|
-
for (let j = 0; j < pickIdsLength; ++j) {
|
|
839
|
+
for (let j = 0; j < pickIdsLength && offset < idByteLength; ++j) {
|
|
824
840
|
const pickColor = pickIds[j].color;
|
|
825
841
|
ids[offset] = Color.floatToByte(pickColor.red);
|
|
826
842
|
ids[offset + 1] = Color.floatToByte(pickColor.green);
|
|
@@ -999,4 +1015,7 @@ PostProcessStage.prototype.destroy = function () {
|
|
|
999
1015
|
releaseResources(this);
|
|
1000
1016
|
return destroyObject(this);
|
|
1001
1017
|
};
|
|
1018
|
+
|
|
1019
|
+
// Exposed for testing
|
|
1020
|
+
PostProcessStage._oneTimeWarning = oneTimeWarning;
|
|
1002
1021
|
export default PostProcessStage;
|
package/Source/Scene/Scene.js
CHANGED
|
@@ -19,7 +19,7 @@ import Event from "../Core/Event.js";
|
|
|
19
19
|
import GeographicProjection from "../Core/GeographicProjection.js";
|
|
20
20
|
import GeometryInstance from "../Core/GeometryInstance.js";
|
|
21
21
|
import GeometryPipeline from "../Core/GeometryPipeline.js";
|
|
22
|
-
import HeightReference from "./HeightReference.js";
|
|
22
|
+
import HeightReference, { isHeightReferenceClamp } from "./HeightReference.js";
|
|
23
23
|
import Intersect from "../Core/Intersect.js";
|
|
24
24
|
import JulianDate from "../Core/JulianDate.js";
|
|
25
25
|
import CesiumMath from "../Core/Math.js";
|
|
@@ -34,6 +34,7 @@ import Rectangle from "../Core/Rectangle.js";
|
|
|
34
34
|
import RequestScheduler from "../Core/RequestScheduler.js";
|
|
35
35
|
import TaskProcessor from "../Core/TaskProcessor.js";
|
|
36
36
|
import Transforms from "../Core/Transforms.js";
|
|
37
|
+
import VectorProvider from "../Core/VectorProvider.js";
|
|
37
38
|
import ClearCommand from "../Renderer/ClearCommand.js";
|
|
38
39
|
import ComputeEngine from "../Renderer/ComputeEngine.js";
|
|
39
40
|
import Context from "../Renderer/Context.js";
|
|
@@ -84,6 +85,7 @@ import getMetadataClassProperty from "./getMetadataClassProperty.js";
|
|
|
84
85
|
import PickedMetadataInfo from "./PickedMetadataInfo.js";
|
|
85
86
|
import getMetadataProperty from "./getMetadataProperty.js";
|
|
86
87
|
|
|
88
|
+
/** @ignore */
|
|
87
89
|
const requestRenderAfterFrame = function (scene) {
|
|
88
90
|
return function () {
|
|
89
91
|
scene.frameState.afterRender.push(function () {
|
|
@@ -3659,6 +3661,56 @@ function executeCommandsInViewport(firstViewport, scene, passState) {
|
|
|
3659
3661
|
|
|
3660
3662
|
const scratchCullingVolume = new CullingVolume();
|
|
3661
3663
|
|
|
3664
|
+
/**
|
|
3665
|
+
* Marks every drapeable collection in the subtree so the vector provider bakes it this frame
|
|
3666
|
+
*
|
|
3667
|
+
* @param {PrimitiveCollection} collection
|
|
3668
|
+
* @param {VectorProvider} vectorProvider
|
|
3669
|
+
* @param {number} frameNumber
|
|
3670
|
+
* @private
|
|
3671
|
+
*/
|
|
3672
|
+
function markVectorCollections(collection, vectorProvider, frameNumber) {
|
|
3673
|
+
if (!collection.show) {
|
|
3674
|
+
return;
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
const length = collection.length;
|
|
3678
|
+
for (let i = 0; i < length; ++i) {
|
|
3679
|
+
const primitive = collection.get(i);
|
|
3680
|
+
if (primitive instanceof PrimitiveCollection) {
|
|
3681
|
+
markVectorCollections(primitive, vectorProvider, frameNumber);
|
|
3682
|
+
continue;
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
if (
|
|
3686
|
+
primitive.show &&
|
|
3687
|
+
VectorProvider.isSupported(primitive) &&
|
|
3688
|
+
isHeightReferenceClamp(primitive.heightReference)
|
|
3689
|
+
) {
|
|
3690
|
+
vectorProvider.markForFrame(
|
|
3691
|
+
primitive,
|
|
3692
|
+
frameNumber,
|
|
3693
|
+
primitive.heightReference,
|
|
3694
|
+
);
|
|
3695
|
+
}
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
/**
|
|
3700
|
+
* @param {Scene} scene
|
|
3701
|
+
* @param {FrameState} frameState
|
|
3702
|
+
* @private
|
|
3703
|
+
*/
|
|
3704
|
+
function updateVectorProvider(scene, frameState) {
|
|
3705
|
+
const vectorProvider = scene.vectorProvider;
|
|
3706
|
+
if (!defined(vectorProvider)) {
|
|
3707
|
+
return;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
const frameNumber = frameState.frameNumber;
|
|
3711
|
+
markVectorCollections(scene._primitives, vectorProvider, frameNumber);
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3662
3714
|
/**
|
|
3663
3715
|
* @private
|
|
3664
3716
|
*/
|
|
@@ -3793,6 +3845,8 @@ Scene.prototype.updateEnvironment = function () {
|
|
|
3793
3845
|
if (defined(this._specularEnvironmentCubeMap)) {
|
|
3794
3846
|
this._specularEnvironmentCubeMap.update(frameState);
|
|
3795
3847
|
}
|
|
3848
|
+
|
|
3849
|
+
updateVectorProvider(this, frameState);
|
|
3796
3850
|
};
|
|
3797
3851
|
|
|
3798
3852
|
function updateDebugFrustumPlanes(scene) {
|
|
@@ -4724,6 +4778,7 @@ Scene.prototype.pick = function (windowPosition, width, height) {
|
|
|
4724
4778
|
* @typedef {object} SceneSnapResult
|
|
4725
4779
|
* @property {object} object The snapped primitive or feature.
|
|
4726
4780
|
* @property {Cartesian3} position The world-space position of the snap point, un-projected from the snap framebuffer's eye-space depth.
|
|
4781
|
+
* @property {Cartesian3|undefined} surfacePosition The world-space position of the same object's surface fragment nearest the snap point. For a surface snap this equals <code>position</code>; for an edge snap it is a point on a face of the object rather than on its silhouette, or <code>undefined</code> if no surface fragment of the object is visible in the search region.
|
|
4727
4782
|
* @property {Cartesian2} screenPosition The window coordinates of the snap point.
|
|
4728
4783
|
* @property {boolean} isEdge <code>true</code> if the snap point lies on an edge; <code>false</code> if it lies on a surface.
|
|
4729
4784
|
*
|
package/Source/Scene/Snapping.js
CHANGED
|
@@ -35,6 +35,7 @@ const Snapping = {};
|
|
|
35
35
|
|
|
36
36
|
const scratchRectangle = new BoundingRectangle(0.0, 0.0, 3.0, 3.0);
|
|
37
37
|
const scratchSnapCoord = new Cartesian2();
|
|
38
|
+
const scratchSurfaceCoord = new Cartesian2();
|
|
38
39
|
const scratchSnapRay = new Ray();
|
|
39
40
|
const scratchSnapOffset = new Cartesian3();
|
|
40
41
|
|
|
@@ -48,6 +49,13 @@ const SNAP_OCCLUDER_RADIUS_PIXELS = 3.0;
|
|
|
48
49
|
// object the cursor is on.
|
|
49
50
|
const SNAP_OCCLUSION_TOLERANCE = 0.1;
|
|
50
51
|
|
|
52
|
+
// Width of the region, centered on a winning edge hit, read to find the
|
|
53
|
+
// adjacent surface fragment for surfacePosition. Deliberately centered on the
|
|
54
|
+
// edge hit rather than the cursor: the cursor-centered snap region can clip
|
|
55
|
+
// away the object's surface, potentially causing the server-side backend to
|
|
56
|
+
// give a mismatched snap.
|
|
57
|
+
const SNAP_SURFACE_REGION_WIDTH = 9.0;
|
|
58
|
+
|
|
51
59
|
function cursorDist(hit) {
|
|
52
60
|
return Math.sqrt(hit.x * hit.x + hit.y * hit.y);
|
|
53
61
|
}
|
|
@@ -76,6 +84,25 @@ function selectBestHit(hits) {
|
|
|
76
84
|
);
|
|
77
85
|
}
|
|
78
86
|
|
|
87
|
+
// Find the surface hit belonging to the same object that lies closest to the
|
|
88
|
+
// region center, if any. Unlike an edge hit, whose position lies exactly on
|
|
89
|
+
// the object's silhouette, this point is unambiguously on the object.
|
|
90
|
+
function nearestSurfaceHit(hits, object) {
|
|
91
|
+
let best;
|
|
92
|
+
let bestDist = Number.POSITIVE_INFINITY;
|
|
93
|
+
for (const hit of hits) {
|
|
94
|
+
if (hit.isEdge || hit.object !== object) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const dist = hit.x * hit.x + hit.y * hit.y;
|
|
98
|
+
if (dist < bestDist) {
|
|
99
|
+
best = hit;
|
|
100
|
+
bestDist = dist;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return best;
|
|
104
|
+
}
|
|
105
|
+
|
|
79
106
|
// Unproject a snap hit's eye-space depth (channel B of the snap framebuffer,
|
|
80
107
|
// written by the snap shader at the edge fragment itself) into a world
|
|
81
108
|
// position.
|
|
@@ -166,10 +193,39 @@ Snapping.snap = function (scene, windowPosition, options) {
|
|
|
166
193
|
return undefined;
|
|
167
194
|
}
|
|
168
195
|
|
|
196
|
+
// For edge hits, also unproject the nearest same-object surface fragment so
|
|
197
|
+
// consumers have a seed point that is on the object but off its silhouette.
|
|
198
|
+
// Found with a read centered on the edge hit itself, so the seed does not
|
|
199
|
+
// depend on where in the snap region the cursor was.
|
|
200
|
+
let surfacePosition = position;
|
|
201
|
+
if (best.isEdge) {
|
|
202
|
+
const surfaceOrigin = scratchSurfaceCoord;
|
|
203
|
+
surfaceOrigin.x = windowPosition.x + best.x;
|
|
204
|
+
surfaceOrigin.y = windowPosition.y + best.y;
|
|
205
|
+
pickBegin(
|
|
206
|
+
scene,
|
|
207
|
+
surfaceOrigin,
|
|
208
|
+
drawingBufferRectangle,
|
|
209
|
+
SNAP_SURFACE_REGION_WIDTH,
|
|
210
|
+
SNAP_SURFACE_REGION_WIDTH,
|
|
211
|
+
{
|
|
212
|
+
framebuffer: snapFramebuffer,
|
|
213
|
+
snap: true,
|
|
214
|
+
},
|
|
215
|
+
);
|
|
216
|
+
const surfaceHits = snapFramebuffer.end(drawingBufferRectangle);
|
|
217
|
+
pickEnd(scene);
|
|
218
|
+
const surfaceHit = nearestSurfaceHit(surfaceHits, best.object);
|
|
219
|
+
surfacePosition = defined(surfaceHit)
|
|
220
|
+
? snapHitToWorld(scene, surfaceOrigin, surfaceHit)
|
|
221
|
+
: undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
169
224
|
return {
|
|
170
225
|
object: best.object,
|
|
171
226
|
isEdge: best.isEdge,
|
|
172
227
|
position: position,
|
|
228
|
+
surfacePosition: surfacePosition,
|
|
173
229
|
screenPosition: new Cartesian2(
|
|
174
230
|
windowPosition.x + best.x,
|
|
175
231
|
windowPosition.y + best.y,
|
|
@@ -179,6 +235,7 @@ Snapping.snap = function (scene, windowPosition, options) {
|
|
|
179
235
|
|
|
180
236
|
// Exposed for testing.
|
|
181
237
|
Snapping._selectBestHit = selectBestHit;
|
|
238
|
+
Snapping._nearestSurfaceHit = nearestSurfaceHit;
|
|
182
239
|
Snapping._snapHitToWorld = snapHitToWorld;
|
|
183
240
|
|
|
184
241
|
export default Snapping;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import defined from "../Core/defined.js";
|
|
2
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
3
|
+
import getAbsoluteUri from "../Core/getAbsoluteUri.js";
|
|
4
|
+
import TaskProcessor from "../Core/TaskProcessor.js";
|
|
5
|
+
|
|
6
|
+
const defaultWorkerModuleId = "decodeSpz";
|
|
7
|
+
|
|
8
|
+
function getDecoderTaskProcessor() {
|
|
9
|
+
let taskProcessor = SpzDecoder._decoderTaskProcessor;
|
|
10
|
+
if (!defined(taskProcessor)) {
|
|
11
|
+
const workerModuleUrl = SpzDecoder._workerModuleUrl;
|
|
12
|
+
const workerPath = defined(workerModuleUrl)
|
|
13
|
+
? getAbsoluteUri(workerModuleUrl)
|
|
14
|
+
: defaultWorkerModuleId;
|
|
15
|
+
taskProcessor = new TaskProcessor(workerPath);
|
|
16
|
+
SpzDecoder._decoderTaskProcessor = taskProcessor;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return taskProcessor;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Configures the Web Worker module used to decode SPZ-compressed Gaussian
|
|
24
|
+
* splats.
|
|
25
|
+
*
|
|
26
|
+
* @alias SpzDecoder
|
|
27
|
+
* @namespace
|
|
28
|
+
*
|
|
29
|
+
* @experimental This feature is not final and is subject to change without
|
|
30
|
+
* Cesium's standard deprecation policy.
|
|
31
|
+
*/
|
|
32
|
+
function SpzDecoder() {}
|
|
33
|
+
|
|
34
|
+
Object.defineProperties(SpzDecoder, {
|
|
35
|
+
/**
|
|
36
|
+
* The URL of the ECMAScript Web Worker module that decodes SPZ data. Set
|
|
37
|
+
* this before the first SPZ decode to use a decoder other than Cesium's
|
|
38
|
+
* bundled <code>Workers/decodeSpz.js</code> worker. Relative URLs are
|
|
39
|
+
* resolved relative to the document URL.
|
|
40
|
+
*
|
|
41
|
+
* To apply a separate Content Security Policy to the decoder, serve the
|
|
42
|
+
* module as a separate, same-origin resource. Cross-origin URLs use a
|
|
43
|
+
* <code>blob:</code> worker fallback, which inherits the document's policy.
|
|
44
|
+
*
|
|
45
|
+
* The module must use {@link createTaskProcessorWorker}, receive an object
|
|
46
|
+
* with a <code>spzData</code> {@link Uint8Array}, and return the gcloud
|
|
47
|
+
* object produced by <code>@spz-loader/core</code>. It must transfer the
|
|
48
|
+
* buffers for its typed-array attributes.
|
|
49
|
+
*
|
|
50
|
+
* @memberof SpzDecoder
|
|
51
|
+
* @type {string|undefined}
|
|
52
|
+
* @default undefined
|
|
53
|
+
* @experimental This feature is not final and is subject to change without
|
|
54
|
+
* Cesium's standard deprecation policy.
|
|
55
|
+
*/
|
|
56
|
+
workerModuleUrl: {
|
|
57
|
+
get: function () {
|
|
58
|
+
return SpzDecoder._workerModuleUrl;
|
|
59
|
+
},
|
|
60
|
+
set: function (value) {
|
|
61
|
+
if (defined(SpzDecoder._decoderTaskProcessor)) {
|
|
62
|
+
throw new DeveloperError(
|
|
63
|
+
"SpzDecoder.workerModuleUrl must be configured before the first SPZ decode.",
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (defined(value) && (typeof value !== "string" || value.length === 0)) {
|
|
68
|
+
throw new DeveloperError(
|
|
69
|
+
"SpzDecoder.workerModuleUrl must be a non-empty string or undefined.",
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
SpzDecoder._workerModuleUrl = value;
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Decodes SPZ data in the configured Web Worker.
|
|
80
|
+
*
|
|
81
|
+
* @param {Uint8Array} spzData The compressed SPZ data. Its backing buffer is
|
|
82
|
+
* transferred to the worker.
|
|
83
|
+
* @returns {Promise<object>|undefined} A promise that resolves to the gcloud
|
|
84
|
+
* decode result, or undefined when the worker is busy.
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
SpzDecoder.decode = function (spzData) {
|
|
88
|
+
return getDecoderTaskProcessor().scheduleTask({ spzData: spzData }, [
|
|
89
|
+
spzData.buffer,
|
|
90
|
+
]);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
SpzDecoder._decoderTaskProcessor = undefined;
|
|
94
|
+
SpzDecoder._workerModuleUrl = undefined;
|
|
95
|
+
|
|
96
|
+
// Exposed for testing purposes.
|
|
97
|
+
SpzDecoder._resetForTesting = function () {
|
|
98
|
+
const taskProcessor = SpzDecoder._decoderTaskProcessor;
|
|
99
|
+
if (defined(taskProcessor) && !taskProcessor.isDestroyed()) {
|
|
100
|
+
taskProcessor.destroy();
|
|
101
|
+
}
|
|
102
|
+
SpzDecoder._decoderTaskProcessor = undefined;
|
|
103
|
+
SpzDecoder._workerModuleUrl = undefined;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default SpzDecoder;
|
|
@@ -13,7 +13,9 @@ import destroyObject from "../Core/destroyObject.js";
|
|
|
13
13
|
import CesiumMath from "../Core/Math.js";
|
|
14
14
|
|
|
15
15
|
/** @import FrameState from "./FrameState.js"; */
|
|
16
|
+
/** @import HeightReference from "./HeightReference.js"; */
|
|
16
17
|
/** @import PassState from "../Renderer/PassState.js"; */
|
|
18
|
+
/** @import Scene from "./Scene.js"; */
|
|
17
19
|
/** @import TilingScheme from "../Core/TilingScheme.js"; */
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -51,6 +53,10 @@ class UrlTemplate3DTilesDataProvider {
|
|
|
51
53
|
* @param {number} [options.maxZoom=14] Maximum zoom level represented in the generated tileset.
|
|
52
54
|
* @param {Rectangle} [options.extent] Optional geographic extent in radians to constrain the generated tile tree.
|
|
53
55
|
* @param {string} [options.featureIdProperty] Feature property name to use as feature ID when supported by content decoding.
|
|
56
|
+
* @param {HeightReference} [options.heightReference] Drapes the vector content onto the surfaces selected by the
|
|
57
|
+
* value. Requires <code>options.scene</code>.
|
|
58
|
+
* @param {Scene} [options.scene] The scene the generated tileset is rendered in, required when
|
|
59
|
+
* <code>options.heightReference</code> is a clamping value.
|
|
54
60
|
*/
|
|
55
61
|
constructor(urlTemplate, options) {
|
|
56
62
|
options = options ?? {};
|
|
@@ -61,6 +67,8 @@ class UrlTemplate3DTilesDataProvider {
|
|
|
61
67
|
this._minZoom = options.minZoom ?? DEFAULT_MIN_ZOOM;
|
|
62
68
|
this._maxZoom = options.maxZoom ?? DEFAULT_MAX_ZOOM;
|
|
63
69
|
this._featureIdProperty = options.featureIdProperty;
|
|
70
|
+
this._heightReference = options.heightReference;
|
|
71
|
+
this._scene = options.scene;
|
|
64
72
|
this._show = true;
|
|
65
73
|
this._tileset = undefined;
|
|
66
74
|
this._tilesetJsonUrl = undefined;
|
|
@@ -149,7 +157,10 @@ class UrlTemplate3DTilesDataProvider {
|
|
|
149
157
|
* @returns {object}
|
|
150
158
|
*/
|
|
151
159
|
_createTilesetLoadOptions() {
|
|
152
|
-
return {
|
|
160
|
+
return {
|
|
161
|
+
heightReference: this._heightReference,
|
|
162
|
+
scene: this._scene,
|
|
163
|
+
};
|
|
153
164
|
}
|
|
154
165
|
|
|
155
166
|
/**
|
|
@@ -14,6 +14,7 @@ import Matrix4 from "../Core/Matrix4.js";
|
|
|
14
14
|
import Model from "./Model/Model.js";
|
|
15
15
|
import ModelUtility from "./Model/ModelUtility.js";
|
|
16
16
|
import Pass from "../Renderer/Pass.js";
|
|
17
|
+
import VectorProvider from "../Core/VectorProvider.js";
|
|
17
18
|
import createVectorTileBuffersFromModelComponents from "./Model/createVectorTileBuffersFromModelComponents.js";
|
|
18
19
|
import defined from "../Core/defined.js";
|
|
19
20
|
import destroyObject from "../Core/destroyObject.js";
|
|
@@ -354,10 +355,17 @@ class VectorGltf3DTileContent {
|
|
|
354
355
|
collection.modelMatrix,
|
|
355
356
|
);
|
|
356
357
|
|
|
357
|
-
if (
|
|
358
|
+
if (
|
|
359
|
+
!isHeightReferenceClamp(tileset._heightReference) ||
|
|
360
|
+
!VectorProvider.isSupported(collection)
|
|
361
|
+
) {
|
|
358
362
|
collection.update(frameState);
|
|
359
363
|
} else if (isSelected) {
|
|
360
|
-
vectorProvider.
|
|
364
|
+
vectorProvider.markForFrame(
|
|
365
|
+
collection,
|
|
366
|
+
frameState.frameNumber,
|
|
367
|
+
tileset._heightReference,
|
|
368
|
+
);
|
|
361
369
|
}
|
|
362
370
|
}
|
|
363
371
|
}
|