@cesium/engine 26.1.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 +764 -520
- package/Build/Workers/{chunk-HS6AD4P2.js → chunk-2DKJSPYF.js} +14 -14
- package/Build/Workers/{chunk-QVLAFFJY.js → chunk-2PWVICP6.js} +1 -1
- package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
- package/Build/Workers/{chunk-ENNFMWDW.js → chunk-4DMAXPKB.js} +12 -12
- package/Build/Workers/{chunk-CDJDJ5LK.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-A6X24AZI.js → chunk-6BSNYZZG.js} +5 -5
- package/Build/Workers/{chunk-IGAZBTFZ.js → chunk-6R6SGKYN.js} +6 -6
- package/Build/Workers/{chunk-SS5ABQGY.js → chunk-6V2KDEHL.js} +4 -4
- package/Build/Workers/{chunk-ZMBHFYOX.js → chunk-75BC2IHI.js} +7 -7
- package/Build/Workers/{chunk-LGNDTZVX.js → chunk-7SESBH2I.js} +4 -4
- package/Build/Workers/{chunk-CLCTQVVL.js → chunk-7WXBTNRV.js} +8 -8
- package/Build/Workers/{chunk-WBSY7HDY.js → chunk-A7SMPV6B.js} +12 -12
- package/Build/Workers/{chunk-CEEZE3YZ.js → chunk-ATSXKJ3L.js} +7 -7
- package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
- package/Build/Workers/{chunk-6HK6IXK2.js → chunk-B7Q2WF6Q.js} +4 -4
- package/Build/Workers/{chunk-YKU2Q3A2.js → chunk-BNDSDQ7D.js} +9 -12
- package/Build/Workers/{chunk-R4FPNAZ2.js → chunk-CKK6CUXK.js} +9 -9
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
- package/Build/Workers/{chunk-7D2HZKH7.js → chunk-CQ4TZXAT.js} +7 -7
- package/Build/Workers/{chunk-TVZD72WJ.js → chunk-DKSANM4A.js} +12 -12
- package/Build/Workers/{chunk-FDK4K5IA.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-2EFYUSUY.js → chunk-F34TJJLA.js} +16 -16
- package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
- package/Build/Workers/{chunk-T5QBPLE3.js → chunk-GS7RY2DH.js} +11 -11
- package/Build/Workers/{chunk-C7JQVRLM.js → chunk-HDD3RFLT.js} +25 -3
- package/Build/Workers/{chunk-E7NZJOK7.js → chunk-HDPNFEPP.js} +121 -93
- package/Build/Workers/{chunk-VAL7DYNR.js → chunk-JBJ6BRIM.js} +4 -4
- package/Build/Workers/{chunk-XQ3SKCMM.js → chunk-JKTWW7IO.js} +5 -5
- package/Build/Workers/{chunk-UVO6COT2.js → chunk-JL4NWWQY.js} +5 -5
- package/Build/Workers/{chunk-DBD5WWG2.js → chunk-JMUUAW4X.js} +10 -10
- package/Build/Workers/{chunk-UEY73NRN.js → chunk-KBGAHN5R.js} +1 -1
- package/Build/Workers/{chunk-LD64RPYV.js → chunk-KEWK6VZL.js} +12 -12
- package/Build/Workers/{chunk-JW6OZT4R.js → chunk-L73K5UPP.js} +10 -10
- package/Build/Workers/{chunk-DIGUUD6G.js → chunk-LL2SGJYH.js} +6 -6
- package/Build/Workers/{chunk-XLXSDIP5.js → chunk-LYJUL4XQ.js} +6 -6
- package/Build/Workers/{chunk-SM2CDCYF.js → chunk-M6W46OAP.js} +7 -7
- package/Build/Workers/{chunk-EHTS2YPT.js → chunk-MDDKCLMF.js} +17 -17
- package/Build/Workers/{chunk-FGQFQHN5.js → chunk-MUW4DJV7.js} +18 -18
- package/Build/Workers/{chunk-HHV3MCGV.js → chunk-N5YK44FS.js} +5 -5
- package/Build/Workers/{chunk-RG4F5R57.js → chunk-NZQUP52G.js} +9 -9
- package/Build/Workers/{chunk-B4CQSLZJ.js → chunk-PKZA44LH.js} +6 -6
- package/Build/Workers/{chunk-OBEU25PI.js → chunk-Q2JS5LCB.js} +17 -17
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
- package/Build/Workers/{chunk-NIWITKQK.js → chunk-SEJIXZZ4.js} +11 -11
- package/Build/Workers/{chunk-SGRGNDOD.js → chunk-SL2HCFYW.js} +10 -10
- package/Build/Workers/{chunk-SF6K72D7.js → chunk-SLHK3KAR.js} +5 -5
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
- package/Build/Workers/{chunk-LNSQVXFH.js → chunk-VRECSMG3.js} +2 -2
- package/Build/Workers/{chunk-A3O6EDBK.js → chunk-X27HKF5E.js} +2 -2
- package/Build/Workers/{chunk-7KVKHY7O.js → chunk-XBY3354M.js} +6 -6
- package/Build/Workers/{chunk-GSWMAFTE.js → chunk-XRZCS3HE.js} +23 -16
- package/Build/Workers/{chunk-6YR6JBMY.js → chunk-XSIUYAT6.js} +2 -2
- package/Build/Workers/{chunk-ZSGUV73H.js → chunk-Z2DW5NM2.js} +6 -6
- 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 +35 -35
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +31 -33
- package/Build/Workers/createCorridorOutlineGeometry.js +29 -31
- 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 +24 -24
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +34 -34
- package/Build/Workers/createPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createPolylineGeometry.js +26 -26
- 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 +21 -21
- package/Build/Workers/createSimplePolylineGeometry.js +24 -24
- 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 +24 -24
- 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/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/CoplanarPolygonGeometry.js +2 -2
- package/Source/Core/CorridorGeometry.js +2 -4
- package/Source/Core/CorridorOutlineGeometry.js +1 -3
- package/Source/Core/EarthOrientationParameters.js +2 -2
- package/Source/Core/EllipseGeometryLibrary.js +2 -2
- package/Source/Core/EllipsoidGeodesic.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +2 -2
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +1 -0
- 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/JulianDate.js +1 -1
- package/Source/Core/LagrangePolynomialApproximation.js +55 -52
- package/Source/Core/LinearApproximation.js +69 -66
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +2 -2
- package/Source/Core/Matrix3.js +2 -2
- package/Source/Core/OrthographicFrustum.js +1 -1
- package/Source/Core/PerspectiveFrustum.js +1 -1
- package/Source/Core/PolygonGeometry.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/SnapService.js +63 -0
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainPicker.js +179 -168
- package/Source/Core/TimeIntervalCollection.js +1 -3
- package/Source/Core/Tipsify.js +1 -1
- package/Source/Core/Transforms.js +5 -1
- package/Source/Core/VectorPipeline.js +1211 -0
- package/Source/Core/VectorProvider.js +669 -0
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +2 -0
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/GeoJsonDataSource.js +0 -1
- package/Source/DataSources/GeometryVisualizer.js +1 -1
- package/Source/DataSources/KmlDataSource.js +1 -2
- package/Source/DataSources/PolylineVisualizer.js +1 -1
- package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
- package/Source/Renderer/AutomaticUniforms.js +67 -2
- package/Source/Renderer/Context.js +9 -3
- package/Source/Renderer/DrawCommand.js +22 -0
- package/Source/Renderer/Framebuffer.js +4 -0
- package/Source/Renderer/Pass.js +11 -10
- package/Source/Renderer/ShaderBuilder.js +1 -1
- package/Source/Renderer/Texture.js +11 -0
- package/Source/Renderer/UniformState.js +54 -1
- package/Source/Renderer/VertexArray.js +0 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +2 -1
- package/Source/Scene/BillboardCollection.js +7 -3
- 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 +226 -34
- package/Source/Scene/Camera.js +71 -5
- package/Source/Scene/Cesium3DTile.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +62 -9
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
- package/Source/Scene/Cesium3DTilesetCache.js +15 -0
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/ClippingPolygon.js +154 -100
- package/Source/Scene/ClippingPolygonCollection.js +352 -694
- package/Source/Scene/Controllers/Controller.js +63 -0
- package/Source/Scene/Controllers/ControllerHost.js +78 -0
- package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
- package/Source/Scene/Controllers/MouseButton.js +32 -0
- package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
- package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
- package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
- package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
- package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
- package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
- package/Source/Scene/CreditDisplay.js +62 -0
- package/Source/Scene/DerivedCommand.js +94 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/FrameState.js +17 -0
- package/Source/Scene/GeoJsonPrimitive.js +114 -24
- package/Source/Scene/Globe.js +20 -0
- package/Source/Scene/GlobeDepth.js +27 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +42 -53
- package/Source/Scene/GlobeSurfaceTile.js +61 -10
- package/Source/Scene/GlobeSurfaceTileProvider.js +351 -26
- package/Source/Scene/GltfLoader.js +88 -9
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SLayer.js +1 -1
- package/Source/Scene/I3SNode.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +188 -4
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +1 -1
- package/Source/Scene/MVTDataProvider.js +11 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +10 -8
- package/Source/Scene/Model/I3dmLoader.js +1 -1
- package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
- package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
- package/Source/Scene/Model/Model.js +250 -26
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
- package/Source/Scene/Model/ModelDrawCommand.js +160 -16
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelRenderResources.js +2 -3
- package/Source/Scene/Model/ModelSceneGraph.js +31 -1
- package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
- package/Source/Scene/Model/PickingPipelineStage.js +33 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/ModelComponents.js +71 -0
- package/Source/Scene/Picking.js +16 -5
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +0 -1
- package/Source/Scene/PolylineCollection.js +1 -1
- package/Source/Scene/PostProcessStage.js +26 -5
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +16 -13
- package/Source/Scene/Scene.js +258 -6
- package/Source/Scene/ScreenSpaceCameraController.js +1 -2
- package/Source/Scene/ShadowMap.js +9 -3
- package/Source/Scene/ShadowMapShader.js +50 -2
- package/Source/Scene/SnapFramebuffer.js +121 -0
- package/Source/Scene/Snapping.js +241 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +13 -2
- package/Source/Scene/Vector3DTileContent.js +2 -3
- package/Source/Scene/VectorGltf3DTileContent.js +31 -3
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
- package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/renderBufferPointCollection.js +1 -2
- package/Source/Scene/renderBufferPolygonCollection.js +1 -2
- package/Source/Scene/renderBufferPolylineCollection.js +6 -3
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -4
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
- package/Source/Shaders/GlobeFS.glsl +20 -14
- package/Source/Shaders/GlobeFS.js +20 -14
- package/Source/Shaders/GlobeVS.glsl +0 -32
- package/Source/Shaders/GlobeVS.js +0 -32
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
- package/Source/Shaders/Model/MaterialStageFS.js +8 -2
- 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 +109 -0
- package/Source/Shaders/Model/ModelFS.js +109 -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 +305 -0
- package/Source/Shaders/VectorCommon.js +307 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/index.d.ts +1326 -65
- package/index.js +179 -155
- package/package.json +6 -6
- 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
|
@@ -346,6 +346,100 @@ DerivedCommand.createPickDerivedCommand = function (
|
|
|
346
346
|
return result;
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
+
// Repacks an RGBA8-normalized pick color into the uint32 pick ID so it can be
|
|
350
|
+
// carried losslessly in the R channel of the RGBA32F snap framebuffer.
|
|
351
|
+
// Injected only into snap-derived shaders; referenced by DrawCommand.snapId
|
|
352
|
+
// expressions built in PickingPipelineStage.
|
|
353
|
+
const snapHelperSource = `uint rgba8UnormToUint32(vec4 c)
|
|
354
|
+
{
|
|
355
|
+
uvec4 b = uvec4(c * 255.0 + 0.5);
|
|
356
|
+
return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u);
|
|
357
|
+
}
|
|
358
|
+
`;
|
|
359
|
+
|
|
360
|
+
function getSnapShaderProgram(context, shaderProgram, snapId) {
|
|
361
|
+
const cachedShader = context.shaderCache.getDerivedShaderProgram(
|
|
362
|
+
shaderProgram,
|
|
363
|
+
"snap",
|
|
364
|
+
);
|
|
365
|
+
if (defined(cachedShader)) {
|
|
366
|
+
return cachedShader;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const attributeLocations = shaderProgram._attributeLocations;
|
|
370
|
+
const { sources, defines } = shaderProgram.fragmentShaderSource;
|
|
371
|
+
|
|
372
|
+
const hasFragData = sources.some((source) => source.includes("out_FragData"));
|
|
373
|
+
const outputColorVariable = hasFragData ? "out_FragData_0" : "out_FragColor";
|
|
374
|
+
const newMain = `${snapHelperSource}
|
|
375
|
+
void main ()
|
|
376
|
+
{
|
|
377
|
+
czm_non_snap_main();
|
|
378
|
+
if (${outputColorVariable}.a == 0.0) {
|
|
379
|
+
discard;
|
|
380
|
+
}
|
|
381
|
+
${outputColorVariable} = ${snapId};
|
|
382
|
+
} `;
|
|
383
|
+
|
|
384
|
+
const length = sources.length;
|
|
385
|
+
const newSources = new Array(length + 1);
|
|
386
|
+
for (let i = 0; i < length; ++i) {
|
|
387
|
+
newSources[i] = ShaderSource.replaceMain(sources[i], "czm_non_snap_main");
|
|
388
|
+
}
|
|
389
|
+
newSources[length] = newMain;
|
|
390
|
+
const fragmentShaderSource = new ShaderSource({
|
|
391
|
+
sources: newSources,
|
|
392
|
+
defines: defines,
|
|
393
|
+
});
|
|
394
|
+
return context.shaderCache.createDerivedShaderProgram(shaderProgram, "snap", {
|
|
395
|
+
vertexShaderSource: shaderProgram.vertexShaderSource,
|
|
396
|
+
fragmentShaderSource: fragmentShaderSource,
|
|
397
|
+
attributeLocations: attributeLocations,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Derives the command used during a snapping pass (see Scene#snap). Identical
|
|
403
|
+
* in structure to the pick derived command, but the fragment shader writes the
|
|
404
|
+
* float snap payload (DrawCommand.snapId) into the RGBA32F snap framebuffer
|
|
405
|
+
* instead of the RGBA8 pick color.
|
|
406
|
+
*
|
|
407
|
+
* @private
|
|
408
|
+
*/
|
|
409
|
+
DerivedCommand.createSnapDerivedCommand = function (
|
|
410
|
+
scene,
|
|
411
|
+
command,
|
|
412
|
+
context,
|
|
413
|
+
result,
|
|
414
|
+
) {
|
|
415
|
+
if (!defined(result)) {
|
|
416
|
+
result = {};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const shader = result.snapCommand?.shaderProgram;
|
|
420
|
+
const renderState = result.snapCommand?.renderState;
|
|
421
|
+
|
|
422
|
+
result.snapCommand = DrawCommand.shallowClone(command, result.snapCommand);
|
|
423
|
+
|
|
424
|
+
if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {
|
|
425
|
+
result.snapCommand.shaderProgram = getSnapShaderProgram(
|
|
426
|
+
context,
|
|
427
|
+
command.shaderProgram,
|
|
428
|
+
command.snapId,
|
|
429
|
+
);
|
|
430
|
+
result.snapCommand.renderState = getPickRenderState(
|
|
431
|
+
scene,
|
|
432
|
+
command.renderState,
|
|
433
|
+
);
|
|
434
|
+
result.shaderProgramId = command.shaderProgram.id;
|
|
435
|
+
} else {
|
|
436
|
+
result.snapCommand.shaderProgram = shader;
|
|
437
|
+
result.snapCommand.renderState = renderState;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return result;
|
|
441
|
+
};
|
|
442
|
+
|
|
349
443
|
/**
|
|
350
444
|
* Replaces the value of the specified 'define' directive identifier
|
|
351
445
|
* with the given value.
|
|
@@ -9,16 +9,12 @@ import ClearCommand from "../Renderer/ClearCommand.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates and manages framebuffers for edge visibility rendering.
|
|
11
11
|
*
|
|
12
|
-
* @param {Object} options Object with the following properties:
|
|
13
|
-
*
|
|
14
12
|
* @alias EdgeFramebuffer
|
|
15
13
|
* @constructor
|
|
16
14
|
*
|
|
17
15
|
* @private
|
|
18
16
|
*/
|
|
19
|
-
function EdgeFramebuffer(
|
|
20
|
-
options = options || {};
|
|
21
|
-
|
|
17
|
+
function EdgeFramebuffer() {
|
|
22
18
|
// Create framebuffer manager with multiple render targets (MRT)
|
|
23
19
|
// Color attachment 0: edge color output (visualization / debug)
|
|
24
20
|
// Color attachment 1: R: edge type, G: featureId (metadata / ids)
|
|
@@ -190,6 +190,7 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
190
190
|
* @property {boolean} render <code>true</code> if the primitive should update for a render pass, <code>false</code> otherwise.
|
|
191
191
|
* @property {boolean} pick <code>true</code> if the primitive should update for a picking pass, <code>false</code> otherwise.
|
|
192
192
|
* @property {boolean} pickVoxel <code>true</code> if the primitive should update for a voxel picking pass, <code>false</code> otherwise.
|
|
193
|
+
* @property {boolean} snap <code>true</code> if the current picking pass is a snapping pass (see {@link Scene#snap}), <code>false</code> otherwise. Only ever <code>true</code> while <code>pick</code> is also <code>true</code>.
|
|
193
194
|
* @property {boolean} depth <code>true</code> if the primitive should update for a depth only pass, <code>false</code> otherwise.
|
|
194
195
|
* @property {boolean} postProcess <code>true</code> if the primitive should update for a per-feature post-process pass, <code>false</code> otherwise.
|
|
195
196
|
* @property {boolean} offscreen <code>true</code> if the primitive should update for an offscreen pass, <code>false</code> otherwise.
|
|
@@ -211,6 +212,10 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
211
212
|
* @default false
|
|
212
213
|
*/
|
|
213
214
|
pickVoxel: false,
|
|
215
|
+
/**
|
|
216
|
+
* @default false
|
|
217
|
+
*/
|
|
218
|
+
snap: false,
|
|
214
219
|
/**
|
|
215
220
|
* @default false
|
|
216
221
|
*/
|
|
@@ -473,6 +478,18 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
473
478
|
* @private
|
|
474
479
|
*/
|
|
475
480
|
this.edgeVisibilityRequested = false;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Internal toggle indicating that at least one primitive for this frame has
|
|
484
|
+
* the BENTLEY_materials_planar_fill extension present. This allows lazy
|
|
485
|
+
* allocation of the planar fill feature-ID framebuffer.
|
|
486
|
+
* Set by MaterialPipelineStage at draw command build time and renewed
|
|
487
|
+
* per frame by ModelSceneGraph while planar fill primitives render.
|
|
488
|
+
* Consumed by Scene to update its _enablePlanarFillId flag.
|
|
489
|
+
* @type {boolean}
|
|
490
|
+
* @private
|
|
491
|
+
*/
|
|
492
|
+
this.planarFillRequested = false;
|
|
476
493
|
}
|
|
477
494
|
|
|
478
495
|
/**
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
/** @import {GeoJson, GeoJsonFeature, GeoJsonGeometry, GeoJsonPosition} from "../Core/globalTypes.js"; */
|
|
4
|
-
/** @import FrameState from "./FrameState.js"; */
|
|
5
|
-
|
|
6
3
|
import Cartesian2 from "../Core/Cartesian2.js";
|
|
7
4
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
8
5
|
import Check from "../Core/Check.js";
|
|
@@ -11,6 +8,7 @@ import destroyObject from "../Core/destroyObject.js";
|
|
|
11
8
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
12
9
|
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
13
10
|
import Frozen from "../Core/Frozen.js";
|
|
11
|
+
import HeightReference, { isHeightReferenceClamp } from "./HeightReference.js";
|
|
14
12
|
import PolygonPipeline from "../Core/PolygonPipeline.js";
|
|
15
13
|
import Resource from "../Core/Resource.js";
|
|
16
14
|
import RuntimeError from "../Core/RuntimeError.js";
|
|
@@ -20,6 +18,13 @@ import BufferPolygon from "./BufferPolygon.js";
|
|
|
20
18
|
import BufferPolygonCollection from "./BufferPolygonCollection.js";
|
|
21
19
|
import BufferPolyline from "./BufferPolyline.js";
|
|
22
20
|
import BufferPolylineCollection from "./BufferPolylineCollection.js";
|
|
21
|
+
import assert from "../Core/assert.js";
|
|
22
|
+
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
23
|
+
|
|
24
|
+
/** @import FrameState from "./FrameState.js"; */
|
|
25
|
+
/** @import Scene from "./Scene.js"; */
|
|
26
|
+
/** @import {GeoJson, GeoJsonFeature, GeoJsonGeometry, GeoJsonPosition} from "../Core/globalTypes.js"; */
|
|
27
|
+
/** @import VectorProvider from "../Core/VectorProvider.js"; */
|
|
23
28
|
|
|
24
29
|
/**
|
|
25
30
|
* @typedef {object} GeoJsonPrimitiveConstructorOptions
|
|
@@ -29,6 +34,9 @@ import BufferPolylineCollection from "./BufferPolylineCollection.js";
|
|
|
29
34
|
* @property {boolean} [allowPicking=true]
|
|
30
35
|
* @property {boolean} [show=true]
|
|
31
36
|
* @property {function(number, object, Record<string, unknown>):object} [pickObjectFactory]
|
|
37
|
+
* @property {HeightReference} [heightReference=HeightReference.NONE] Allows clamping (draping)
|
|
38
|
+
* polylines and polygons on terrain and 3D Tiles. Point clamping is not currently supported.
|
|
39
|
+
* @property {Scene} [scene] Required for primitives that use a clamping {@link HeightReference}.
|
|
32
40
|
*/
|
|
33
41
|
|
|
34
42
|
/**
|
|
@@ -41,14 +49,36 @@ import BufferPolylineCollection from "./BufferPolylineCollection.js";
|
|
|
41
49
|
* added directly to {@link Scene#primitives}.
|
|
42
50
|
*
|
|
43
51
|
* @example
|
|
52
|
+
* // Load GeoJSON
|
|
44
53
|
* const loader = await Cesium.GeoJsonPrimitive.fromUrl("./data.geojson");
|
|
45
54
|
* viewer.scene.primitives.add(loader);
|
|
46
55
|
*
|
|
56
|
+
* @example
|
|
57
|
+
* // Access GeoJSON features and properties
|
|
47
58
|
* loader.points; // BufferPointCollection | undefined
|
|
48
59
|
* loader.polylines; // BufferPolylineCollection | undefined
|
|
49
60
|
* loader.polygons; // BufferPolygonCollection | undefined
|
|
50
61
|
* loader.ids; // source feature IDs
|
|
51
62
|
* loader.properties; // source feature properties
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // Style GeoJSON
|
|
66
|
+
* const material = new Cesium.BufferPolylineMaterial({
|
|
67
|
+
* color: Cesium.Color.RED,
|
|
68
|
+
* width: 4,
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* const polyline = new Cesium.BufferPolyline();
|
|
72
|
+
* const count = primitive.polylines.primitiveCount;
|
|
73
|
+
* for (let i = 0; i < count; i++) {
|
|
74
|
+
* primitive.polylines.get(i, polyline);
|
|
75
|
+
*
|
|
76
|
+
* const properties = primitive.getProperties(polyline.featureId);
|
|
77
|
+
* if (properties.myCustomProperty === true) {
|
|
78
|
+
* polyline.setMaterial(material);
|
|
79
|
+
* }
|
|
80
|
+
* }
|
|
81
|
+
*
|
|
52
82
|
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
53
83
|
*/
|
|
54
84
|
class GeoJsonPrimitive {
|
|
@@ -59,9 +89,7 @@ class GeoJsonPrimitive {
|
|
|
59
89
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
60
90
|
|
|
61
91
|
//>>includeStart('debug', pragmas.debug);
|
|
62
|
-
|
|
63
|
-
throw new DeveloperError("options.geoJson is required.");
|
|
64
|
-
}
|
|
92
|
+
Check.defined("geoJson", options.geoJson);
|
|
65
93
|
//>>includeEnd('debug');
|
|
66
94
|
|
|
67
95
|
const parseResult = parseGeoJson(/** @type {GeoJson} */ (options.geoJson));
|
|
@@ -86,35 +114,62 @@ class GeoJsonPrimitive {
|
|
|
86
114
|
this._polylines = undefined;
|
|
87
115
|
this._polygons = undefined;
|
|
88
116
|
|
|
117
|
+
/**
|
|
118
|
+
* @type {HeightReference}
|
|
119
|
+
* @private
|
|
120
|
+
*/
|
|
121
|
+
this._heightReference = options.heightReference ?? HeightReference.NONE;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @type {Scene|undefined}
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
this._scene = options.scene;
|
|
128
|
+
|
|
129
|
+
const heightReference = this._heightReference;
|
|
130
|
+
const scene = this._scene;
|
|
131
|
+
|
|
132
|
+
//>>includeStart('debug', pragmas.debug);
|
|
133
|
+
assert(
|
|
134
|
+
!isHeightReferenceClamp(heightReference) || defined(scene),
|
|
135
|
+
"Clamped HeightReference requires `options.scene`.",
|
|
136
|
+
);
|
|
137
|
+
//>>includeEnd('debug');
|
|
138
|
+
|
|
89
139
|
if (parseResult.pointCount > 0) {
|
|
90
|
-
|
|
91
|
-
|
|
140
|
+
//>>includeStart('debug', pragmas.debug);
|
|
141
|
+
if (isHeightReferenceClamp(heightReference)) {
|
|
142
|
+
oneTimeWarning(
|
|
143
|
+
"geojson-heightref",
|
|
144
|
+
"Clamped HeightReference unsupported on BufferPointCollection.",
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
//>>includeEnd('debug');
|
|
148
|
+
|
|
149
|
+
this._points = new BufferPointCollection({
|
|
92
150
|
primitiveCountMax: parseResult.pointCount,
|
|
93
151
|
allowPicking: allowPicking,
|
|
94
|
-
};
|
|
95
|
-
this._points = new BufferPointCollection(pointOptions);
|
|
152
|
+
});
|
|
96
153
|
}
|
|
97
154
|
|
|
98
155
|
if (parseResult.polylineCount > 0) {
|
|
99
|
-
|
|
100
|
-
const polylineOptions = {
|
|
156
|
+
this._polylines = new BufferPolylineCollection({
|
|
101
157
|
primitiveCountMax: parseResult.polylineCount,
|
|
102
158
|
vertexCountMax: parseResult.polylineVertexCount,
|
|
103
159
|
allowPicking: allowPicking,
|
|
104
|
-
|
|
105
|
-
|
|
160
|
+
heightReference,
|
|
161
|
+
});
|
|
106
162
|
}
|
|
107
163
|
|
|
108
164
|
if (parseResult.polygonCount > 0) {
|
|
109
|
-
|
|
110
|
-
const polygonOptions = {
|
|
165
|
+
this._polygons = new BufferPolygonCollection({
|
|
111
166
|
primitiveCountMax: parseResult.polygonCount,
|
|
112
167
|
vertexCountMax: parseResult.polygonVertexCount,
|
|
113
168
|
holeCountMax: parseResult.polygonHoleCount,
|
|
114
169
|
triangleCountMax: parseResult.polygonTriangleCount,
|
|
115
170
|
allowPicking: allowPicking,
|
|
116
|
-
|
|
117
|
-
|
|
171
|
+
heightReference,
|
|
172
|
+
});
|
|
118
173
|
}
|
|
119
174
|
|
|
120
175
|
const scratch = new Cartesian3();
|
|
@@ -338,30 +393,65 @@ class GeoJsonPrimitive {
|
|
|
338
393
|
return;
|
|
339
394
|
}
|
|
340
395
|
|
|
341
|
-
|
|
342
|
-
|
|
396
|
+
const points = this._points;
|
|
397
|
+
const polylines = this._polylines;
|
|
398
|
+
const polygons = this._polygons;
|
|
399
|
+
const frameNumber = frameState.frameNumber;
|
|
400
|
+
const heightReference = this._heightReference;
|
|
401
|
+
|
|
402
|
+
const vectorProvider = isHeightReferenceClamp(heightReference)
|
|
403
|
+
? // @ts-expect-error Missing types, non-ES6 class.
|
|
404
|
+
/** @type {VectorProvider} */ (this._scene.vectorProvider)
|
|
405
|
+
: null;
|
|
406
|
+
|
|
407
|
+
if (defined(points)) {
|
|
408
|
+
points.update(frameState);
|
|
343
409
|
}
|
|
344
|
-
|
|
345
|
-
|
|
410
|
+
|
|
411
|
+
if (defined(polylines)) {
|
|
412
|
+
if (defined(vectorProvider)) {
|
|
413
|
+
vectorProvider.markForFrame(polylines, frameNumber, heightReference);
|
|
414
|
+
} else {
|
|
415
|
+
polylines.update(frameState);
|
|
416
|
+
}
|
|
346
417
|
}
|
|
347
|
-
|
|
348
|
-
|
|
418
|
+
|
|
419
|
+
if (defined(polygons)) {
|
|
420
|
+
if (defined(vectorProvider)) {
|
|
421
|
+
vectorProvider.markForFrame(polygons, frameNumber, heightReference);
|
|
422
|
+
} else {
|
|
423
|
+
polygons.update(frameState);
|
|
424
|
+
}
|
|
349
425
|
}
|
|
350
426
|
}
|
|
351
427
|
|
|
352
428
|
destroy() {
|
|
429
|
+
const vectorProvider = isHeightReferenceClamp(this._heightReference)
|
|
430
|
+
? // @ts-expect-error Missing types, non-ES6 class.
|
|
431
|
+
/** @type {VectorProvider} */ (this._scene.vectorProvider)
|
|
432
|
+
: null;
|
|
433
|
+
|
|
353
434
|
if (this._points) {
|
|
354
435
|
this._points.destroy();
|
|
355
436
|
this._points = undefined;
|
|
356
437
|
}
|
|
438
|
+
|
|
357
439
|
if (this._polylines) {
|
|
440
|
+
if (defined(vectorProvider)) {
|
|
441
|
+
vectorProvider.remove(this._polylines);
|
|
442
|
+
}
|
|
358
443
|
this._polylines.destroy();
|
|
359
444
|
this._polylines = undefined;
|
|
360
445
|
}
|
|
446
|
+
|
|
361
447
|
if (this._polygons) {
|
|
448
|
+
if (defined(vectorProvider)) {
|
|
449
|
+
vectorProvider.remove(this._polygons);
|
|
450
|
+
}
|
|
362
451
|
this._polygons.destroy();
|
|
363
452
|
this._polygons = undefined;
|
|
364
453
|
}
|
|
454
|
+
|
|
365
455
|
return destroyObject(this);
|
|
366
456
|
}
|
|
367
457
|
|
package/Source/Scene/Globe.js
CHANGED
|
@@ -28,6 +28,7 @@ import QuadtreePrimitive from "./QuadtreePrimitive.js";
|
|
|
28
28
|
import SceneMode from "./SceneMode.js";
|
|
29
29
|
import ShadowMode from "./ShadowMode.js";
|
|
30
30
|
import CesiumMath from "../Core/Math.js";
|
|
31
|
+
import VectorProvider from "../Core/VectorProvider.js";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
|
|
@@ -45,6 +46,9 @@ function Globe(ellipsoid) {
|
|
|
45
46
|
ellipsoid: ellipsoid,
|
|
46
47
|
});
|
|
47
48
|
const imageryLayerCollection = new ImageryLayerCollection();
|
|
49
|
+
const vectorProvider = new VectorProvider({
|
|
50
|
+
tilingScheme: terrainProvider.tilingScheme,
|
|
51
|
+
});
|
|
48
52
|
|
|
49
53
|
this._ellipsoid = ellipsoid;
|
|
50
54
|
this._imageryLayerCollection = imageryLayerCollection;
|
|
@@ -57,12 +61,15 @@ function Globe(ellipsoid) {
|
|
|
57
61
|
terrainProvider: terrainProvider,
|
|
58
62
|
imageryLayers: imageryLayerCollection,
|
|
59
63
|
surfaceShaderSet: this._surfaceShaderSet,
|
|
64
|
+
vectorProvider,
|
|
60
65
|
}),
|
|
61
66
|
});
|
|
62
67
|
|
|
63
68
|
this._terrainProvider = terrainProvider;
|
|
64
69
|
this._terrainProviderChanged = new Event();
|
|
65
70
|
|
|
71
|
+
this._vectorProvider = vectorProvider;
|
|
72
|
+
|
|
66
73
|
this._undergroundColor = Color.clone(Color.BLACK);
|
|
67
74
|
this._undergroundColorAlphaByDistance = new NearFarScalar(
|
|
68
75
|
ellipsoid.maximumRadius / 1000.0,
|
|
@@ -515,6 +522,9 @@ Object.defineProperties(Globe.prototype, {
|
|
|
515
522
|
set: function (value) {
|
|
516
523
|
if (value !== this._terrainProvider) {
|
|
517
524
|
this._terrainProvider = value;
|
|
525
|
+
if (defined(value)) {
|
|
526
|
+
this._vectorProvider.tilingScheme = value.tilingScheme;
|
|
527
|
+
}
|
|
518
528
|
this._terrainProviderChanged.raiseEvent(value);
|
|
519
529
|
if (defined(this._material)) {
|
|
520
530
|
makeShadersDirty(this);
|
|
@@ -534,6 +544,16 @@ Object.defineProperties(Globe.prototype, {
|
|
|
534
544
|
return this._terrainProviderChanged;
|
|
535
545
|
},
|
|
536
546
|
},
|
|
547
|
+
/**
|
|
548
|
+
* @memberof Globe.prototype
|
|
549
|
+
* @type {VectorProvider}
|
|
550
|
+
* @ignore
|
|
551
|
+
*/
|
|
552
|
+
vectorProvider: {
|
|
553
|
+
get: function () {
|
|
554
|
+
return this._vectorProvider;
|
|
555
|
+
},
|
|
556
|
+
},
|
|
537
557
|
/**
|
|
538
558
|
* Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty,
|
|
539
559
|
* all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
|
|
@@ -2,6 +2,7 @@ import BoundingRectangle from "../Core/BoundingRectangle.js";
|
|
|
2
2
|
import Color from "../Core/Color.js";
|
|
3
3
|
import defined from "../Core/defined.js";
|
|
4
4
|
import destroyObject from "../Core/destroyObject.js";
|
|
5
|
+
import PixelFormat from "../Core/PixelFormat.js";
|
|
5
6
|
import ClearCommand from "../Renderer/ClearCommand.js";
|
|
6
7
|
import FramebufferManager from "../Renderer/FramebufferManager.js";
|
|
7
8
|
import PixelDatatype from "../Renderer/PixelDatatype.js";
|
|
@@ -21,6 +22,7 @@ import StencilOperation from "./StencilOperation.js";
|
|
|
21
22
|
*/
|
|
22
23
|
function GlobeDepth() {
|
|
23
24
|
this._picking = false;
|
|
25
|
+
this._snapping = false;
|
|
24
26
|
this._numSamples = 1;
|
|
25
27
|
this._tempCopyDepthTexture = undefined;
|
|
26
28
|
|
|
@@ -28,6 +30,16 @@ function GlobeDepth() {
|
|
|
28
30
|
depthStencil: true,
|
|
29
31
|
supportsDepthTexture: true,
|
|
30
32
|
});
|
|
33
|
+
// Float twin of the pick color framebuffer, used during a snapping pass
|
|
34
|
+
// (see Scene#snap). RGBA32F so each pixel can carry the snap payload
|
|
35
|
+
// (uint32 pick ID, isEdge flag, eye-space depth). GPU resources are only
|
|
36
|
+
// allocated on first use (FramebufferManager allocates lazily in update).
|
|
37
|
+
this._snapColorFramebuffer = new FramebufferManager({
|
|
38
|
+
depthStencil: true,
|
|
39
|
+
supportsDepthTexture: true,
|
|
40
|
+
pixelDatatype: PixelDatatype.FLOAT,
|
|
41
|
+
pixelFormat: PixelFormat.RGBA,
|
|
42
|
+
});
|
|
31
43
|
this._outputFramebuffer = new FramebufferManager({
|
|
32
44
|
depthStencil: true,
|
|
33
45
|
supportsDepthTexture: true,
|
|
@@ -61,6 +73,9 @@ function GlobeDepth() {
|
|
|
61
73
|
Object.defineProperties(GlobeDepth.prototype, {
|
|
62
74
|
colorFramebufferManager: {
|
|
63
75
|
get: function () {
|
|
76
|
+
if (this._snapping) {
|
|
77
|
+
return this._snapColorFramebuffer;
|
|
78
|
+
}
|
|
64
79
|
return this._picking
|
|
65
80
|
? this._pickColorFramebuffer
|
|
66
81
|
: this._outputFramebuffer;
|
|
@@ -84,6 +99,14 @@ Object.defineProperties(GlobeDepth.prototype, {
|
|
|
84
99
|
this._picking = value;
|
|
85
100
|
},
|
|
86
101
|
},
|
|
102
|
+
snapping: {
|
|
103
|
+
get: function () {
|
|
104
|
+
return this._snapping;
|
|
105
|
+
},
|
|
106
|
+
set: function (value) {
|
|
107
|
+
this._snapping = value;
|
|
108
|
+
},
|
|
109
|
+
},
|
|
87
110
|
});
|
|
88
111
|
|
|
89
112
|
function updateCopyCommands(globeDepth, context, width, height, passState) {
|
|
@@ -260,7 +283,9 @@ GlobeDepth.prototype.update = function (
|
|
|
260
283
|
: PixelDatatype.FLOAT
|
|
261
284
|
: PixelDatatype.UNSIGNED_BYTE;
|
|
262
285
|
this._numSamples = numSamples;
|
|
263
|
-
if (this.
|
|
286
|
+
if (this.snapping) {
|
|
287
|
+
this._snapColorFramebuffer.update(context, width, height);
|
|
288
|
+
} else if (this.picking) {
|
|
264
289
|
this._pickColorFramebuffer.update(context, width, height);
|
|
265
290
|
} else {
|
|
266
291
|
this._outputFramebuffer.update(
|
|
@@ -377,6 +402,7 @@ GlobeDepth.prototype.isDestroyed = function () {
|
|
|
377
402
|
|
|
378
403
|
GlobeDepth.prototype.destroy = function () {
|
|
379
404
|
this._pickColorFramebuffer.destroy();
|
|
405
|
+
this._snapColorFramebuffer.destroy();
|
|
380
406
|
this._outputFramebuffer.destroy();
|
|
381
407
|
this._copyDepthFramebuffer.destroy();
|
|
382
408
|
this._tempCopyDepthFramebuffer.destroy();
|
|
@@ -4,6 +4,7 @@ import defined from "../Core/defined.js";
|
|
|
4
4
|
import destroyObject from "../Core/destroyObject.js";
|
|
5
5
|
import TerrainQuantization from "../Core/TerrainQuantization.js";
|
|
6
6
|
import ShaderProgram from "../Renderer/ShaderProgram.js";
|
|
7
|
+
import VectorCommon from "../Shaders/VectorCommon.js";
|
|
7
8
|
import getClippingFunction from "./getClippingFunction.js";
|
|
8
9
|
import SceneMode from "./SceneMode.js";
|
|
9
10
|
|
|
@@ -81,7 +82,8 @@ class GlobeSurfaceShader {
|
|
|
81
82
|
* @property {boolean} [hasExaggeration]
|
|
82
83
|
* @property {boolean} [showUndergroundColor]
|
|
83
84
|
* @property {boolean} [translucent]
|
|
84
|
-
* @
|
|
85
|
+
* @property {boolean} [vectorAntialias]
|
|
86
|
+
* @private
|
|
85
87
|
*/
|
|
86
88
|
|
|
87
89
|
/**
|
|
@@ -138,6 +140,14 @@ class GlobeSurfaceShaderSet {
|
|
|
138
140
|
const hasExaggeration = options.hasExaggeration;
|
|
139
141
|
const showUndergroundColor = options.showUndergroundColor;
|
|
140
142
|
const translucent = options.translucent;
|
|
143
|
+
const vectorData = surfaceTile.vectorData;
|
|
144
|
+
const hasVectorLayer = vectorData?.show;
|
|
145
|
+
const hasVectorPolylines = hasVectorLayer && vectorData.hasPolylines;
|
|
146
|
+
const hasVectorPolygons = hasVectorLayer && vectorData.hasPolygons;
|
|
147
|
+
const vectorAntialias = hasVectorLayer && options.vectorAntialias;
|
|
148
|
+
const vectorWidthInMeters = hasVectorPolylines && vectorData.hasMeterWidths;
|
|
149
|
+
const vectorMixedWidthUnits =
|
|
150
|
+
vectorWidthInMeters && vectorData.hasPixelWidths;
|
|
141
151
|
|
|
142
152
|
let quantization = 0;
|
|
143
153
|
let quantizationDefine = "";
|
|
@@ -201,7 +211,13 @@ class GlobeSurfaceShaderSet {
|
|
|
201
211
|
(+showUndergroundColor << 30) |
|
|
202
212
|
(+translucent << 31)) >>>
|
|
203
213
|
0) +
|
|
204
|
-
(applyDayNightAlpha ? 0x100000000 : 0)
|
|
214
|
+
(applyDayNightAlpha ? 0x100000000 : 0) +
|
|
215
|
+
(hasVectorLayer ? 0x200000000 : 0) +
|
|
216
|
+
(hasVectorPolylines ? 0x400000000 : 0) +
|
|
217
|
+
(hasVectorPolygons ? 0x800000000 : 0) +
|
|
218
|
+
(vectorAntialias ? 0x1000000000 : 0) +
|
|
219
|
+
(vectorWidthInMeters ? 0x2000000000 : 0) +
|
|
220
|
+
(vectorMixedWidthUnits ? 0x4000000000 : 0);
|
|
205
221
|
|
|
206
222
|
let currentClippingShaderState = 0;
|
|
207
223
|
// @ts-expect-error Missing types.
|
|
@@ -259,12 +275,6 @@ class GlobeSurfaceShaderSet {
|
|
|
259
275
|
);
|
|
260
276
|
}
|
|
261
277
|
|
|
262
|
-
// Need to go before GlobeFS
|
|
263
|
-
if (currentClippingPolygonsShaderState !== 0) {
|
|
264
|
-
fs.sources.unshift(getPolygonClippingFunction(frameState.context));
|
|
265
|
-
vs.sources.unshift(getUnpackClippingFunction(frameState.context));
|
|
266
|
-
}
|
|
267
|
-
|
|
268
278
|
vs.defines.push(quantizationDefine);
|
|
269
279
|
fs.defines.push(
|
|
270
280
|
`TEXTURE_UNITS ${numberOfDayTextures}`,
|
|
@@ -360,20 +370,10 @@ class GlobeSurfaceShaderSet {
|
|
|
360
370
|
|
|
361
371
|
if (enableClippingPolygons) {
|
|
362
372
|
fs.defines.push("ENABLE_CLIPPING_POLYGONS");
|
|
363
|
-
vs.defines.push("ENABLE_CLIPPING_POLYGONS");
|
|
364
373
|
|
|
365
374
|
if (clippingPolygons.inverse) {
|
|
366
375
|
fs.defines.push("CLIPPING_INVERSE");
|
|
367
376
|
}
|
|
368
|
-
|
|
369
|
-
fs.defines.push(
|
|
370
|
-
// @ts-expect-error Missing types.
|
|
371
|
-
`CLIPPING_POLYGON_REGIONS_LENGTH ${clippingPolygons.extentsCount}`,
|
|
372
|
-
);
|
|
373
|
-
vs.defines.push(
|
|
374
|
-
// @ts-expect-error Missing types.
|
|
375
|
-
`CLIPPING_POLYGON_REGIONS_LENGTH ${clippingPolygons.extentsCount}`,
|
|
376
|
-
);
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
if (colorCorrect) {
|
|
@@ -392,6 +392,30 @@ class GlobeSurfaceShaderSet {
|
|
|
392
392
|
vs.defines.push("EXAGGERATION");
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
+
if (hasVectorLayer) {
|
|
396
|
+
fs.defines.push("HAS_VECTOR_LAYER");
|
|
397
|
+
if (hasVectorPolylines) {
|
|
398
|
+
fs.defines.push("HAS_VECTOR_POLYLINES");
|
|
399
|
+
}
|
|
400
|
+
if (hasVectorPolygons) {
|
|
401
|
+
fs.defines.push("HAS_VECTOR_POLYGONS");
|
|
402
|
+
}
|
|
403
|
+
if (vectorAntialias) {
|
|
404
|
+
fs.defines.push("VECTOR_ANTIALIAS");
|
|
405
|
+
}
|
|
406
|
+
if (vectorWidthInMeters) {
|
|
407
|
+
fs.defines.push("VECTOR_WIDTH_IN_METERS");
|
|
408
|
+
}
|
|
409
|
+
if (vectorMixedWidthUnits) {
|
|
410
|
+
fs.defines.push("VECTOR_WIDTH_MIXED_UNITS");
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Polygon clipping builds on top of the same machinery vector rendering uses
|
|
415
|
+
if (hasVectorLayer || enableClippingPolygons) {
|
|
416
|
+
fs.sources.unshift(VectorCommon);
|
|
417
|
+
}
|
|
418
|
+
|
|
395
419
|
let computeDayColor =
|
|
396
420
|
"\
|
|
397
421
|
vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\n\
|
|
@@ -528,41 +552,6 @@ function getPositionMode(sceneMode) {
|
|
|
528
552
|
return positionMode;
|
|
529
553
|
}
|
|
530
554
|
|
|
531
|
-
/**
|
|
532
|
-
* @param {Context} context
|
|
533
|
-
* @ignore
|
|
534
|
-
*/
|
|
535
|
-
function getPolygonClippingFunction(context) {
|
|
536
|
-
// return a noop for webgl1
|
|
537
|
-
// @ts-expect-error Missing types.
|
|
538
|
-
if (!context.webgl2) {
|
|
539
|
-
return `void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
|
|
540
|
-
}`;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
return `void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
|
|
544
|
-
czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
|
|
545
|
-
}`;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* @param {Context} context
|
|
550
|
-
* @ignore
|
|
551
|
-
*/
|
|
552
|
-
function getUnpackClippingFunction(context) {
|
|
553
|
-
// return a noop for webgl1
|
|
554
|
-
// @ts-expect-error Missing types.
|
|
555
|
-
if (!context.webgl2) {
|
|
556
|
-
return `vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
|
|
557
|
-
return vec4();
|
|
558
|
-
}`;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
return `vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
|
|
562
|
-
return czm_unpackClippingExtents(extentsTexture, index);
|
|
563
|
-
}`;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
555
|
/**
|
|
567
556
|
* @param {boolean} useWebMercatorProjection
|
|
568
557
|
* @returns {string}
|