@cesium/engine 26.2.0 → 26.3.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 +656 -518
- package/Build/Workers/{chunk-FU4BGABC.js → chunk-2DKJSPYF.js} +14 -14
- package/Build/Workers/{chunk-NCL22ZUX.js → chunk-2PWVICP6.js} +1 -1
- package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
- package/Build/Workers/{chunk-IJZJMIUY.js → chunk-4DMAXPKB.js} +11 -11
- package/Build/Workers/{chunk-IMBVP57H.js → chunk-4LRFYRBX.js} +2 -2
- package/Build/Workers/{chunk-76FDC45O.js → chunk-5JCZHJUU.js} +13 -13
- package/Build/Workers/{chunk-5LSOO2KD.js → chunk-5KG7KDDW.js} +7 -7
- package/Build/Workers/{chunk-UAZUP4I5.js → chunk-6BSNYZZG.js} +5 -5
- package/Build/Workers/{chunk-D6AY775A.js → chunk-6R6SGKYN.js} +6 -6
- package/Build/Workers/{chunk-3PSS3T43.js → chunk-6V2KDEHL.js} +4 -4
- package/Build/Workers/{chunk-GHXVQVUM.js → chunk-75BC2IHI.js} +7 -7
- package/Build/Workers/{chunk-SMTGMFBL.js → chunk-7SESBH2I.js} +4 -4
- package/Build/Workers/{chunk-NEFDMMLY.js → chunk-7WXBTNRV.js} +8 -8
- package/Build/Workers/{chunk-NXGQBQWE.js → chunk-A7SMPV6B.js} +12 -12
- package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-ATSXKJ3L.js} +7 -7
- package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
- package/Build/Workers/{chunk-OZGPS7FB.js → chunk-B7Q2WF6Q.js} +4 -4
- package/Build/Workers/{chunk-2RGJPWQX.js → chunk-BNDSDQ7D.js} +9 -9
- package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-CKK6CUXK.js} +6 -6
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
- package/Build/Workers/{chunk-6FZDPMTO.js → chunk-CQ4TZXAT.js} +6 -6
- package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-DKSANM4A.js} +12 -12
- package/Build/Workers/{chunk-XCBZVTIV.js → chunk-DZK34ZVD.js} +1 -1
- package/Build/Workers/{chunk-N7CCOFLX.js → chunk-E7G32DWL.js} +1 -1
- package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-EDETO6NY.js} +2 -2
- package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-F34TJJLA.js} +14 -14
- package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
- package/Build/Workers/{chunk-SJYSIOEM.js → chunk-GS7RY2DH.js} +11 -11
- package/Build/Workers/{chunk-5YPQBFRD.js → chunk-HDD3RFLT.js} +3 -3
- package/Build/Workers/{chunk-36NI5E6W.js → chunk-HDPNFEPP.js} +18 -18
- package/Build/Workers/{chunk-DSGLDRTI.js → chunk-JBJ6BRIM.js} +4 -4
- package/Build/Workers/{chunk-DZUFEE4L.js → chunk-JKTWW7IO.js} +5 -5
- package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-JL4NWWQY.js} +5 -5
- package/Build/Workers/{chunk-I74ZH5LK.js → chunk-JMUUAW4X.js} +10 -10
- package/Build/Workers/{chunk-SXSP3JHS.js → chunk-KBGAHN5R.js} +1 -1
- package/Build/Workers/{chunk-GVA7XQI2.js → chunk-KEWK6VZL.js} +12 -12
- package/Build/Workers/{chunk-EOWDZN5S.js → chunk-L73K5UPP.js} +10 -10
- package/Build/Workers/{chunk-J73T2VOY.js → chunk-LL2SGJYH.js} +6 -6
- package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-LYJUL4XQ.js} +6 -6
- package/Build/Workers/{chunk-MAAHFYPC.js → chunk-M6W46OAP.js} +7 -7
- package/Build/Workers/{chunk-FX3VEAIU.js → chunk-MDDKCLMF.js} +16 -16
- package/Build/Workers/{chunk-M6QKXVAU.js → chunk-MUW4DJV7.js} +17 -17
- package/Build/Workers/{chunk-EZGQPOIG.js → chunk-N5YK44FS.js} +5 -5
- package/Build/Workers/{chunk-27FWRTJI.js → chunk-NZQUP52G.js} +9 -9
- package/Build/Workers/{chunk-A62YI6S6.js → chunk-PKZA44LH.js} +4 -4
- package/Build/Workers/{chunk-7MM3N2VE.js → chunk-Q2JS5LCB.js} +17 -17
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
- package/Build/Workers/{chunk-KP5QD7WU.js → chunk-SEJIXZZ4.js} +10 -10
- package/Build/Workers/{chunk-PRWUMCXF.js → chunk-SL2HCFYW.js} +10 -10
- package/Build/Workers/{chunk-NJVBJG63.js → chunk-SLHK3KAR.js} +5 -5
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
- package/Build/Workers/{chunk-LDRQSYBN.js → chunk-VRECSMG3.js} +2 -2
- package/Build/Workers/{chunk-NLLCQBX3.js → chunk-X27HKF5E.js} +2 -2
- package/Build/Workers/{chunk-B3QHNA4A.js → chunk-XBY3354M.js} +6 -6
- package/Build/Workers/{chunk-CRCGE4J4.js → chunk-XRZCS3HE.js} +8 -8
- package/Build/Workers/{chunk-XLQZNQ4Z.js → chunk-XSIUYAT6.js} +2 -2
- package/Build/Workers/{chunk-SA2A2AN5.js → chunk-Z2DW5NM2.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- 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 +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- 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 +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- 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 +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- 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/SnapService.js +63 -0
- package/Source/Core/VectorPipeline.js +139 -45
- package/Source/Core/VectorProvider.js +311 -71
- 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/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/GltfLoader.js +56 -6
- 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/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/index.d.ts +556 -55
- package/index.js +20 -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-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-6FHT43QR.js +0 -140
- package/Build/Workers/chunk-6HK6IXK2.js +0 -138
- package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
- package/Build/Workers/chunk-6YR6JBMY.js +0 -163
- 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-ACTVJHSP.js +0 -519
- package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
- package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
- package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
- package/Build/Workers/chunk-ARZICEEP.js +0 -301
- 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-CDJDJ5LK.js +0 -44
- 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-CUTRKXUQ.js +0 -288
- package/Build/Workers/chunk-DBD5WWG2.js +0 -959
- package/Build/Workers/chunk-DIGUUD6G.js +0 -171
- 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-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-IOO7Z2AV.js +0 -57
- package/Build/Workers/chunk-IUIFLOYO.js +0 -44
- 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-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
|
@@ -24,6 +24,7 @@ import Rectangle from "./Rectangle.js";
|
|
|
24
24
|
/** @import Context from "../Renderer/Context.js"; */
|
|
25
25
|
/** @import Ellipsoid from "./Ellipsoid.js"; */
|
|
26
26
|
/** @import TilingScheme from "./TilingScheme.js"; */
|
|
27
|
+
/** @import {TypedArray, TypedArrayConstructor} from "./globalTypes.js"; */
|
|
27
28
|
|
|
28
29
|
const GRID_TARGET_SEGMENTS_PER_CELL = 16;
|
|
29
30
|
const GRID_NEIGHBOR_PADDING_SCALE = 0.35;
|
|
@@ -37,6 +38,7 @@ const scratchWorldPosition = new Cartesian3();
|
|
|
37
38
|
const scratchCartographic = new Cartographic();
|
|
38
39
|
const scratchSegmentStart = new Cartesian2();
|
|
39
40
|
const scratchSegmentEnd = new Cartesian2();
|
|
41
|
+
const scratchPickColor = new Color();
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* Vector geometry intersecting a terrain tile, mapped into the tile's [0,1]^2 UV domain.
|
|
@@ -44,14 +46,26 @@ const scratchSegmentEnd = new Cartesian2();
|
|
|
44
46
|
* @typedef {object} VectorTileData
|
|
45
47
|
*
|
|
46
48
|
* @property {boolean} show Whether this vector data should be rendered.
|
|
49
|
+
* @property {boolean} hasPolylines Whether polyline lookup data was baked.
|
|
50
|
+
* @property {boolean} hasPolygons Whether polygon lookup data was baked.
|
|
51
|
+
* @property {Map<BufferPrimitiveCollection<BufferPrimitive>, number>} collectionVersions Version of each
|
|
52
|
+
* collection the data was baked from, for staleness checks.
|
|
53
|
+
* @property {Rectangle} rectangle Cartographic rectangle the data was baked for.
|
|
54
|
+
* @property {number} minimumTileScreenPixels Lower bound on the tile's screen size, in pixels,
|
|
55
|
+
* used to convert screen-space line widths into tile UV.
|
|
56
|
+
* @property {Cartesian2} metersPerUv Ground size of the tile, in meters, along each UV axis. Measured on a
|
|
57
|
+
* plane tangent at the tile's center, so it drifts from true surface distance toward the tile's edges.
|
|
58
|
+
* @property {boolean} [hasPixelWidths] Whether any polyline width is in screen pixels.
|
|
59
|
+
* @property {boolean} [hasMeterWidths] Whether any polyline width is in meters.
|
|
47
60
|
*
|
|
48
61
|
* Stage 1: Collect vector segments and polygon rings intersecting tile.
|
|
49
62
|
* @property {number[][]} [polylineSegments] Tile-clipped polyline segments as [ax, ay, bx, by] in tile UV space.
|
|
50
63
|
* @property {number[]} [polylineSegmentPrimitiveIndices] Index per segment, mapping to material for the segment.
|
|
51
64
|
* @property {Float64Array[]} [polygonRings] Tile-clipped polygon rings as flat [x0, y0, x1, y1, ...] in tile UV space.
|
|
52
65
|
* @property {number[]} [polygonRingPrimitiveIndices] Index per ring, mapping to material for the ring.
|
|
53
|
-
* @property {
|
|
66
|
+
* @property {Float32Array[]} [widths] Signed primitive widths, by primitive index.
|
|
54
67
|
* @property {Uint8Array[]} [colors] Primitive colors, by primitive index.
|
|
68
|
+
* @property {Uint8Array[]} [pickColors] Primitive pick colors, by primitive index.
|
|
55
69
|
* @property {number} [primitiveCount] Number of vector primitives in tile.
|
|
56
70
|
*
|
|
57
71
|
* Stage 2: Build CPU grid structures.
|
|
@@ -71,6 +85,7 @@ const scratchSegmentEnd = new Cartesian2();
|
|
|
71
85
|
* @property {Texture} [polylineSegmentPrimitiveIndicesTexture] GPU texture of primitive indices per segment.
|
|
72
86
|
* @property {Texture} [widthTexture] GPU texture of primitive widths, by primitive index.
|
|
73
87
|
* @property {Texture} [colorTexture] GPU texture of primitive colors, by primitive index.
|
|
88
|
+
* @property {Texture} [pickColorTexture] GPU texture of primitive pick colors, by primitive index.
|
|
74
89
|
* @property {Texture} [polylineGridCellIndicesTexture] GPU texture of polylineGridCellIndices.
|
|
75
90
|
* @property {Texture} [polygonEdgeTexture] GPU texture of polygonEdgeTexels.
|
|
76
91
|
* @property {Texture} [polygonEdgePrimitiveIndicesTexture] GPU texture of primitive indices per polygon edge.
|
|
@@ -87,10 +102,15 @@ const scratchSegmentEnd = new Cartesian2();
|
|
|
87
102
|
* @typedef {object} VectorCollectionData
|
|
88
103
|
*
|
|
89
104
|
* @property {number} version State of `collection._version` at time data was last updated.
|
|
90
|
-
* @property {Rectangle} rectangle
|
|
105
|
+
* @property {Rectangle} rectangle The rectangle of the vector collection's bounding volume.
|
|
91
106
|
* @property {Float64Array} positions Collection positions, projected to the ellipsoid as [lng, lat] in radians.
|
|
92
|
-
* @property {
|
|
107
|
+
* @property {Float32Array} widths Signed primitive widths, by primitive index. A negative magnitude marks
|
|
108
|
+
* a width in meters on the ground; a positive one marks a width in screen pixels. Zero-filled for
|
|
109
|
+
* polygon collections.
|
|
110
|
+
* @property {boolean} [widthInMeters] Whether widths are in meters on the ground rather than screen pixels.
|
|
93
111
|
* @property {Uint8Array} colors Primitive colors, by primitive index.
|
|
112
|
+
* @property {Uint8Array} pickColors Primitive pick colors, by primitive index. Zero-filled when the
|
|
113
|
+
* collection does not allow picking.
|
|
94
114
|
*
|
|
95
115
|
* @private
|
|
96
116
|
*/
|
|
@@ -107,11 +127,11 @@ const scratchSegmentEnd = new Cartesian2();
|
|
|
107
127
|
class VectorPipeline {
|
|
108
128
|
/**
|
|
109
129
|
* @param {BufferPolylineCollection} collection
|
|
110
|
-
* @param {
|
|
130
|
+
* @param {Ellipsoid} ellipsoid
|
|
111
131
|
* @param {VectorCollectionData} [result]
|
|
112
132
|
* @returns {VectorCollectionData}
|
|
113
133
|
*/
|
|
114
|
-
static packPolylineCollectionData(collection,
|
|
134
|
+
static packPolylineCollectionData(collection, ellipsoid, result) {
|
|
115
135
|
if (
|
|
116
136
|
defined(result) &&
|
|
117
137
|
collection._dirtyCount === 0 &&
|
|
@@ -122,13 +142,14 @@ class VectorPipeline {
|
|
|
122
142
|
|
|
123
143
|
const primitiveCount = collection.primitiveCount;
|
|
124
144
|
const boundingVolume = collection.boundingVolume;
|
|
125
|
-
const ellipsoid = tilingScheme.ellipsoid;
|
|
126
145
|
|
|
127
146
|
const rectangle = Rectangle.fromBoundingSphere(boundingVolume, ellipsoid);
|
|
128
147
|
const positions = _getProjectedPositions(collection, ellipsoid);
|
|
129
148
|
|
|
130
|
-
const widths = new
|
|
149
|
+
const widths = new Float32Array(primitiveCount);
|
|
131
150
|
const colors = new Uint8Array(primitiveCount * 4);
|
|
151
|
+
const pickColors = new Uint8Array(primitiveCount * 4);
|
|
152
|
+
const widthInMeters = collection.widthUnits === "meters";
|
|
132
153
|
|
|
133
154
|
for (let i = 0; i < primitiveCount; i++) {
|
|
134
155
|
const polyline = /** @type {BufferPolyline} */ (
|
|
@@ -140,12 +161,16 @@ class VectorPipeline {
|
|
|
140
161
|
polyline.getMaterial(scratchPolylineMaterial)
|
|
141
162
|
);
|
|
142
163
|
|
|
143
|
-
widths[i] =
|
|
164
|
+
widths[i] = widthInMeters
|
|
165
|
+
? -polylineMaterial.width
|
|
166
|
+
: polylineMaterial.width;
|
|
144
167
|
|
|
145
168
|
colors[i * 4] = Color.floatToByte(polylineMaterial.color.red);
|
|
146
169
|
colors[i * 4 + 1] = Color.floatToByte(polylineMaterial.color.green);
|
|
147
170
|
colors[i * 4 + 2] = Color.floatToByte(polylineMaterial.color.blue);
|
|
148
171
|
colors[i * 4 + 3] = Color.floatToByte(polylineMaterial.color.alpha);
|
|
172
|
+
|
|
173
|
+
_writePickColor(pickColors, i, polyline._pickId);
|
|
149
174
|
}
|
|
150
175
|
|
|
151
176
|
return Object.assign(
|
|
@@ -155,7 +180,9 @@ class VectorPipeline {
|
|
|
155
180
|
rectangle: rectangle,
|
|
156
181
|
positions: positions,
|
|
157
182
|
widths: widths,
|
|
183
|
+
widthInMeters: widthInMeters,
|
|
158
184
|
colors: colors,
|
|
185
|
+
pickColors: pickColors,
|
|
159
186
|
}),
|
|
160
187
|
);
|
|
161
188
|
}
|
|
@@ -173,8 +200,10 @@ class VectorPipeline {
|
|
|
173
200
|
result.polylineSegments ??= [];
|
|
174
201
|
result.widths ??= [];
|
|
175
202
|
result.colors ??= [];
|
|
203
|
+
result.pickColors ??= [];
|
|
176
204
|
result.polylineSegmentPrimitiveIndices ??= [];
|
|
177
205
|
result.primitiveCount ??= 0;
|
|
206
|
+
result.rectangle ??= Rectangle.clone(rectangle);
|
|
178
207
|
|
|
179
208
|
const width = rectangle.width;
|
|
180
209
|
const primitiveCount = collection.primitiveCount;
|
|
@@ -191,6 +220,12 @@ class VectorPipeline {
|
|
|
191
220
|
const vertexCount = polyline.vertexCount;
|
|
192
221
|
const vertexOffset = polyline.vertexOffset;
|
|
193
222
|
|
|
223
|
+
// A line whose centerline lies outside the tile still covers pixels inside it.
|
|
224
|
+
const margin = Math.max(
|
|
225
|
+
CesiumMath.EPSILON3,
|
|
226
|
+
_halfWidthToTileUv(collectionData.widths[i], result),
|
|
227
|
+
);
|
|
228
|
+
|
|
194
229
|
for (let j = 0; j + 1 < vertexCount; j++) {
|
|
195
230
|
const segmentStart = Cartesian2.fromArray(
|
|
196
231
|
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
@@ -208,17 +243,7 @@ class VectorPipeline {
|
|
|
208
243
|
|
|
209
244
|
_projectSegmentToTileUv(segmentStart, segmentEnd, rectangle, width);
|
|
210
245
|
|
|
211
|
-
|
|
212
|
-
// [0,1], for robustness at the shared tile boundary. The boundary artifacts
|
|
213
|
-
// observed so far are consistent with floating-point error placing a segment
|
|
214
|
-
// vertex slightly outside the tile; a segment lying just outside the edge could
|
|
215
|
-
// also bleed in through its half line-width, though that case is unconfirmed.
|
|
216
|
-
// The margin is a small fixed fraction of the tile, independent of line width.
|
|
217
|
-
const clipped = _clipSegmentToTile(
|
|
218
|
-
segmentStart,
|
|
219
|
-
segmentEnd,
|
|
220
|
-
CesiumMath.EPSILON3,
|
|
221
|
-
);
|
|
246
|
+
const clipped = _clipSegmentToTile(segmentStart, segmentEnd, margin);
|
|
222
247
|
|
|
223
248
|
if (clipped) {
|
|
224
249
|
result.polylineSegments.push([
|
|
@@ -237,6 +262,11 @@ class VectorPipeline {
|
|
|
237
262
|
// Append materials unconditionally, to simplify indexing and updates.
|
|
238
263
|
result.widths.push(collectionData.widths);
|
|
239
264
|
result.colors.push(collectionData.colors);
|
|
265
|
+
result.pickColors.push(collectionData.pickColors);
|
|
266
|
+
if (primitiveCount > 0) {
|
|
267
|
+
result.hasPixelWidths ||= !collectionData.widthInMeters;
|
|
268
|
+
result.hasMeterWidths ||= collectionData.widthInMeters;
|
|
269
|
+
}
|
|
240
270
|
|
|
241
271
|
result.primitiveCount += primitiveCount;
|
|
242
272
|
}
|
|
@@ -262,15 +292,16 @@ class VectorPipeline {
|
|
|
262
292
|
}
|
|
263
293
|
|
|
264
294
|
let packedSegmentCount = 0;
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
// the exact distance test, so the slight over-inclusion only costs a few
|
|
270
|
-
// extra comparisons there.
|
|
271
|
-
const padding = GRID_NEIGHBOR_PADDING_SCALE / gridSize;
|
|
295
|
+
// Each segment is assigned to every cell its padded bounding box overlaps, so
|
|
296
|
+
// the shader also sees lines just outside the cell it samples.
|
|
297
|
+
const cellPadding = GRID_NEIGHBOR_PADDING_SCALE / gridSize;
|
|
298
|
+
const widths = _concatTypedArrays(result.widths);
|
|
272
299
|
for (let i = 0; i < segments.length; i++) {
|
|
273
300
|
const segment = segments[i];
|
|
301
|
+
const padding = Math.max(
|
|
302
|
+
cellPadding,
|
|
303
|
+
_halfWidthToTileUv(widths[segmentPrimitiveIndices[i]], result),
|
|
304
|
+
);
|
|
274
305
|
const minX = Math.max(0.0, Math.min(segment[0], segment[2]) - padding);
|
|
275
306
|
const maxX = Math.min(1.0, Math.max(segment[0], segment[2]) + padding);
|
|
276
307
|
const minY = Math.max(0.0, Math.min(segment[1], segment[3]) - padding);
|
|
@@ -329,11 +360,11 @@ class VectorPipeline {
|
|
|
329
360
|
|
|
330
361
|
/**
|
|
331
362
|
* @param {BufferPolygonCollection} collection
|
|
332
|
-
* @param {
|
|
363
|
+
* @param {Ellipsoid} ellipsoid
|
|
333
364
|
* @param {VectorCollectionData} [result]
|
|
334
365
|
* @returns {VectorCollectionData}
|
|
335
366
|
*/
|
|
336
|
-
static packPolygonCollectionData(collection,
|
|
367
|
+
static packPolygonCollectionData(collection, ellipsoid, result) {
|
|
337
368
|
if (
|
|
338
369
|
defined(result) &&
|
|
339
370
|
collection._dirtyCount === 0 &&
|
|
@@ -344,15 +375,15 @@ class VectorPipeline {
|
|
|
344
375
|
|
|
345
376
|
const primitiveCount = collection.primitiveCount;
|
|
346
377
|
const boundingVolume = collection.boundingVolume;
|
|
347
|
-
const ellipsoid = tilingScheme.ellipsoid;
|
|
348
378
|
|
|
349
379
|
const rectangle = Rectangle.fromBoundingSphere(boundingVolume, ellipsoid);
|
|
350
380
|
const positions = _getProjectedPositions(collection, ellipsoid);
|
|
351
381
|
|
|
352
382
|
// Widths are unused by polygon fills; zero-filled so polygons share the
|
|
353
383
|
// primitive index space (and width/color textures) with polylines.
|
|
354
|
-
const widths = new
|
|
384
|
+
const widths = new Float32Array(primitiveCount);
|
|
355
385
|
const colors = new Uint8Array(primitiveCount * 4);
|
|
386
|
+
const pickColors = new Uint8Array(primitiveCount * 4);
|
|
356
387
|
|
|
357
388
|
for (let i = 0; i < primitiveCount; i++) {
|
|
358
389
|
const polygon = /** @type {BufferPolygon} */ (
|
|
@@ -368,6 +399,8 @@ class VectorPipeline {
|
|
|
368
399
|
colors[i * 4 + 1] = Color.floatToByte(polygonMaterial.color.green);
|
|
369
400
|
colors[i * 4 + 2] = Color.floatToByte(polygonMaterial.color.blue);
|
|
370
401
|
colors[i * 4 + 3] = Color.floatToByte(polygonMaterial.color.alpha);
|
|
402
|
+
|
|
403
|
+
_writePickColor(pickColors, i, polygon._pickId);
|
|
371
404
|
}
|
|
372
405
|
|
|
373
406
|
return Object.assign(
|
|
@@ -378,6 +411,7 @@ class VectorPipeline {
|
|
|
378
411
|
positions: positions,
|
|
379
412
|
widths: widths,
|
|
380
413
|
colors: colors,
|
|
414
|
+
pickColors: pickColors,
|
|
381
415
|
}),
|
|
382
416
|
);
|
|
383
417
|
}
|
|
@@ -397,7 +431,9 @@ class VectorPipeline {
|
|
|
397
431
|
result.polygonRingPrimitiveIndices ??= [];
|
|
398
432
|
result.widths ??= [];
|
|
399
433
|
result.colors ??= [];
|
|
434
|
+
result.pickColors ??= [];
|
|
400
435
|
result.primitiveCount ??= 0;
|
|
436
|
+
result.rectangle ??= Rectangle.clone(rectangle);
|
|
401
437
|
|
|
402
438
|
const width = rectangle.width;
|
|
403
439
|
const primitiveCount = collection.primitiveCount;
|
|
@@ -459,6 +495,7 @@ class VectorPipeline {
|
|
|
459
495
|
// Append materials unconditionally, to simplify indexing and updates.
|
|
460
496
|
result.widths.push(collectionData.widths);
|
|
461
497
|
result.colors.push(collectionData.colors);
|
|
498
|
+
result.pickColors.push(collectionData.pickColors);
|
|
462
499
|
|
|
463
500
|
result.primitiveCount += primitiveCount;
|
|
464
501
|
}
|
|
@@ -603,14 +640,14 @@ class VectorPipeline {
|
|
|
603
640
|
result.primitiveCount,
|
|
604
641
|
);
|
|
605
642
|
|
|
606
|
-
const widthTextureView = new
|
|
643
|
+
const widthTextureView = new Float32Array(
|
|
607
644
|
primTextureWidth * primTextureHeight,
|
|
608
645
|
);
|
|
609
|
-
widthTextureView.set(
|
|
646
|
+
widthTextureView.set(_concatTypedArrays(result.widths));
|
|
610
647
|
result.widthTexture = new Texture({
|
|
611
648
|
context,
|
|
612
649
|
pixelFormat: PixelFormat.RED,
|
|
613
|
-
pixelDatatype: PixelDatatype.
|
|
650
|
+
pixelDatatype: PixelDatatype.FLOAT,
|
|
614
651
|
source: {
|
|
615
652
|
width: primTextureWidth,
|
|
616
653
|
height: primTextureHeight,
|
|
@@ -623,7 +660,7 @@ class VectorPipeline {
|
|
|
623
660
|
const colorTextureView = new Uint8Array(
|
|
624
661
|
primTextureWidth * primTextureHeight * 4,
|
|
625
662
|
);
|
|
626
|
-
colorTextureView.set(
|
|
663
|
+
colorTextureView.set(_concatTypedArrays(result.colors));
|
|
627
664
|
result.colorTexture = new Texture({
|
|
628
665
|
context,
|
|
629
666
|
pixelFormat: PixelFormat.RGBA,
|
|
@@ -636,6 +673,23 @@ class VectorPipeline {
|
|
|
636
673
|
sampler: Sampler.NEAREST,
|
|
637
674
|
flipY: false,
|
|
638
675
|
});
|
|
676
|
+
|
|
677
|
+
const pickColorTextureView = new Uint8Array(
|
|
678
|
+
primTextureWidth * primTextureHeight * 4,
|
|
679
|
+
);
|
|
680
|
+
pickColorTextureView.set(_concatTypedArrays(result.pickColors));
|
|
681
|
+
result.pickColorTexture = new Texture({
|
|
682
|
+
context,
|
|
683
|
+
pixelFormat: PixelFormat.RGBA,
|
|
684
|
+
pixelDatatype: PixelDatatype.UNSIGNED_BYTE,
|
|
685
|
+
source: {
|
|
686
|
+
width: primTextureWidth,
|
|
687
|
+
height: primTextureHeight,
|
|
688
|
+
arrayBufferView: pickColorTextureView,
|
|
689
|
+
},
|
|
690
|
+
sampler: Sampler.NEAREST,
|
|
691
|
+
flipY: false,
|
|
692
|
+
});
|
|
639
693
|
}
|
|
640
694
|
|
|
641
695
|
/**
|
|
@@ -719,6 +773,7 @@ class VectorPipeline {
|
|
|
719
773
|
data.polylineSegmentTexture?.destroy();
|
|
720
774
|
data.widthTexture?.destroy();
|
|
721
775
|
data.colorTexture?.destroy();
|
|
776
|
+
data.pickColorTexture?.destroy();
|
|
722
777
|
data.polylineSegmentPrimitiveIndicesTexture?.destroy();
|
|
723
778
|
data.polylineGridCellIndicesTexture?.destroy();
|
|
724
779
|
data.polygonEdgeTexture?.destroy();
|
|
@@ -730,6 +785,41 @@ class VectorPipeline {
|
|
|
730
785
|
/////////////////////////////////////////////////////////////////////////////
|
|
731
786
|
// INTERNAL METHODS
|
|
732
787
|
|
|
788
|
+
/**
|
|
789
|
+
* Writes a primitive's pick color, as RGBA bytes, at the given primitive index.
|
|
790
|
+
*
|
|
791
|
+
* @param {Uint8Array} pickColors
|
|
792
|
+
* @param {number} index
|
|
793
|
+
* @param {number} pickId Pick color of the primitive, as a packed RGBA value.
|
|
794
|
+
* @private
|
|
795
|
+
*/
|
|
796
|
+
function _writePickColor(pickColors, index, pickId) {
|
|
797
|
+
Color.fromRgba(pickId, scratchPickColor);
|
|
798
|
+
pickColors[index * 4] = Color.floatToByte(scratchPickColor.red);
|
|
799
|
+
pickColors[index * 4 + 1] = Color.floatToByte(scratchPickColor.green);
|
|
800
|
+
pickColors[index * 4 + 2] = Color.floatToByte(scratchPickColor.blue);
|
|
801
|
+
pickColors[index * 4 + 3] = Color.floatToByte(scratchPickColor.alpha);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Converts half of a line's width, plus its antialiased edge, to tile UV.
|
|
806
|
+
*
|
|
807
|
+
* @param {number} width Signed line width; negative magnitudes are in meters, positive in pixels.
|
|
808
|
+
* @param {VectorTileData} tileData
|
|
809
|
+
* @returns {number}
|
|
810
|
+
* @private
|
|
811
|
+
*/
|
|
812
|
+
function _halfWidthToTileUv(width, tileData) {
|
|
813
|
+
if (width >= 0.0) {
|
|
814
|
+
return ((width + 1.0) * 0.5) / tileData.minimumTileScreenPixels;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
// A meter is a different amount of UV on each axis; callers apply one isotropic
|
|
818
|
+
// margin, so use the axis that yields the larger of the two.
|
|
819
|
+
const metersPerUv = tileData.metersPerUv;
|
|
820
|
+
return (-width * 0.5) / Math.min(metersPerUv.x, metersPerUv.y);
|
|
821
|
+
}
|
|
822
|
+
|
|
733
823
|
/**
|
|
734
824
|
* Projects a polyline segment (start/end Cartesian2s, x=lng, y=lat, in radians) into the
|
|
735
825
|
* tile's [0,1]^2 UV domain. Endpoint B's longitude is first unwrapped to within
|
|
@@ -1092,26 +1182,30 @@ function _getProjectedPositions(collection, ellipsoid, result) {
|
|
|
1092
1182
|
}
|
|
1093
1183
|
|
|
1094
1184
|
/**
|
|
1095
|
-
* Concatenates N
|
|
1096
|
-
* @
|
|
1097
|
-
* @
|
|
1185
|
+
* Concatenates N typed arrays.
|
|
1186
|
+
* @template {TypedArray} T
|
|
1187
|
+
* @param {T[]} arrays
|
|
1188
|
+
* @returns {T}
|
|
1098
1189
|
* @ignore
|
|
1099
1190
|
*/
|
|
1100
|
-
function
|
|
1101
|
-
let
|
|
1191
|
+
function _concatTypedArrays(arrays) {
|
|
1192
|
+
let byteLength = 0;
|
|
1102
1193
|
for (const array of arrays) {
|
|
1103
|
-
|
|
1194
|
+
byteLength += array.byteLength;
|
|
1104
1195
|
}
|
|
1105
1196
|
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1197
|
+
const TypedArray = /** @type {TypedArrayConstructor} */ (
|
|
1198
|
+
arrays[0].constructor
|
|
1199
|
+
);
|
|
1200
|
+
const result = new TypedArray(byteLength / TypedArray.BYTES_PER_ELEMENT);
|
|
1108
1201
|
|
|
1202
|
+
let offset = 0;
|
|
1109
1203
|
for (const array of arrays) {
|
|
1110
|
-
result.set(array,
|
|
1111
|
-
|
|
1204
|
+
result.set(array, offset);
|
|
1205
|
+
offset += array.length;
|
|
1112
1206
|
}
|
|
1113
1207
|
|
|
1114
|
-
return result;
|
|
1208
|
+
return /** @type {T} */ (result);
|
|
1115
1209
|
}
|
|
1116
1210
|
|
|
1117
1211
|
export default VectorPipeline;
|