@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
|
@@ -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";
|
|
@@ -640,8 +642,10 @@ function createStageOutputTextureFunction(stage, name) {
|
|
|
640
642
|
function updateUniformTextures(stage, context) {
|
|
641
643
|
const texturesToRelease = stage._texturesToRelease;
|
|
642
644
|
for (let i = 0; i < texturesToRelease.length; ++i) {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
+
const texture = texturesToRelease[i];
|
|
646
|
+
if (defined(texture)) {
|
|
647
|
+
texture.destroy();
|
|
648
|
+
}
|
|
645
649
|
}
|
|
646
650
|
texturesToRelease.length = 0;
|
|
647
651
|
|
|
@@ -794,6 +798,19 @@ function createSelectedTexture(stage, context) {
|
|
|
794
798
|
}
|
|
795
799
|
}
|
|
796
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
|
+
|
|
797
814
|
if (features.length === 0 || textureLength === 0) {
|
|
798
815
|
// max pick id is reserved
|
|
799
816
|
const empty = new Uint8Array([255, 255, 255, 255]);
|
|
@@ -812,13 +829,14 @@ function createSelectedTexture(stage, context) {
|
|
|
812
829
|
}
|
|
813
830
|
|
|
814
831
|
let offset = 0;
|
|
815
|
-
const
|
|
816
|
-
|
|
832
|
+
const idByteLength = textureLength * 4;
|
|
833
|
+
const ids = new Uint8Array(idByteLength);
|
|
834
|
+
for (let i = 0; i < features.length && offset < idByteLength; ++i) {
|
|
817
835
|
const feature = features[i];
|
|
818
836
|
if (defined(feature.pickIds)) {
|
|
819
837
|
const pickIds = feature.pickIds;
|
|
820
838
|
const pickIdsLength = pickIds.length;
|
|
821
|
-
for (let j = 0; j < pickIdsLength; ++j) {
|
|
839
|
+
for (let j = 0; j < pickIdsLength && offset < idByteLength; ++j) {
|
|
822
840
|
const pickColor = pickIds[j].color;
|
|
823
841
|
ids[offset] = Color.floatToByte(pickColor.red);
|
|
824
842
|
ids[offset + 1] = Color.floatToByte(pickColor.green);
|
|
@@ -997,4 +1015,7 @@ PostProcessStage.prototype.destroy = function () {
|
|
|
997
1015
|
releaseResources(this);
|
|
998
1016
|
return destroyObject(this);
|
|
999
1017
|
};
|
|
1018
|
+
|
|
1019
|
+
// Exposed for testing
|
|
1020
|
+
PostProcessStage._oneTimeWarning = oneTimeWarning;
|
|
1000
1021
|
export default PostProcessStage;
|
|
@@ -419,7 +419,7 @@ ResourceCache.getSpzLoader = function (options) {
|
|
|
419
419
|
|
|
420
420
|
const cacheKey = ResourceCacheKey.getSpzCacheKey({
|
|
421
421
|
gltf: gltf,
|
|
422
|
-
|
|
422
|
+
spz: spz,
|
|
423
423
|
gltfResource: gltfResource,
|
|
424
424
|
baseResource: baseResource,
|
|
425
425
|
});
|
|
@@ -453,13 +453,14 @@ ResourceCache.getSpzLoader = function (options) {
|
|
|
453
453
|
* @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
|
|
454
454
|
* @param {object} [options.primitive] The primitive containing the Draco extension.
|
|
455
455
|
* @param {object} [options.draco] The Draco extension object.
|
|
456
|
+
* @param {object} [options.spz] The SPZ extension object.
|
|
456
457
|
* @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
|
|
457
458
|
* @param {number} [options.accessorId] The accessor ID.
|
|
458
459
|
* @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.
|
|
459
460
|
* @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.
|
|
460
461
|
* @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
|
|
461
462
|
* @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
|
|
462
|
-
* @exception {DeveloperError}
|
|
463
|
+
* @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
|
|
463
464
|
* @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
|
|
464
465
|
* @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.
|
|
465
466
|
*
|
|
@@ -503,9 +504,11 @@ ResourceCache.getVertexBufferLoader = function (options) {
|
|
|
503
504
|
const hasAccessorId = defined(accessorId);
|
|
504
505
|
const hasSpz = defined(spz);
|
|
505
506
|
|
|
506
|
-
|
|
507
|
+
const sourceCount =
|
|
508
|
+
Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
|
|
509
|
+
if (sourceCount !== 1) {
|
|
507
510
|
throw new DeveloperError(
|
|
508
|
-
"
|
|
511
|
+
"Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
|
|
509
512
|
);
|
|
510
513
|
}
|
|
511
514
|
|
|
@@ -71,8 +71,8 @@ function getDracoCacheKey(gltf, draco, gltfResource, baseResource) {
|
|
|
71
71
|
return `${bufferCacheKey}-range-${bufferViewCacheKey}`;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function getSpzCacheKey(gltf,
|
|
75
|
-
const bufferViewId =
|
|
74
|
+
function getSpzCacheKey(gltf, spz, gltfResource, baseResource) {
|
|
75
|
+
const bufferViewId = spz.bufferView;
|
|
76
76
|
const bufferView = gltf.bufferViews[bufferViewId];
|
|
77
77
|
const bufferId = bufferView.buffer;
|
|
78
78
|
const buffer = gltf.buffers[bufferId];
|
|
@@ -292,16 +292,16 @@ ResourceCacheKey.getDracoCacheKey = function (options) {
|
|
|
292
292
|
|
|
293
293
|
ResourceCacheKey.getSpzCacheKey = function (options) {
|
|
294
294
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
295
|
-
const { gltf,
|
|
295
|
+
const { gltf, spz, gltfResource, baseResource } = options;
|
|
296
296
|
|
|
297
297
|
//>>includeStart('debug', pragmas.debug);
|
|
298
298
|
Check.typeOf.object("options.gltf", gltf);
|
|
299
|
-
Check.typeOf.object("options.
|
|
299
|
+
Check.typeOf.object("options.spz", spz);
|
|
300
300
|
Check.typeOf.object("options.gltfResource", gltfResource);
|
|
301
301
|
Check.typeOf.object("options.baseResource", baseResource);
|
|
302
302
|
//>>includeEnd('debug');
|
|
303
303
|
|
|
304
|
-
return `spz:${getSpzCacheKey(gltf,
|
|
304
|
+
return `spz:${getSpzCacheKey(gltf, spz, gltfResource, baseResource)}`;
|
|
305
305
|
};
|
|
306
306
|
/**
|
|
307
307
|
* Gets the vertex buffer cache key.
|
|
@@ -313,11 +313,12 @@ ResourceCacheKey.getSpzCacheKey = function (options) {
|
|
|
313
313
|
* @param {FrameState} options.frameState The frame state.
|
|
314
314
|
* @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
|
|
315
315
|
* @param {object} [options.draco] The Draco extension object.
|
|
316
|
+
* @param {object} [options.spz] The SPZ extension object.
|
|
316
317
|
* @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
|
|
317
318
|
* @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.
|
|
318
319
|
* @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
|
|
319
320
|
* @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
|
|
320
|
-
* @exception {DeveloperError}
|
|
321
|
+
* @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
|
|
321
322
|
* @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
|
|
322
323
|
*
|
|
323
324
|
* @returns {string} The vertex buffer cache key.
|
|
@@ -350,9 +351,11 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
|
|
|
350
351
|
const hasAttributeSemantic = defined(attributeSemantic);
|
|
351
352
|
const hasSpz = defined(spz);
|
|
352
353
|
|
|
353
|
-
|
|
354
|
+
const sourceCount =
|
|
355
|
+
Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
|
|
356
|
+
if (sourceCount !== 1) {
|
|
354
357
|
throw new DeveloperError(
|
|
355
|
-
"
|
|
358
|
+
"Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
|
|
356
359
|
);
|
|
357
360
|
}
|
|
358
361
|
|
|
@@ -388,6 +391,11 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
|
|
|
388
391
|
cacheKeySuffix += "-typed-array";
|
|
389
392
|
}
|
|
390
393
|
|
|
394
|
+
if (defined(spz)) {
|
|
395
|
+
const spzCacheKey = getSpzCacheKey(gltf, spz, gltfResource, baseResource);
|
|
396
|
+
return `vertex-buffer:${spzCacheKey}-spz-${attributeSemantic}${cacheKeySuffix}`;
|
|
397
|
+
}
|
|
398
|
+
|
|
391
399
|
if (defined(draco)) {
|
|
392
400
|
const dracoCacheKey = getDracoCacheKey(
|
|
393
401
|
gltf,
|
|
@@ -398,11 +406,6 @@ ResourceCacheKey.getVertexBufferCacheKey = function (options) {
|
|
|
398
406
|
return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`;
|
|
399
407
|
}
|
|
400
408
|
|
|
401
|
-
if (spz) {
|
|
402
|
-
const spzCacheKey = getSpzCacheKey(gltf, spz, gltfResource, baseResource);
|
|
403
|
-
return `vertex-buffer:${spzCacheKey}-spz-${attributeSemantic}${cacheKeySuffix}`;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
409
|
const bufferView = gltf.bufferViews[bufferViewId];
|
|
407
410
|
const bufferId = bufferView.buffer;
|
|
408
411
|
const buffer = gltf.buffers[bufferId];
|
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";
|
|
@@ -45,6 +46,7 @@ import BrdfLutGenerator from "./BrdfLutGenerator.js";
|
|
|
45
46
|
import Camera from "./Camera.js";
|
|
46
47
|
import Cesium3DTilePass from "./Cesium3DTilePass.js";
|
|
47
48
|
import Cesium3DTilePassState from "./Cesium3DTilePassState.js";
|
|
49
|
+
import ControllerHost from "./Controllers/ControllerHost.js";
|
|
48
50
|
import CreditDisplay from "./CreditDisplay.js";
|
|
49
51
|
import DebugCameraPrimitive from "./DebugCameraPrimitive.js";
|
|
50
52
|
import DepthPlane from "./DepthPlane.js";
|
|
@@ -69,6 +71,7 @@ import SceneTransitioner from "./SceneTransitioner.js";
|
|
|
69
71
|
import ScreenSpaceCameraController from "./ScreenSpaceCameraController.js";
|
|
70
72
|
import ShadowMap from "./ShadowMap.js";
|
|
71
73
|
import SharedContext from "../Renderer/SharedContext.js";
|
|
74
|
+
import Snapping from "./Snapping.js";
|
|
72
75
|
import SpecularEnvironmentCubeMap from "./SpecularEnvironmentCubeMap.js";
|
|
73
76
|
import StencilConstants from "./StencilConstants.js";
|
|
74
77
|
import SunLight from "./SunLight.js";
|
|
@@ -82,6 +85,7 @@ import getMetadataClassProperty from "./getMetadataClassProperty.js";
|
|
|
82
85
|
import PickedMetadataInfo from "./PickedMetadataInfo.js";
|
|
83
86
|
import getMetadataProperty from "./getMetadataProperty.js";
|
|
84
87
|
|
|
88
|
+
/** @ignore */
|
|
85
89
|
const requestRenderAfterFrame = function (scene) {
|
|
86
90
|
return function () {
|
|
87
91
|
scene.frameState.afterRender.push(function () {
|
|
@@ -241,6 +245,8 @@ function Scene(options) {
|
|
|
241
245
|
this._preRender = new Event();
|
|
242
246
|
this._postRender = new Event();
|
|
243
247
|
|
|
248
|
+
this._controllerHost = new ControllerHost();
|
|
249
|
+
|
|
244
250
|
this._minimumDisableDepthTestDistance = 0.0;
|
|
245
251
|
this._debugInspector = new DebugInspector();
|
|
246
252
|
|
|
@@ -770,6 +776,15 @@ function Scene(options) {
|
|
|
770
776
|
*/
|
|
771
777
|
this._enableEdgeVisibility = false;
|
|
772
778
|
|
|
779
|
+
/**
|
|
780
|
+
* Whether or not to enable the planar fill feature-ID pre-pass.
|
|
781
|
+
* Updated each frame from FrameState.planarFillRequested.
|
|
782
|
+
* @type {boolean}
|
|
783
|
+
* @default false
|
|
784
|
+
* @private
|
|
785
|
+
*/
|
|
786
|
+
this._enablePlanarFillId = false;
|
|
787
|
+
|
|
773
788
|
// Give frameState, camera, and screen space camera controller initial state before rendering
|
|
774
789
|
updateFrameNumber(this, 0.0, JulianDate.now());
|
|
775
790
|
this.updateFrameState();
|
|
@@ -1079,6 +1094,25 @@ Object.defineProperties(Scene.prototype, {
|
|
|
1079
1094
|
},
|
|
1080
1095
|
},
|
|
1081
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Collects an array of <code>Controller</code> objects that can be registered with the scene to handle input events, camera animations, and other interactions.
|
|
1099
|
+
* @see {@link Controller}
|
|
1100
|
+
* @type {ControllerHost}
|
|
1101
|
+
* @memberof Scene.prototype
|
|
1102
|
+
* @readonly
|
|
1103
|
+
* @example
|
|
1104
|
+
* scene.screenSpaceCameraController.enableInputs = false;
|
|
1105
|
+
* scene.screenSpaceCameraController.enableCollisionDetection = false;
|
|
1106
|
+
*
|
|
1107
|
+
* const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController();
|
|
1108
|
+
* scene.controllerHost.registerController(tiltOrbitController, scene.canvas.parentNode);
|
|
1109
|
+
*/
|
|
1110
|
+
controllerHost: {
|
|
1111
|
+
get: function () {
|
|
1112
|
+
return this._controllerHost;
|
|
1113
|
+
},
|
|
1114
|
+
},
|
|
1115
|
+
|
|
1082
1116
|
/**
|
|
1083
1117
|
* Gets the controller for camera input handling.
|
|
1084
1118
|
* @memberof Scene.prototype
|
|
@@ -1227,6 +1261,17 @@ Object.defineProperties(Scene.prototype, {
|
|
|
1227
1261
|
},
|
|
1228
1262
|
},
|
|
1229
1263
|
|
|
1264
|
+
/**
|
|
1265
|
+
* @memberof Scene.prototype
|
|
1266
|
+
* @type {VectorProvider}
|
|
1267
|
+
* @ignore
|
|
1268
|
+
*/
|
|
1269
|
+
vectorProvider: {
|
|
1270
|
+
get: function () {
|
|
1271
|
+
return this.globe?.vectorProvider;
|
|
1272
|
+
},
|
|
1273
|
+
},
|
|
1274
|
+
|
|
1230
1275
|
/**
|
|
1231
1276
|
* Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
|
|
1232
1277
|
* receive the Scene instance as the first parameter and the current time as the second parameter.
|
|
@@ -1770,6 +1815,16 @@ function updateDerivedCommands(scene, command, shadowsDirty) {
|
|
|
1770
1815
|
derivedCommands.picking,
|
|
1771
1816
|
);
|
|
1772
1817
|
}
|
|
1818
|
+
// Snap derived commands are only created on demand, during a snapping pass,
|
|
1819
|
+
// so applications that never call Scene.snap pay no shader-derivation cost.
|
|
1820
|
+
if (defined(command.snapId) && frameState.passes.snap) {
|
|
1821
|
+
derivedCommands.snapping = DerivedCommand.createSnapDerivedCommand(
|
|
1822
|
+
scene,
|
|
1823
|
+
command,
|
|
1824
|
+
context,
|
|
1825
|
+
derivedCommands.snapping,
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1773
1828
|
if (frameState.pickingMetadata && command.pickMetadataAllowed) {
|
|
1774
1829
|
command.pickedMetadataInfo = frameState.pickedMetadataInfo;
|
|
1775
1830
|
if (defined(command.pickedMetadataInfo)) {
|
|
@@ -1867,12 +1922,17 @@ Scene.prototype.updateDerivedCommands = function (command) {
|
|
|
1867
1922
|
const needsUpdateForMetadataPicking =
|
|
1868
1923
|
frameState.pickingMetadata &&
|
|
1869
1924
|
pickedMetadataInfoChanged(command, frameState);
|
|
1925
|
+
const needsUpdateForSnap =
|
|
1926
|
+
frameState.passes.snap &&
|
|
1927
|
+
defined(command.snapId) &&
|
|
1928
|
+
!defined(derivedCommands.snapping);
|
|
1870
1929
|
command.dirty =
|
|
1871
1930
|
command.dirty ||
|
|
1872
1931
|
needsLogDepthDerivedCommands ||
|
|
1873
1932
|
needsHdrCommands ||
|
|
1874
1933
|
needsDerivedCommands ||
|
|
1875
|
-
needsUpdateForMetadataPicking
|
|
1934
|
+
needsUpdateForMetadataPicking ||
|
|
1935
|
+
needsUpdateForSnap;
|
|
1876
1936
|
|
|
1877
1937
|
if (!command.dirty) {
|
|
1878
1938
|
return;
|
|
@@ -1960,6 +2020,7 @@ Scene.prototype.clearPasses = function (passes) {
|
|
|
1960
2020
|
passes.render = false;
|
|
1961
2021
|
passes.pick = false;
|
|
1962
2022
|
passes.pickVoxel = false;
|
|
2023
|
+
passes.snap = false;
|
|
1963
2024
|
passes.depth = false;
|
|
1964
2025
|
passes.postProcess = false;
|
|
1965
2026
|
passes.offscreen = false;
|
|
@@ -2245,6 +2306,21 @@ function executeCommand(command, scene, passState, debugFramebuffer) {
|
|
|
2245
2306
|
|
|
2246
2307
|
if (passes.pick || passes.depth) {
|
|
2247
2308
|
if (passes.pick && !passes.depth) {
|
|
2309
|
+
if (frameState.passes.snap) {
|
|
2310
|
+
// Snapping pass: only commands with a snap variant write the float
|
|
2311
|
+
// snap payload. Commands without one (no snapId, e.g. globe/terrain)
|
|
2312
|
+
// execute depth-only so they still occlude snappable geometry behind
|
|
2313
|
+
// them without polluting the RGBA32F snap framebuffer with RGBA8
|
|
2314
|
+
// pick colors.
|
|
2315
|
+
if (defined(command.derivedCommands.snapping)) {
|
|
2316
|
+
command = command.derivedCommands.snapping.snapCommand;
|
|
2317
|
+
command.execute(context, passState);
|
|
2318
|
+
} else if (defined(command.derivedCommands.depth)) {
|
|
2319
|
+
command = command.derivedCommands.depth.depthOnlyCommand;
|
|
2320
|
+
command.execute(context, passState);
|
|
2321
|
+
}
|
|
2322
|
+
return;
|
|
2323
|
+
}
|
|
2248
2324
|
if (
|
|
2249
2325
|
frameState.pickingMetadata &&
|
|
2250
2326
|
defined(command.derivedCommands.pickingMetadata)
|
|
@@ -2619,6 +2695,54 @@ function performCesium3DTileEdgesPass(scene, passState, frustumCommands) {
|
|
|
2619
2695
|
passState.framebuffer = originalFramebuffer;
|
|
2620
2696
|
}
|
|
2621
2697
|
|
|
2698
|
+
/**
|
|
2699
|
+
* Execute the planar fill feature-ID pre-pass.
|
|
2700
|
+
*
|
|
2701
|
+
* Non-behind planar fill geometry writes its per-fragment feature ID into the
|
|
2702
|
+
* planar fill ID framebuffer. This allows behind fills in the main 3D tile
|
|
2703
|
+
* pass to check whether the existing pixel belongs to the same logical object.
|
|
2704
|
+
*
|
|
2705
|
+
* @param {Scene} scene
|
|
2706
|
+
* @param {PassState} passState
|
|
2707
|
+
* @param {FrustumCommands} frustumCommands
|
|
2708
|
+
* @private
|
|
2709
|
+
*/
|
|
2710
|
+
function performPlanarFillIdPass(scene, passState, frustumCommands) {
|
|
2711
|
+
const { context } = scene;
|
|
2712
|
+
const { uniformState } = context;
|
|
2713
|
+
|
|
2714
|
+
uniformState.updatePass(Pass.CESIUM_3D_TILE_PLANAR_FILL_ID);
|
|
2715
|
+
|
|
2716
|
+
// Default to a blank texture so shaders always have something to sample.
|
|
2717
|
+
uniformState.planarFillIdTexture = context.defaultTexture;
|
|
2718
|
+
|
|
2719
|
+
const view = scene._view;
|
|
2720
|
+
const fb = view && view.planarFillIdFramebuffer;
|
|
2721
|
+
|
|
2722
|
+
const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_PLANAR_FILL_ID];
|
|
2723
|
+
const commandCount =
|
|
2724
|
+
frustumCommands.indices[Pass.CESIUM_3D_TILE_PLANAR_FILL_ID];
|
|
2725
|
+
|
|
2726
|
+
if (commandCount === 0) {
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
if (scene._enablePlanarFillId && defined(fb) && defined(fb.framebuffer)) {
|
|
2731
|
+
const originalFramebuffer = passState.framebuffer;
|
|
2732
|
+
passState.framebuffer = fb.framebuffer;
|
|
2733
|
+
|
|
2734
|
+
// Clear to (0,0,0,0) — feature ID 0 means "no planar fill here".
|
|
2735
|
+
const clearCommand = fb.getClearCommand(new Color(0.0, 0.0, 0.0, 0.0));
|
|
2736
|
+
clearCommand.execute(context, passState);
|
|
2737
|
+
|
|
2738
|
+
for (let j = 0; j < commandCount; ++j) {
|
|
2739
|
+
executeCommand(commands[j], scene, passState);
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
passState.framebuffer = originalFramebuffer;
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2622
2746
|
/**
|
|
2623
2747
|
* Execute edge commands that should render directly to the main framebuffer
|
|
2624
2748
|
* (EDGES_ONLY mode). These edges bypass the MRT edge framebuffer and render
|
|
@@ -2656,6 +2780,10 @@ function executeCommands(scene, passState) {
|
|
|
2656
2780
|
|
|
2657
2781
|
uniformState.updateCamera(camera);
|
|
2658
2782
|
|
|
2783
|
+
// Ensure planar fill ID texture is always available (even during edge pass)
|
|
2784
|
+
// so that shaders referencing czm_planarFillIdTexture never see undefined.
|
|
2785
|
+
uniformState.planarFillIdTexture = context.defaultTexture;
|
|
2786
|
+
|
|
2659
2787
|
const frustum = createWorkingFrustum(camera);
|
|
2660
2788
|
frustum.near = camera.frustum.near;
|
|
2661
2789
|
frustum.far = camera.frustum.far;
|
|
@@ -2826,6 +2954,23 @@ function executeCommands(scene, passState) {
|
|
|
2826
2954
|
scene.context.defaultTexture;
|
|
2827
2955
|
}
|
|
2828
2956
|
|
|
2957
|
+
// Planar fill feature-ID pre-pass: write feature IDs from non-behind
|
|
2958
|
+
// planar fill geometry so that behind fills can test same-object.
|
|
2959
|
+
performPlanarFillIdPass(scene, passState, frustumCommands);
|
|
2960
|
+
|
|
2961
|
+
if (
|
|
2962
|
+
scene._enablePlanarFillId &&
|
|
2963
|
+
defined(scene._view) &&
|
|
2964
|
+
defined(scene._view.planarFillIdFramebuffer)
|
|
2965
|
+
) {
|
|
2966
|
+
const pfIdTexture = scene._view.planarFillIdFramebuffer.idTexture;
|
|
2967
|
+
uniformState.planarFillIdTexture = defined(pfIdTexture)
|
|
2968
|
+
? pfIdTexture
|
|
2969
|
+
: context.defaultTexture;
|
|
2970
|
+
} else {
|
|
2971
|
+
uniformState.planarFillIdTexture = context.defaultTexture;
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2829
2974
|
if (!useInvertClassification || picking || renderTranslucentDepthForPick) {
|
|
2830
2975
|
// Common/fastest path. Draw 3D Tiles and classification normally.
|
|
2831
2976
|
|
|
@@ -2889,7 +3034,7 @@ function executeCommands(scene, passState) {
|
|
|
2889
3034
|
passState.framebuffer = scene._invertClassification._fbo.framebuffer;
|
|
2890
3035
|
|
|
2891
3036
|
// Draw normally
|
|
2892
|
-
|
|
3037
|
+
performPass(frustumCommands, Pass.CESIUM_3D_TILE);
|
|
2893
3038
|
|
|
2894
3039
|
if (useGlobeDepthFramebuffer) {
|
|
2895
3040
|
scene._invertClassification.prepareTextures(context);
|
|
@@ -3516,6 +3661,56 @@ function executeCommandsInViewport(firstViewport, scene, passState) {
|
|
|
3516
3661
|
|
|
3517
3662
|
const scratchCullingVolume = new CullingVolume();
|
|
3518
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
|
+
|
|
3519
3714
|
/**
|
|
3520
3715
|
* @private
|
|
3521
3716
|
*/
|
|
@@ -3636,10 +3831,11 @@ Scene.prototype.updateEnvironment = function () {
|
|
|
3636
3831
|
);
|
|
3637
3832
|
|
|
3638
3833
|
const envMaps = this.specularEnvironmentMaps;
|
|
3639
|
-
|
|
3834
|
+
const specularEnvironmentCubeMap = this._specularEnvironmentCubeMap;
|
|
3640
3835
|
if (defined(envMaps) && specularEnvironmentCubeMap?.url !== envMaps) {
|
|
3641
|
-
specularEnvironmentCubeMap
|
|
3642
|
-
specularEnvironmentCubeMap
|
|
3836
|
+
if (defined(specularEnvironmentCubeMap)) {
|
|
3837
|
+
specularEnvironmentCubeMap.destroy();
|
|
3838
|
+
}
|
|
3643
3839
|
this._specularEnvironmentCubeMap = new SpecularEnvironmentCubeMap(envMaps);
|
|
3644
3840
|
} else if (!defined(envMaps) && defined(specularEnvironmentCubeMap)) {
|
|
3645
3841
|
specularEnvironmentCubeMap.destroy();
|
|
@@ -3649,6 +3845,8 @@ Scene.prototype.updateEnvironment = function () {
|
|
|
3649
3845
|
if (defined(this._specularEnvironmentCubeMap)) {
|
|
3650
3846
|
this._specularEnvironmentCubeMap.update(frameState);
|
|
3651
3847
|
}
|
|
3848
|
+
|
|
3849
|
+
updateVectorProvider(this, frameState);
|
|
3652
3850
|
};
|
|
3653
3851
|
|
|
3654
3852
|
function updateDebugFrustumPlanes(scene) {
|
|
@@ -3729,6 +3927,7 @@ function updateAndRenderPrimitives(scene) {
|
|
|
3729
3927
|
|
|
3730
3928
|
// Reset per-frame edge visibility request flag before primitives update
|
|
3731
3929
|
frameState.edgeVisibilityRequested = false;
|
|
3930
|
+
frameState.planarFillRequested = false;
|
|
3732
3931
|
|
|
3733
3932
|
scene._groundPrimitives.update(frameState);
|
|
3734
3933
|
scene._primitives.update(frameState);
|
|
@@ -3741,6 +3940,10 @@ function updateAndRenderPrimitives(scene) {
|
|
|
3741
3940
|
scene._enableEdgeVisibility = true;
|
|
3742
3941
|
}
|
|
3743
3942
|
|
|
3943
|
+
// True only while at least one planar fill primitive is rendering;
|
|
3944
|
+
// the request flag is renewed each frame by ModelSceneGraph.
|
|
3945
|
+
scene._enablePlanarFillId = frameState.planarFillRequested;
|
|
3946
|
+
|
|
3744
3947
|
updateDebugFrustumPlanes(scene);
|
|
3745
3948
|
updateShadowMaps(scene);
|
|
3746
3949
|
|
|
@@ -3759,6 +3962,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
|
|
|
3759
3962
|
const picking = passes.pick || passes.pickVoxel;
|
|
3760
3963
|
if (defined(view.globeDepth)) {
|
|
3761
3964
|
view.globeDepth.picking = picking;
|
|
3965
|
+
view.globeDepth.snapping = passes.snap;
|
|
3762
3966
|
}
|
|
3763
3967
|
const useWebVR = environmentState.useWebVR;
|
|
3764
3968
|
|
|
@@ -3864,6 +4068,15 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
|
|
|
3864
4068
|
view.edgeFramebuffer.update(context, view.viewport, scene._hdr);
|
|
3865
4069
|
}
|
|
3866
4070
|
|
|
4071
|
+
// Update planar fill ID framebuffer
|
|
4072
|
+
const usePlanarFillIdFramebuffer = !picking && scene._enablePlanarFillId;
|
|
4073
|
+
if (usePlanarFillIdFramebuffer) {
|
|
4074
|
+
view.planarFillIdFramebuffer.update(context, view.viewport, scene._hdr);
|
|
4075
|
+
} else if (!picking) {
|
|
4076
|
+
// Release GPU resources while unused; recreated on demand by update().
|
|
4077
|
+
view.planarFillIdFramebuffer.releaseResources();
|
|
4078
|
+
}
|
|
4079
|
+
|
|
3867
4080
|
if (useInvertClassification) {
|
|
3868
4081
|
let depthFramebuffer;
|
|
3869
4082
|
if (frameState.invertClassificationColor.alpha === 1.0) {
|
|
@@ -4420,6 +4633,8 @@ Scene.prototype.render = function (time) {
|
|
|
4420
4633
|
time = JulianDate.now();
|
|
4421
4634
|
}
|
|
4422
4635
|
|
|
4636
|
+
this._controllerHost.update(this, time);
|
|
4637
|
+
|
|
4423
4638
|
const cameraChanged = this._view.checkForCameraUpdates(this);
|
|
4424
4639
|
if (cameraChanged) {
|
|
4425
4640
|
this._globeHeightDirty = true;
|
|
@@ -4557,6 +4772,43 @@ Scene.prototype.pick = function (windowPosition, width, height) {
|
|
|
4557
4772
|
return this._picking.pick(this, windowPosition, width, height, 1)[0];
|
|
4558
4773
|
};
|
|
4559
4774
|
|
|
4775
|
+
/**
|
|
4776
|
+
* The result of a snap operation. See {@link Scene#snap}.
|
|
4777
|
+
*
|
|
4778
|
+
* @typedef {object} SceneSnapResult
|
|
4779
|
+
* @property {object} object The snapped primitive or feature.
|
|
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.
|
|
4782
|
+
* @property {Cartesian2} screenPosition The window coordinates of the snap point.
|
|
4783
|
+
* @property {boolean} isEdge <code>true</code> if the snap point lies on an edge; <code>false</code> if it lies on a surface.
|
|
4784
|
+
*
|
|
4785
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
4786
|
+
*/
|
|
4787
|
+
|
|
4788
|
+
/**
|
|
4789
|
+
* Returns the best snap target in a screen-space region around <code>windowPosition</code>.
|
|
4790
|
+
* Edges are preferred over surfaces; among hits of the same kind the one
|
|
4791
|
+
* nearest the cursor wins. Returns <code>undefined</code> if the region contains
|
|
4792
|
+
* no snappable geometry.
|
|
4793
|
+
* <p>
|
|
4794
|
+
* Only primitives rendered through the Model pipeline (e.g. 3D Tiles and glTF
|
|
4795
|
+
* models) are snappable. Snapping requires float color attachments
|
|
4796
|
+
* (WebGL2 with <code>EXT_color_buffer_float</code>); if unsupported, this
|
|
4797
|
+
* function returns <code>undefined</code>.
|
|
4798
|
+
* </p>
|
|
4799
|
+
*
|
|
4800
|
+
* @param {Cartesian2} windowPosition Window coordinates at the center of the search region.
|
|
4801
|
+
* @param {object} [options] Object with the following properties:
|
|
4802
|
+
* @param {number} [options.width=25] Width of the search region in pixels.
|
|
4803
|
+
* @param {number} [options.height=options.width] Height of the search region in pixels.
|
|
4804
|
+
* @returns {SceneSnapResult | undefined} The best snap target in the region, or <code>undefined</code> if there is none.
|
|
4805
|
+
*
|
|
4806
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
4807
|
+
*/
|
|
4808
|
+
Scene.prototype.snap = function (windowPosition, options) {
|
|
4809
|
+
return Snapping.snap(this, windowPosition, options);
|
|
4810
|
+
};
|
|
4811
|
+
|
|
4560
4812
|
/**
|
|
4561
4813
|
* Performs the same operation as Scene.pick but asynchonosly without blocking the main render thread.
|
|
4562
4814
|
* Requires WebGL2 else using fallback.
|
|
@@ -1959,7 +1959,7 @@ function spin3D(controller, startPosition, movement) {
|
|
|
1959
1959
|
scratchMousePosition,
|
|
1960
1960
|
);
|
|
1961
1961
|
if (defined(mousePos)) {
|
|
1962
|
-
let strafing
|
|
1962
|
+
let strafing;
|
|
1963
1963
|
const ray = camera.getPickRay(
|
|
1964
1964
|
movement.startPosition,
|
|
1965
1965
|
pickGlobeScratchRay,
|
|
@@ -2367,7 +2367,6 @@ function zoom3D(controller, startPosition, movement) {
|
|
|
2367
2367
|
if (!defined(controller._globe) && defined(distance)) {
|
|
2368
2368
|
const targetDistance = camera.getMagnitude();
|
|
2369
2369
|
if (targetDistance < distance) {
|
|
2370
|
-
intersection = undefined;
|
|
2371
2370
|
distance = undefined;
|
|
2372
2371
|
}
|
|
2373
2372
|
}
|