@hztxi/cesium-engine 25.0.7 → 26.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/chunk-2NCNUVAT.js +56 -0
- package/Build/Workers/chunk-2ZYRUVVU.js +301 -0
- package/Build/Workers/chunk-36IU7N4V.js +1284 -0
- package/Build/Workers/chunk-3BDLET5S.js +198 -0
- package/Build/Workers/chunk-3PRHI4KX.js +241 -0
- package/Build/Workers/chunk-3R6E2SH4.js +672 -0
- package/Build/Workers/chunk-3ZKKXEXL.js +415 -0
- package/Build/Workers/chunk-47KVKPTO.js +415 -0
- package/Build/Workers/chunk-4N227IPR.js +973 -0
- package/Build/Workers/chunk-4P6OAPBM.js +97 -0
- package/Build/Workers/chunk-4ZOLEPZK.js +519 -0
- package/Build/Workers/chunk-5EF3WWQG.js +352 -0
- package/Build/Workers/chunk-5I76476T.js +288 -0
- package/Build/Workers/chunk-5PBZKBAP.js +511 -0
- package/Build/Workers/chunk-5RVAAW26.js +82 -0
- package/Build/Workers/chunk-5VWK76PO.js +511 -0
- package/Build/Workers/chunk-77DBX23X.js +455 -0
- package/Build/Workers/chunk-7GQOWCSN.js +959 -0
- package/Build/Workers/chunk-7J2ONMKC.js +198 -0
- package/Build/Workers/chunk-7MHUHXZZ.js +219 -0
- package/Build/Workers/chunk-7MQPHOAS.js +455 -0
- package/Build/Workers/chunk-7NJ5O7TP.js +387 -0
- package/Build/Workers/chunk-7Y642MCO.js +352 -0
- package/Build/Workers/chunk-7ZFKBLUE.js +1054 -0
- package/Build/Workers/chunk-A7LGY5XS.js +140 -0
- package/Build/Workers/chunk-AN2NVYL6.js +1483 -0
- package/Build/Workers/chunk-B7PT2VL5.js +630 -0
- package/Build/Workers/chunk-C6XQGBPV.js +476 -0
- package/Build/Workers/chunk-CAEC5DA2.js +57 -0
- package/Build/Workers/chunk-CBCOHH5O.js +837 -0
- package/Build/Workers/chunk-CEMXKBQO.js +1800 -0
- package/Build/Workers/chunk-CKW3STKA.js +1067 -0
- package/Build/Workers/chunk-CV5RICKT.js +1992 -0
- package/Build/Workers/chunk-DBWSISJT.js +56 -0
- package/Build/Workers/chunk-DSBSPPPJ.js +1344 -0
- package/Build/Workers/chunk-DSGLDRTI.js +278 -0
- package/Build/Workers/chunk-DXD7OPSP.js +1992 -0
- package/Build/Workers/chunk-DXECZBSA.js +368 -0
- package/Build/Workers/chunk-DZIRO6ZK.js +682 -0
- package/Build/Workers/chunk-E4CRPGX5.js +140 -0
- package/Build/Workers/chunk-E4IVMEBH.js +52 -0
- package/Build/Workers/chunk-ECN3VUMA.js +73 -0
- package/Build/Workers/chunk-ECSKVHUB.js +476 -0
- package/Build/Workers/chunk-EL4B5CSQ.js +162 -0
- package/Build/Workers/chunk-FAYBQGKO.js +219 -0
- package/Build/Workers/chunk-FGCXPEZM.js +3201 -0
- package/Build/Workers/chunk-FHCRXPA6.js +44 -0
- package/Build/Workers/chunk-FQ42MT7M.js +58 -0
- package/Build/Workers/chunk-FQDYQG4P.js +1284 -0
- package/Build/Workers/chunk-FTCBY5HH.js +138 -0
- package/Build/Workers/chunk-GI5RWJAY.js +101 -0
- package/Build/Workers/chunk-GNLMSDRO.js +945 -0
- package/Build/Workers/chunk-GVUJ6O3R.js +73 -0
- package/Build/Workers/chunk-HCGU7OCG.js +97 -0
- package/Build/Workers/chunk-HRIPVWSC.js +58 -0
- package/Build/Workers/chunk-IC3BR6SC.js +102 -0
- package/Build/Workers/chunk-IU3YAYPT.js +1344 -0
- package/Build/Workers/chunk-J7MZR7B2.js +1483 -0
- package/Build/Workers/chunk-KSIEJYNL.js +3822 -0
- package/Build/Workers/chunk-KT3GG7AW.js +754 -0
- package/Build/Workers/chunk-KYCEM22I.js +1800 -0
- package/Build/Workers/chunk-LJTQW46H.js +57 -0
- package/Build/Workers/chunk-LMQGYJME.js +672 -0
- package/Build/Workers/chunk-LOBYJQA4.js +76 -0
- package/Build/Workers/chunk-LOF32O7F.js +163 -0
- package/Build/Workers/chunk-LOTIJA7D.js +124 -0
- package/Build/Workers/chunk-M7Z3MPAX.js +973 -0
- package/Build/Workers/chunk-MHNLTQHO.js +3201 -0
- package/Build/Workers/chunk-ML7OMD72.js +2342 -0
- package/Build/Workers/chunk-NBTGXEMT.js +945 -0
- package/Build/Workers/chunk-NQZC37F7.js +38 -0
- package/Build/Workers/chunk-O3X3D2Z3.js +352 -0
- package/Build/Workers/chunk-OBUIHPKF.js +352 -0
- package/Build/Workers/chunk-PAEWNYIV.js +138 -0
- package/Build/Workers/chunk-PANJ7YH6.js +102 -0
- package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
- package/Build/Workers/chunk-PIIUGRQD.js +387 -0
- package/Build/Workers/chunk-POKD22OT.js +2719 -0
- package/Build/Workers/chunk-PQMA7MFS.js +9237 -0
- package/Build/Workers/chunk-PURIPUSY.js +682 -0
- package/Build/Workers/chunk-QQZPPXY4.js +3822 -0
- package/Build/Workers/chunk-QXLQLGL2.js +1067 -0
- package/Build/Workers/chunk-RC4YC3VU.js +278 -0
- package/Build/Workers/chunk-RGNNWVR6.js +171 -0
- package/Build/Workers/chunk-SBBIEHYT.js +44 -0
- package/Build/Workers/chunk-SWVZTU6X.js +305 -0
- package/Build/Workers/chunk-T3EUPM5A.js +454 -0
- package/Build/Workers/chunk-TA6IU2XL.js +171 -0
- package/Build/Workers/chunk-TLSGD5TR.js +280 -0
- package/Build/Workers/chunk-TOXDLWKZ.js +368 -0
- package/Build/Workers/chunk-TZBM6TAB.js +124 -0
- package/Build/Workers/chunk-U2OY6MX6.js +398 -0
- package/Build/Workers/chunk-UCY4B5EV.js +288 -0
- package/Build/Workers/chunk-V52FEPCV.js +754 -0
- package/Build/Workers/chunk-VBEXZBG5.js +147 -0
- package/Build/Workers/chunk-VC76B6GM.js +959 -0
- package/Build/Workers/chunk-VCUOYHWC.js +519 -0
- package/Build/Workers/chunk-VJIL5H6K.js +2719 -0
- package/Build/Workers/chunk-VMF7KOGY.js +162 -0
- package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
- package/Build/Workers/chunk-XHT5SVP4.js +52 -0
- package/Build/Workers/chunk-XITBARMZ.js +2342 -0
- package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
- package/Build/Workers/chunk-XZ6HDXKM.js +76 -0
- package/Build/Workers/chunk-Y7NDFEQ3.js +398 -0
- package/Build/Workers/chunk-YBBQDYX2.js +301 -0
- package/Build/Workers/chunk-YHPYPVAB.js +837 -0
- package/Build/Workers/chunk-YNKK6BXY.js +454 -0
- package/Build/Workers/chunk-YRAJ74HR.js +305 -0
- package/Build/Workers/chunk-YULTZK5O.js +147 -0
- package/Build/Workers/chunk-YUNQYP3Z.js +9237 -0
- package/Build/Workers/chunk-Z7BONRW2.js +241 -0
- package/Build/Workers/chunk-ZK2R3DEJ.js +1054 -0
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +18 -18
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +39 -39
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createCorridorGeometry.js +36 -37
- package/Build/Workers/createCorridorOutlineGeometry.js +34 -35
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -20
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +20 -20
- package/Build/Workers/createGeometry.js +25 -24
- package/Build/Workers/createGroundPolylineGeometry.js +26 -26
- package/Build/Workers/createMvtTile.js +111 -19
- package/Build/Workers/createPlaneGeometry.js +18 -18
- package/Build/Workers/createPlaneOutlineGeometry.js +17 -17
- package/Build/Workers/createPolygonGeometry.js +36 -36
- package/Build/Workers/createPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createPolylineGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeGeometry.js +38 -36
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +32 -31
- package/Build/Workers/createRectangleGeometry.js +29 -29
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -23
- package/Build/Workers/createSimplePolylineGeometry.js +26 -26
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
- package/Build/Workers/createVerticesFromHeightmap.js +23 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
- package/Build/Workers/createWallGeometry.js +26 -26
- package/Build/Workers/createWallOutlineGeometry.js +26 -26
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +993 -2334
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingRectangle.js +6 -8
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/Color.js +1 -0
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/CoplanarPolygonGeometry.js +2 -2
- package/Source/Core/CorridorGeometry.js +2 -4
- package/Source/Core/CorridorOutlineGeometry.js +1 -3
- package/Source/Core/EarthOrientationParameters.js +2 -2
- package/Source/Core/EllipseGeometryLibrary.js +2 -2
- package/Source/Core/EllipsoidGeodesic.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +58 -50
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/JulianDate.js +1 -1
- package/Source/Core/LagrangePolynomialApproximation.js +55 -52
- package/Source/Core/LinearApproximation.js +69 -66
- package/Source/Core/MapProjection.js +1 -0
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +3 -3
- package/Source/Core/Matrix3.js +3 -3
- package/Source/Core/Matrix4.js +1 -1
- package/Source/Core/OrthographicFrustum.js +1 -1
- package/Source/Core/PerspectiveFrustum.js +1 -1
- package/Source/Core/PolygonGeometry.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +180 -168
- package/Source/Core/TimeIntervalCollection.js +1 -3
- package/Source/Core/Tipsify.js +1 -1
- package/Source/Core/Transforms.js +5 -1
- package/Source/Core/VectorPipeline.js +1117 -0
- package/Source/Core/VectorProvider.js +429 -0
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +14 -0
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/GeoJsonDataSource.js +0 -1
- package/Source/DataSources/GeometryVisualizer.js +1 -1
- package/Source/DataSources/KmlDataSource.js +529 -557
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/DataSources/PolylineVisualizer.js +1 -1
- package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
- package/Source/Renderer/AutomaticUniforms.js +23 -0
- package/Source/Renderer/Context.js +9 -3
- package/Source/Renderer/DrawCommand.js +22 -0
- package/Source/Renderer/Framebuffer.js +4 -0
- package/Source/Renderer/Pass.js +11 -9
- package/Source/Renderer/Texture.js +12 -1
- package/Source/Renderer/UniformState.js +7 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +2 -1
- package/Source/Scene/BillboardCollection.js +15 -5
- package/Source/Scene/BillboardTexture.js +5 -3
- package/Source/Scene/BufferPointCollection.js +11 -1
- package/Source/Scene/BufferPolygonCollection.js +26 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +105 -32
- package/Source/Scene/Camera.js +85 -9
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/CameraFlightPath.js +7 -4
- package/Source/Scene/Cesium3DTile.js +102 -4
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/Cesium3DTileStyle.js +40 -0
- package/Source/Scene/Cesium3DTileset.js +213 -8
- package/Source/Scene/Cesium3DTilesetTraversal.js +14 -0
- package/Source/Scene/ClippingPlaneCollection.js +4 -4
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/Controllers/Controller.js +63 -0
- package/Source/Scene/Controllers/ControllerHost.js +78 -0
- package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
- package/Source/Scene/Controllers/MouseButton.js +32 -0
- package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
- package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
- package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
- package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
- package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
- package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
- package/Source/Scene/DerivedCommand.js +98 -0
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/FrameState.js +17 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/Globe.js +22 -1
- package/Source/Scene/GlobeDepth.js +27 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +637 -540
- package/Source/Scene/GlobeSurfaceTile.js +575 -398
- package/Source/Scene/GlobeSurfaceTileProvider.js +1412 -1184
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +146 -3
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SLayer.js +1 -1
- package/Source/Scene/I3SNode.js +2 -2
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +190 -6
- package/Source/Scene/Implicit3DTileContent.js +192 -216
- package/Source/Scene/ImplicitTileCoordinates.js +17 -0
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +4 -1
- package/Source/Scene/MVTDataProvider.js +555 -0
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +82 -312
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- package/Source/Scene/Model/I3dmLoader.js +1 -1
- package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
- package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
- package/Source/Scene/Model/Model.js +45 -10
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelDrawCommand.js +180 -8
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelSceneGraph.js +21 -0
- package/Source/Scene/Model/ModelUtility.js +5 -0
- package/Source/Scene/Model/PickingPipelineStage.js +29 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +645 -153
- package/Source/Scene/ModelComponents.js +112 -0
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/MvtLabelCandidates.js +295 -0
- package/Source/Scene/MvtLabelManager.js +1069 -0
- package/Source/Scene/Picking.js +19 -3
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +1 -1
- package/Source/Scene/PolylineCollection.js +5 -3
- package/Source/Scene/PostProcessStage.js +4 -2
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +21 -18
- package/Source/Scene/Scene.js +237 -11
- package/Source/Scene/SceneTransforms.js +6 -5
- package/Source/Scene/ShadowMap.js +9 -3
- package/Source/Scene/ShadowMapShader.js +50 -2
- package/Source/Scene/SnapFramebuffer.js +121 -0
- package/Source/Scene/Snapping.js +184 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +543 -0
- package/Source/Scene/Vector3DTileContent.js +207 -237
- package/Source/Scene/VectorGltf3DTileContent.js +185 -45
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/buildVectorGltfFromMVT.js +1208 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/decodeMVT.js +877 -0
- package/Source/Scene/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +114 -64
- package/Source/Scene/renderBufferPolygonCollection.js +245 -53
- package/Source/Scene/renderBufferPolylineCollection.js +271 -145
- package/Source/Shaders/BillboardCollectionVS.glsl +23 -25
- package/Source/Shaders/BillboardCollectionVS.js +23 -25
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +13 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +22 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +23 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/GlobeFS.glsl +10 -6
- package/Source/Shaders/GlobeFS.js +10 -6
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
- package/Source/Shaders/Model/MaterialStageFS.js +8 -2
- package/Source/Shaders/Model/ModelFS.glsl +105 -0
- package/Source/Shaders/Model/ModelFS.js +105 -0
- package/Source/Shaders/VectorCommon.glsl +178 -0
- package/Source/Shaders/VectorCommon.js +180 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/Source/Workers/createMvtTile.js +39 -0
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.js +113 -83
- package/package.json +13 -13
package/Source/Scene/Scene.js
CHANGED
|
@@ -45,6 +45,7 @@ import BrdfLutGenerator from "./BrdfLutGenerator.js";
|
|
|
45
45
|
import Camera from "./Camera.js";
|
|
46
46
|
import Cesium3DTilePass from "./Cesium3DTilePass.js";
|
|
47
47
|
import Cesium3DTilePassState from "./Cesium3DTilePassState.js";
|
|
48
|
+
import ControllerHost from "./Controllers/ControllerHost.js";
|
|
48
49
|
import ColumbusWorlds from "./ColumbusWorlds.js";
|
|
49
50
|
import CreditDisplay from "./CreditDisplay.js";
|
|
50
51
|
import DebugCameraPrimitive from "./DebugCameraPrimitive.js";
|
|
@@ -70,6 +71,7 @@ import SceneTransitioner from "./SceneTransitioner.js";
|
|
|
70
71
|
import ScreenSpaceCameraController from "./ScreenSpaceCameraController.js";
|
|
71
72
|
import ShadowMap from "./ShadowMap.js";
|
|
72
73
|
import SharedContext from "../Renderer/SharedContext.js";
|
|
74
|
+
import Snapping from "./Snapping.js";
|
|
73
75
|
import SpecularEnvironmentCubeMap from "./SpecularEnvironmentCubeMap.js";
|
|
74
76
|
import StencilConstants from "./StencilConstants.js";
|
|
75
77
|
import SunLight from "./SunLight.js";
|
|
@@ -109,9 +111,9 @@ const requestRenderAfterFrame = function (scene) {
|
|
|
109
111
|
* @param {boolean} [options.scene3DOnly=false] If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
|
|
110
112
|
* @param {boolean} [options.shadows=false] Determines if shadows are cast by light sources.
|
|
111
113
|
* @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
|
|
112
|
-
* @param {boolean} [options.columbusRepeatWorlds=false] If true, the Columbus View map repeats horizontally:
|
|
113
|
-
* copies of the globe surface tiles are rendered beyond the ±180° meridian so the map, entity
|
|
114
|
-
* picking continue seamlessly across the antimeridian.
|
|
114
|
+
* @param {boolean} [options.columbusRepeatWorlds=false] If true, the 2D or Columbus View map repeats horizontally:
|
|
115
|
+
* translated copies of the globe surface tiles are rendered beyond the ±180° meridian so the map, entity
|
|
116
|
+
* placement, and picking continue seamlessly across the antimeridian.
|
|
115
117
|
* @param {boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
|
|
116
118
|
* @param {number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
|
|
117
119
|
* @param {number} [options.depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
|
|
@@ -245,6 +247,8 @@ function Scene(options) {
|
|
|
245
247
|
this._preRender = new Event();
|
|
246
248
|
this._postRender = new Event();
|
|
247
249
|
|
|
250
|
+
this._controllerHost = new ControllerHost();
|
|
251
|
+
|
|
248
252
|
this._minimumDisableDepthTestDistance = 0.0;
|
|
249
253
|
this._debugInspector = new DebugInspector();
|
|
250
254
|
|
|
@@ -775,6 +779,15 @@ function Scene(options) {
|
|
|
775
779
|
*/
|
|
776
780
|
this._enableEdgeVisibility = false;
|
|
777
781
|
|
|
782
|
+
/**
|
|
783
|
+
* Whether or not to enable the planar fill feature-ID pre-pass.
|
|
784
|
+
* Updated each frame from FrameState.planarFillRequested.
|
|
785
|
+
* @type {boolean}
|
|
786
|
+
* @default false
|
|
787
|
+
* @private
|
|
788
|
+
*/
|
|
789
|
+
this._enablePlanarFillId = false;
|
|
790
|
+
|
|
778
791
|
// Give frameState, camera, and screen space camera controller initial state before rendering
|
|
779
792
|
updateFrameNumber(this, 0.0, JulianDate.now());
|
|
780
793
|
this.updateFrameState();
|
|
@@ -1084,6 +1097,25 @@ Object.defineProperties(Scene.prototype, {
|
|
|
1084
1097
|
},
|
|
1085
1098
|
},
|
|
1086
1099
|
|
|
1100
|
+
/**
|
|
1101
|
+
* Collects an array of <code>Controller</code> objects that can be registered with the scene to handle input events, camera animations, and other interactions.
|
|
1102
|
+
* @see {@link Controller}
|
|
1103
|
+
* @type {ControllerHost}
|
|
1104
|
+
* @memberof Scene.prototype
|
|
1105
|
+
* @readonly
|
|
1106
|
+
* @example
|
|
1107
|
+
* scene.screenSpaceCameraController.enableInputs = false;
|
|
1108
|
+
* scene.screenSpaceCameraController.enableCollisionDetection = false;
|
|
1109
|
+
*
|
|
1110
|
+
* const tiltOrbitController = new Cesium.ScreenSpaceTiltOrbitCameraController();
|
|
1111
|
+
* scene.controllerHost.registerController(tiltOrbitController, scene.canvas.parentNode);
|
|
1112
|
+
*/
|
|
1113
|
+
controllerHost: {
|
|
1114
|
+
get: function () {
|
|
1115
|
+
return this._controllerHost;
|
|
1116
|
+
},
|
|
1117
|
+
},
|
|
1118
|
+
|
|
1087
1119
|
/**
|
|
1088
1120
|
* Gets the controller for camera input handling.
|
|
1089
1121
|
* @memberof Scene.prototype
|
|
@@ -1232,6 +1264,17 @@ Object.defineProperties(Scene.prototype, {
|
|
|
1232
1264
|
},
|
|
1233
1265
|
},
|
|
1234
1266
|
|
|
1267
|
+
/**
|
|
1268
|
+
* @memberof Scene.prototype
|
|
1269
|
+
* @type {VectorProvider}
|
|
1270
|
+
* @ignore
|
|
1271
|
+
*/
|
|
1272
|
+
vectorProvider: {
|
|
1273
|
+
get: function () {
|
|
1274
|
+
return this.globe?.vectorProvider;
|
|
1275
|
+
},
|
|
1276
|
+
},
|
|
1277
|
+
|
|
1235
1278
|
/**
|
|
1236
1279
|
* Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
|
|
1237
1280
|
* receive the Scene instance as the first parameter and the current time as the second parameter.
|
|
@@ -1530,11 +1573,12 @@ Object.defineProperties(Scene.prototype, {
|
|
|
1530
1573
|
},
|
|
1531
1574
|
|
|
1532
1575
|
/**
|
|
1533
|
-
* Gets or sets whether the Columbus View map repeats horizontally. When
|
|
1534
|
-
* translated copies of the globe surface tiles are rendered beyond the
|
|
1535
|
-
* meridian, and entity placement/picking wrap to the copy nearest the
|
|
1536
|
-
* so editing and animation work seamlessly across the antimeridian.
|
|
1537
|
-
* Only has an effect in {@link SceneMode.
|
|
1576
|
+
* Gets or sets whether the 2D or Columbus View map repeats horizontally. When
|
|
1577
|
+
* true, translated copies of the globe surface tiles are rendered beyond the
|
|
1578
|
+
* ±180° meridian, and entity placement/picking wrap to the copy nearest the
|
|
1579
|
+
* camera, so editing and animation work seamlessly across the antimeridian.
|
|
1580
|
+
* Only has an effect in {@link SceneMode.SCENE2D} and
|
|
1581
|
+
* {@link SceneMode.COLUMBUS_VIEW}.
|
|
1538
1582
|
* @memberof Scene.prototype
|
|
1539
1583
|
*
|
|
1540
1584
|
* @type {boolean}
|
|
@@ -1795,6 +1839,16 @@ function updateDerivedCommands(scene, command, shadowsDirty) {
|
|
|
1795
1839
|
derivedCommands.picking,
|
|
1796
1840
|
);
|
|
1797
1841
|
}
|
|
1842
|
+
// Snap derived commands are only created on demand, during a snapping pass,
|
|
1843
|
+
// so applications that never call Scene.snap pay no shader-derivation cost.
|
|
1844
|
+
if (defined(command.snapId) && frameState.passes.snap) {
|
|
1845
|
+
derivedCommands.snapping = DerivedCommand.createSnapDerivedCommand(
|
|
1846
|
+
scene,
|
|
1847
|
+
command,
|
|
1848
|
+
context,
|
|
1849
|
+
derivedCommands.snapping,
|
|
1850
|
+
);
|
|
1851
|
+
}
|
|
1798
1852
|
if (frameState.pickingMetadata && command.pickMetadataAllowed) {
|
|
1799
1853
|
command.pickedMetadataInfo = frameState.pickedMetadataInfo;
|
|
1800
1854
|
if (defined(command.pickedMetadataInfo)) {
|
|
@@ -1892,12 +1946,17 @@ Scene.prototype.updateDerivedCommands = function (command) {
|
|
|
1892
1946
|
const needsUpdateForMetadataPicking =
|
|
1893
1947
|
frameState.pickingMetadata &&
|
|
1894
1948
|
pickedMetadataInfoChanged(command, frameState);
|
|
1949
|
+
const needsUpdateForSnap =
|
|
1950
|
+
frameState.passes.snap &&
|
|
1951
|
+
defined(command.snapId) &&
|
|
1952
|
+
!defined(derivedCommands.snapping);
|
|
1895
1953
|
command.dirty =
|
|
1896
1954
|
command.dirty ||
|
|
1897
1955
|
needsLogDepthDerivedCommands ||
|
|
1898
1956
|
needsHdrCommands ||
|
|
1899
1957
|
needsDerivedCommands ||
|
|
1900
|
-
needsUpdateForMetadataPicking
|
|
1958
|
+
needsUpdateForMetadataPicking ||
|
|
1959
|
+
needsUpdateForSnap;
|
|
1901
1960
|
|
|
1902
1961
|
if (!command.dirty) {
|
|
1903
1962
|
return;
|
|
@@ -1985,6 +2044,7 @@ Scene.prototype.clearPasses = function (passes) {
|
|
|
1985
2044
|
passes.render = false;
|
|
1986
2045
|
passes.pick = false;
|
|
1987
2046
|
passes.pickVoxel = false;
|
|
2047
|
+
passes.snap = false;
|
|
1988
2048
|
passes.depth = false;
|
|
1989
2049
|
passes.postProcess = false;
|
|
1990
2050
|
passes.offscreen = false;
|
|
@@ -2271,6 +2331,21 @@ function executeCommand(command, scene, passState, debugFramebuffer) {
|
|
|
2271
2331
|
|
|
2272
2332
|
if (passes.pick || passes.depth) {
|
|
2273
2333
|
if (passes.pick && !passes.depth) {
|
|
2334
|
+
if (frameState.passes.snap) {
|
|
2335
|
+
// Snapping pass: only commands with a snap variant write the float
|
|
2336
|
+
// snap payload. Commands without one (no snapId, e.g. globe/terrain)
|
|
2337
|
+
// execute depth-only so they still occlude snappable geometry behind
|
|
2338
|
+
// them without polluting the RGBA32F snap framebuffer with RGBA8
|
|
2339
|
+
// pick colors.
|
|
2340
|
+
if (defined(command.derivedCommands.snapping)) {
|
|
2341
|
+
command = command.derivedCommands.snapping.snapCommand;
|
|
2342
|
+
command.execute(context, passState);
|
|
2343
|
+
} else if (defined(command.derivedCommands.depth)) {
|
|
2344
|
+
command = command.derivedCommands.depth.depthOnlyCommand;
|
|
2345
|
+
command.execute(context, passState);
|
|
2346
|
+
}
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2274
2349
|
if (
|
|
2275
2350
|
frameState.pickingMetadata &&
|
|
2276
2351
|
defined(command.derivedCommands.pickingMetadata)
|
|
@@ -2492,6 +2567,7 @@ function createWorkingFrustum(camera) {
|
|
|
2492
2567
|
*
|
|
2493
2568
|
* @param {Scene} scene The scene.
|
|
2494
2569
|
* @returns {Function} A function to execute translucent commands.
|
|
2570
|
+
* @ignore
|
|
2495
2571
|
*/
|
|
2496
2572
|
function obtainTranslucentCommandExecutionFunction(scene) {
|
|
2497
2573
|
if (scene._environmentState.useOIT) {
|
|
@@ -2993,6 +3069,77 @@ function executeColumbusWorldCopyClassification(
|
|
|
2993
3069
|
uniformState.updateFrustum(frustum);
|
|
2994
3070
|
}
|
|
2995
3071
|
|
|
3072
|
+
/**
|
|
3073
|
+
* Execute the planar fill feature-ID pre-pass.
|
|
3074
|
+
*
|
|
3075
|
+
* Non-behind planar fill geometry writes its per-fragment feature ID into the
|
|
3076
|
+
* planar fill ID framebuffer. This allows behind fills in the main 3D tile
|
|
3077
|
+
* pass to check whether the existing pixel belongs to the same logical object.
|
|
3078
|
+
*
|
|
3079
|
+
* @param {Scene} scene
|
|
3080
|
+
* @param {PassState} passState
|
|
3081
|
+
* @param {FrustumCommands} frustumCommands
|
|
3082
|
+
* @private
|
|
3083
|
+
*/
|
|
3084
|
+
function performPlanarFillIdPass(scene, passState, frustumCommands) {
|
|
3085
|
+
const { context } = scene;
|
|
3086
|
+
const { uniformState } = context;
|
|
3087
|
+
|
|
3088
|
+
uniformState.updatePass(Pass.CESIUM_3D_TILE_PLANAR_FILL_ID);
|
|
3089
|
+
|
|
3090
|
+
// Default to a blank texture so shaders always have something to sample.
|
|
3091
|
+
uniformState.planarFillIdTexture = context.defaultTexture;
|
|
3092
|
+
|
|
3093
|
+
const view = scene._view;
|
|
3094
|
+
const fb = view && view.planarFillIdFramebuffer;
|
|
3095
|
+
|
|
3096
|
+
const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_PLANAR_FILL_ID];
|
|
3097
|
+
const commandCount =
|
|
3098
|
+
frustumCommands.indices[Pass.CESIUM_3D_TILE_PLANAR_FILL_ID];
|
|
3099
|
+
|
|
3100
|
+
if (commandCount === 0) {
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
if (scene._enablePlanarFillId && defined(fb) && defined(fb.framebuffer)) {
|
|
3105
|
+
const originalFramebuffer = passState.framebuffer;
|
|
3106
|
+
passState.framebuffer = fb.framebuffer;
|
|
3107
|
+
|
|
3108
|
+
// Clear to (0,0,0,0) — feature ID 0 means "no planar fill here".
|
|
3109
|
+
const clearCommand = fb.getClearCommand(new Color(0.0, 0.0, 0.0, 0.0));
|
|
3110
|
+
clearCommand.execute(context, passState);
|
|
3111
|
+
|
|
3112
|
+
for (let j = 0; j < commandCount; ++j) {
|
|
3113
|
+
executeCommand(commands[j], scene, passState);
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
passState.framebuffer = originalFramebuffer;
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
/**
|
|
3121
|
+
* Execute edge commands that should render directly to the main framebuffer
|
|
3122
|
+
* (EDGES_ONLY mode). These edges bypass the MRT edge framebuffer and render
|
|
3123
|
+
* on top of surface geometry.
|
|
3124
|
+
*
|
|
3125
|
+
* @param {Scene} scene
|
|
3126
|
+
* @param {PassState} passState
|
|
3127
|
+
* @param {FrustumCommands} frustumCommands
|
|
3128
|
+
*
|
|
3129
|
+
* @private
|
|
3130
|
+
*/
|
|
3131
|
+
function performCesium3DTileEdgesDirectPass(scene, passState, frustumCommands) {
|
|
3132
|
+
scene.context.uniformState.updatePass(Pass.CESIUM_3D_TILE_EDGES_DIRECT);
|
|
3133
|
+
|
|
3134
|
+
const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_EDGES_DIRECT];
|
|
3135
|
+
const commandCount =
|
|
3136
|
+
frustumCommands.indices[Pass.CESIUM_3D_TILE_EDGES_DIRECT];
|
|
3137
|
+
|
|
3138
|
+
for (let j = 0; j < commandCount; ++j) {
|
|
3139
|
+
executeCommand(commands[j], scene, passState);
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
|
|
2996
3143
|
/**
|
|
2997
3144
|
* Execute the draw commands for all the render passes.
|
|
2998
3145
|
*
|
|
@@ -3007,6 +3154,10 @@ function executeCommands(scene, passState) {
|
|
|
3007
3154
|
|
|
3008
3155
|
uniformState.updateCamera(camera);
|
|
3009
3156
|
|
|
3157
|
+
// Ensure planar fill ID texture is always available (even during edge pass)
|
|
3158
|
+
// so that shaders referencing czm_planarFillIdTexture never see undefined.
|
|
3159
|
+
uniformState.planarFillIdTexture = context.defaultTexture;
|
|
3160
|
+
|
|
3010
3161
|
const frustum = createWorkingFrustum(camera);
|
|
3011
3162
|
frustum.near = camera.frustum.near;
|
|
3012
3163
|
frustum.far = camera.frustum.far;
|
|
@@ -3040,7 +3191,8 @@ function executeCommands(scene, passState) {
|
|
|
3040
3191
|
!renderTranslucentDepthForPick &&
|
|
3041
3192
|
useGlobeDepthFramebuffer &&
|
|
3042
3193
|
frameState.columbusRepeatWorlds === true &&
|
|
3043
|
-
scene.mode === SceneMode.
|
|
3194
|
+
(scene.mode === SceneMode.SCENE2D ||
|
|
3195
|
+
scene.mode === SceneMode.COLUMBUS_VIEW) &&
|
|
3044
3196
|
(passes.render || passes.pick || passes.pickVoxel);
|
|
3045
3197
|
|
|
3046
3198
|
const {
|
|
@@ -3212,6 +3364,23 @@ function executeCommands(scene, passState) {
|
|
|
3212
3364
|
scene.context.defaultTexture;
|
|
3213
3365
|
}
|
|
3214
3366
|
|
|
3367
|
+
// Planar fill feature-ID pre-pass: write feature IDs from non-behind
|
|
3368
|
+
// planar fill geometry so that behind fills can test same-object.
|
|
3369
|
+
performPlanarFillIdPass(scene, passState, frustumCommands);
|
|
3370
|
+
|
|
3371
|
+
if (
|
|
3372
|
+
scene._enablePlanarFillId &&
|
|
3373
|
+
defined(scene._view) &&
|
|
3374
|
+
defined(scene._view.planarFillIdFramebuffer)
|
|
3375
|
+
) {
|
|
3376
|
+
const pfIdTexture = scene._view.planarFillIdFramebuffer.idTexture;
|
|
3377
|
+
uniformState.planarFillIdTexture = defined(pfIdTexture)
|
|
3378
|
+
? pfIdTexture
|
|
3379
|
+
: context.defaultTexture;
|
|
3380
|
+
} else {
|
|
3381
|
+
uniformState.planarFillIdTexture = context.defaultTexture;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3215
3384
|
if (!useInvertClassification || picking || renderTranslucentDepthForPick) {
|
|
3216
3385
|
// Common/fastest path. Draw 3D Tiles and classification normally.
|
|
3217
3386
|
|
|
@@ -3321,6 +3490,9 @@ function executeCommands(scene, passState) {
|
|
|
3321
3490
|
|
|
3322
3491
|
performPass(frustumCommands, Pass.OPAQUE);
|
|
3323
3492
|
|
|
3493
|
+
// Draw direct edges (EDGES_ONLY mode) after opaque surfaces
|
|
3494
|
+
performCesium3DTileEdgesDirectPass(scene, passState, frustumCommands);
|
|
3495
|
+
|
|
3324
3496
|
performGaussianSplatPass(scene, passState, frustumCommands);
|
|
3325
3497
|
|
|
3326
3498
|
if (index !== 0 && scene.mode !== SceneMode.SCENE2D) {
|
|
@@ -3391,7 +3563,8 @@ function executeCommands(scene, passState) {
|
|
|
3391
3563
|
|
|
3392
3564
|
if (
|
|
3393
3565
|
frameState.columbusRepeatWorlds === true &&
|
|
3394
|
-
frameState.mode === SceneMode.
|
|
3566
|
+
(frameState.mode === SceneMode.SCENE2D ||
|
|
3567
|
+
frameState.mode === SceneMode.COLUMBUS_VIEW) &&
|
|
3395
3568
|
(passes.render || passes.pick || passes.pickVoxel)
|
|
3396
3569
|
) {
|
|
3397
3570
|
executeColumbusWorldCopyCommands(
|
|
@@ -4125,6 +4298,7 @@ function updateAndRenderPrimitives(scene) {
|
|
|
4125
4298
|
|
|
4126
4299
|
// Reset per-frame edge visibility request flag before primitives update
|
|
4127
4300
|
frameState.edgeVisibilityRequested = false;
|
|
4301
|
+
frameState.planarFillRequested = false;
|
|
4128
4302
|
|
|
4129
4303
|
scene._groundPrimitives.update(frameState);
|
|
4130
4304
|
scene._primitives.update(frameState);
|
|
@@ -4137,6 +4311,10 @@ function updateAndRenderPrimitives(scene) {
|
|
|
4137
4311
|
scene._enableEdgeVisibility = true;
|
|
4138
4312
|
}
|
|
4139
4313
|
|
|
4314
|
+
// True only while at least one planar fill primitive is rendering;
|
|
4315
|
+
// the request flag is renewed each frame by ModelSceneGraph.
|
|
4316
|
+
scene._enablePlanarFillId = frameState.planarFillRequested;
|
|
4317
|
+
|
|
4140
4318
|
updateDebugFrustumPlanes(scene);
|
|
4141
4319
|
updateShadowMaps(scene);
|
|
4142
4320
|
|
|
@@ -4155,6 +4333,7 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
|
|
|
4155
4333
|
const picking = passes.pick || passes.pickVoxel;
|
|
4156
4334
|
if (defined(view.globeDepth)) {
|
|
4157
4335
|
view.globeDepth.picking = picking;
|
|
4336
|
+
view.globeDepth.snapping = passes.snap;
|
|
4158
4337
|
}
|
|
4159
4338
|
const useWebVR = environmentState.useWebVR;
|
|
4160
4339
|
|
|
@@ -4260,6 +4439,15 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
|
|
|
4260
4439
|
view.edgeFramebuffer.update(context, view.viewport, scene._hdr);
|
|
4261
4440
|
}
|
|
4262
4441
|
|
|
4442
|
+
// Update planar fill ID framebuffer
|
|
4443
|
+
const usePlanarFillIdFramebuffer = !picking && scene._enablePlanarFillId;
|
|
4444
|
+
if (usePlanarFillIdFramebuffer) {
|
|
4445
|
+
view.planarFillIdFramebuffer.update(context, view.viewport, scene._hdr);
|
|
4446
|
+
} else if (!picking) {
|
|
4447
|
+
// Release GPU resources while unused; recreated on demand by update().
|
|
4448
|
+
view.planarFillIdFramebuffer.releaseResources();
|
|
4449
|
+
}
|
|
4450
|
+
|
|
4263
4451
|
if (useInvertClassification) {
|
|
4264
4452
|
let depthFramebuffer;
|
|
4265
4453
|
if (frameState.invertClassificationColor.alpha === 1.0) {
|
|
@@ -4816,6 +5004,8 @@ Scene.prototype.render = function (time) {
|
|
|
4816
5004
|
time = JulianDate.now();
|
|
4817
5005
|
}
|
|
4818
5006
|
|
|
5007
|
+
this._controllerHost.update(this, time);
|
|
5008
|
+
|
|
4819
5009
|
const cameraChanged = this._view.checkForCameraUpdates(this);
|
|
4820
5010
|
if (cameraChanged) {
|
|
4821
5011
|
this._globeHeightDirty = true;
|
|
@@ -4953,6 +5143,42 @@ Scene.prototype.pick = function (windowPosition, width, height) {
|
|
|
4953
5143
|
return this._picking.pick(this, windowPosition, width, height, 1)[0];
|
|
4954
5144
|
};
|
|
4955
5145
|
|
|
5146
|
+
/**
|
|
5147
|
+
* The result of a snap operation. See {@link Scene#snap}.
|
|
5148
|
+
*
|
|
5149
|
+
* @typedef {object} SceneSnapResult
|
|
5150
|
+
* @property {object} object The snapped primitive or feature.
|
|
5151
|
+
* @property {Cartesian3} position The world-space position of the snap point, un-projected from the snap framebuffer's eye-space depth.
|
|
5152
|
+
* @property {Cartesian2} screenPosition The window coordinates of the snap point.
|
|
5153
|
+
* @property {boolean} isEdge <code>true</code> if the snap point lies on an edge; <code>false</code> if it lies on a surface.
|
|
5154
|
+
*
|
|
5155
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
5156
|
+
*/
|
|
5157
|
+
|
|
5158
|
+
/**
|
|
5159
|
+
* Returns the best snap target in a screen-space region around <code>windowPosition</code>.
|
|
5160
|
+
* Edges are preferred over surfaces; among hits of the same kind the one
|
|
5161
|
+
* nearest the cursor wins. Returns <code>undefined</code> if the region contains
|
|
5162
|
+
* no snappable geometry.
|
|
5163
|
+
* <p>
|
|
5164
|
+
* Only primitives rendered through the Model pipeline (e.g. 3D Tiles and glTF
|
|
5165
|
+
* models) are snappable. Snapping requires float color attachments
|
|
5166
|
+
* (WebGL2 with <code>EXT_color_buffer_float</code>); if unsupported, this
|
|
5167
|
+
* function returns <code>undefined</code>.
|
|
5168
|
+
* </p>
|
|
5169
|
+
*
|
|
5170
|
+
* @param {Cartesian2} windowPosition Window coordinates at the center of the search region.
|
|
5171
|
+
* @param {object} [options] Object with the following properties:
|
|
5172
|
+
* @param {number} [options.width=25] Width of the search region in pixels.
|
|
5173
|
+
* @param {number} [options.height=options.width] Height of the search region in pixels.
|
|
5174
|
+
* @returns {SceneSnapResult | undefined} The best snap target in the region, or <code>undefined</code> if there is none.
|
|
5175
|
+
*
|
|
5176
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
5177
|
+
*/
|
|
5178
|
+
Scene.prototype.snap = function (windowPosition, options) {
|
|
5179
|
+
return Snapping.snap(this, windowPosition, options);
|
|
5180
|
+
};
|
|
5181
|
+
|
|
4956
5182
|
/**
|
|
4957
5183
|
* Performs the same operation as Scene.pick but asynchonosly without blocking the main render thread.
|
|
4958
5184
|
* Requires WebGL2 else using fallback.
|
|
@@ -135,13 +135,14 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function (
|
|
|
135
135
|
const camera = scene.camera;
|
|
136
136
|
|
|
137
137
|
if (
|
|
138
|
-
frameState.mode === SceneMode.
|
|
138
|
+
(frameState.mode === SceneMode.SCENE2D ||
|
|
139
|
+
frameState.mode === SceneMode.COLUMBUS_VIEW) &&
|
|
139
140
|
frameState.columbusRepeatWorlds === true
|
|
140
141
|
) {
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
142
|
+
// Repeat worlds: rendering replicates the data onto every world copy, so
|
|
143
|
+
// screen-space consumers (HTML overlays, editor handles) must project onto
|
|
144
|
+
// the copy nearest the camera as well. Both 2D and Columbus View place the
|
|
145
|
+
// map-u axis on world y, so the copy offset applies to y.
|
|
145
146
|
actualPosition.y = ColumbusWorlds.nearestWorldU(
|
|
146
147
|
camera.positionWC.y,
|
|
147
148
|
actualPosition.y,
|
|
@@ -1719,20 +1719,25 @@ function createCastDerivedCommand(
|
|
|
1719
1719
|
const isPointLight = shadowMap._isPointLight;
|
|
1720
1720
|
const usesDepthTexture = shadowMap._usesDepthTexture;
|
|
1721
1721
|
|
|
1722
|
+
const vertexShaderSource = shaderProgram.vertexShaderSource;
|
|
1723
|
+
const fragmentShaderSource = shaderProgram.fragmentShaderSource;
|
|
1724
|
+
|
|
1725
|
+
const hasClipping =
|
|
1726
|
+
isOpaque &&
|
|
1727
|
+
ShadowMapShader.hasClippingForShadowCast(fragmentShaderSource);
|
|
1728
|
+
|
|
1722
1729
|
const keyword = ShadowMapShader.getShadowCastShaderKeyword(
|
|
1723
1730
|
isPointLight,
|
|
1724
1731
|
isTerrain,
|
|
1725
1732
|
usesDepthTexture,
|
|
1726
1733
|
isOpaque,
|
|
1734
|
+
hasClipping,
|
|
1727
1735
|
);
|
|
1728
1736
|
castShader = context.shaderCache.getDerivedShaderProgram(
|
|
1729
1737
|
shaderProgram,
|
|
1730
1738
|
keyword,
|
|
1731
1739
|
);
|
|
1732
1740
|
if (!defined(castShader)) {
|
|
1733
|
-
const vertexShaderSource = shaderProgram.vertexShaderSource;
|
|
1734
|
-
const fragmentShaderSource = shaderProgram.fragmentShaderSource;
|
|
1735
|
-
|
|
1736
1741
|
const castVS = ShadowMapShader.createShadowCastVertexShader(
|
|
1737
1742
|
vertexShaderSource,
|
|
1738
1743
|
isPointLight,
|
|
@@ -1743,6 +1748,7 @@ function createCastDerivedCommand(
|
|
|
1743
1748
|
isPointLight,
|
|
1744
1749
|
usesDepthTexture,
|
|
1745
1750
|
isOpaque,
|
|
1751
|
+
hasClipping,
|
|
1746
1752
|
);
|
|
1747
1753
|
|
|
1748
1754
|
castShader = context.shaderCache.createDerivedShaderProgram(
|
|
@@ -6,13 +6,48 @@ import ShaderSource from "../Renderer/ShaderSource.js";
|
|
|
6
6
|
*/
|
|
7
7
|
function ShadowMapShader() {}
|
|
8
8
|
|
|
9
|
+
const clippingDefines = {
|
|
10
|
+
HAS_CLIPPING_PLANES: true,
|
|
11
|
+
ENABLE_CLIPPING_POLYGONS: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns true if the fragment shader clips fragments via a
|
|
16
|
+
* ClippingPlaneCollection or ClippingPolygonCollection, in which case the
|
|
17
|
+
* shadow cast pass must run the original main so that clipped fragments
|
|
18
|
+
* are discarded and do not cast shadows.
|
|
19
|
+
*
|
|
20
|
+
* @param {ShaderSource} fragmentShaderSource
|
|
21
|
+
* @returns {boolean}
|
|
22
|
+
*/
|
|
23
|
+
ShadowMapShader.hasClippingForShadowCast = function (fragmentShaderSource) {
|
|
24
|
+
const defines = fragmentShaderSource.defines;
|
|
25
|
+
return (
|
|
26
|
+
defined(defines) &&
|
|
27
|
+
defines.some(function (define) {
|
|
28
|
+
return clippingDefines[define] === true;
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {boolean} isPointLight
|
|
35
|
+
* @param {boolean} isTerrain
|
|
36
|
+
* @param {boolean} usesDepthTexture
|
|
37
|
+
* @param {boolean} isOpaque
|
|
38
|
+
* @param {boolean} hasClipping True if the fragment shader discards clipped
|
|
39
|
+
* fragments. Differentiates cached shader variants so that a shader that
|
|
40
|
+
* must call czm_shadow_cast_main() is never reused for one that does not.
|
|
41
|
+
* @returns {string}
|
|
42
|
+
*/
|
|
9
43
|
ShadowMapShader.getShadowCastShaderKeyword = function (
|
|
10
44
|
isPointLight,
|
|
11
45
|
isTerrain,
|
|
12
46
|
usesDepthTexture,
|
|
13
47
|
isOpaque,
|
|
48
|
+
hasClipping,
|
|
14
49
|
) {
|
|
15
|
-
return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque}`;
|
|
50
|
+
return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque} ${hasClipping}`;
|
|
16
51
|
};
|
|
17
52
|
|
|
18
53
|
ShadowMapShader.createShadowCastVertexShader = function (
|
|
@@ -54,11 +89,22 @@ ShadowMapShader.createShadowCastVertexShader = function (
|
|
|
54
89
|
});
|
|
55
90
|
};
|
|
56
91
|
|
|
92
|
+
/**
|
|
93
|
+
* @param {ShaderSource} fs
|
|
94
|
+
* @param {boolean} isPointLight
|
|
95
|
+
* @param {boolean} usesDepthTexture
|
|
96
|
+
* @param {boolean} opaque
|
|
97
|
+
* @param {boolean} hasClipping True if the fragment shader discards clipped
|
|
98
|
+
* fragments. When true, czm_shadow_cast_main() (the renamed original main)
|
|
99
|
+
* is called first so that clipping discards execute during the shadow cast pass.
|
|
100
|
+
* @returns {ShaderSource}
|
|
101
|
+
*/
|
|
57
102
|
ShadowMapShader.createShadowCastFragmentShader = function (
|
|
58
103
|
fs,
|
|
59
104
|
isPointLight,
|
|
60
105
|
usesDepthTexture,
|
|
61
106
|
opaque,
|
|
107
|
+
hasClipping,
|
|
62
108
|
) {
|
|
63
109
|
const defines = fs.defines.slice(0);
|
|
64
110
|
const sources = fs.sources.slice(0);
|
|
@@ -85,7 +131,9 @@ ShadowMapShader.createShadowCastFragmentShader = function (
|
|
|
85
131
|
fsSource += "uniform vec4 shadowMap_lightPositionEC; \n";
|
|
86
132
|
}
|
|
87
133
|
|
|
88
|
-
if (opaque) {
|
|
134
|
+
if (opaque && hasClipping) {
|
|
135
|
+
fsSource += "void main() \n" + "{ \n" + " czm_shadow_cast_main(); \n";
|
|
136
|
+
} else if (opaque) {
|
|
89
137
|
fsSource += "void main() \n" + "{ \n";
|
|
90
138
|
} else {
|
|
91
139
|
fsSource +=
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import BoundingRectangle from "../Core/BoundingRectangle.js";
|
|
2
|
+
import defined from "../Core/defined.js";
|
|
3
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
4
|
+
import PixelFormat from "../Core/PixelFormat.js";
|
|
5
|
+
import FramebufferManager from "../Renderer/FramebufferManager.js";
|
|
6
|
+
import PassState from "../Renderer/PassState.js";
|
|
7
|
+
import PixelDatatype from "../Renderer/PixelDatatype.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
function SnapFramebuffer(context) {
|
|
13
|
+
const passState = new PassState(context);
|
|
14
|
+
passState.blendingEnabled = false;
|
|
15
|
+
passState.scissorTest = {
|
|
16
|
+
enabled: true,
|
|
17
|
+
rectangle: new BoundingRectangle(),
|
|
18
|
+
};
|
|
19
|
+
passState.viewport = new BoundingRectangle();
|
|
20
|
+
|
|
21
|
+
this._context = context;
|
|
22
|
+
this._fb = new FramebufferManager({
|
|
23
|
+
depthStencil: true,
|
|
24
|
+
pixelDatatype: PixelDatatype.FLOAT,
|
|
25
|
+
pixelFormat: PixelFormat.RGBA,
|
|
26
|
+
});
|
|
27
|
+
this._passState = passState;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getSnapObjectsFromPixels(context, pixels, width, height) {
|
|
31
|
+
const max = Math.max(width, height);
|
|
32
|
+
const length = max * max;
|
|
33
|
+
const halfWidth = Math.floor(width * 0.5);
|
|
34
|
+
const halfHeight = Math.floor(height * 0.5);
|
|
35
|
+
|
|
36
|
+
let x = 0;
|
|
37
|
+
let y = 0;
|
|
38
|
+
let dx = 0;
|
|
39
|
+
let dy = -1;
|
|
40
|
+
|
|
41
|
+
const results = [];
|
|
42
|
+
for (let i = 0; i < length; ++i) {
|
|
43
|
+
if (
|
|
44
|
+
-halfWidth <= x &&
|
|
45
|
+
x <= halfWidth &&
|
|
46
|
+
-halfHeight <= y &&
|
|
47
|
+
y <= halfHeight
|
|
48
|
+
) {
|
|
49
|
+
const index = 4 * ((halfHeight - y) * width + x + halfWidth);
|
|
50
|
+
|
|
51
|
+
const pickColor = pixels[index];
|
|
52
|
+
const object = context.getObjectByPickColor(pickColor);
|
|
53
|
+
if (defined(object)) {
|
|
54
|
+
results.push({
|
|
55
|
+
object: object,
|
|
56
|
+
isEdge: pixels[index + 1] > 0.0,
|
|
57
|
+
depth: pixels[index + 2],
|
|
58
|
+
x: x,
|
|
59
|
+
y: y,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (x === y || (x < 0 && -x === y) || (x > 0 && x === 1 - y)) {
|
|
65
|
+
const temp = dx;
|
|
66
|
+
dx = -dy;
|
|
67
|
+
dy = temp;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
x += dx;
|
|
71
|
+
y += dy;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return results;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
SnapFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) {
|
|
78
|
+
const context = this._context;
|
|
79
|
+
const { width, height } = viewport;
|
|
80
|
+
|
|
81
|
+
BoundingRectangle.clone(
|
|
82
|
+
screenSpaceRectangle,
|
|
83
|
+
this._passState.scissorTest.rectangle,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
this._fb.update(context, width, height);
|
|
87
|
+
this._passState.framebuffer = this._fb.framebuffer;
|
|
88
|
+
|
|
89
|
+
this._passState.viewport.width = width;
|
|
90
|
+
this._passState.viewport.height = height;
|
|
91
|
+
|
|
92
|
+
return this._passState;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
SnapFramebuffer.prototype.end = function (screenSpaceRectangle) {
|
|
96
|
+
const width = screenSpaceRectangle.width ?? 1.0;
|
|
97
|
+
const height = screenSpaceRectangle.height ?? 1.0;
|
|
98
|
+
|
|
99
|
+
const context = this._context;
|
|
100
|
+
const pixels = context.readPixels({
|
|
101
|
+
x: screenSpaceRectangle.x,
|
|
102
|
+
y: screenSpaceRectangle.y,
|
|
103
|
+
width: width,
|
|
104
|
+
height: height,
|
|
105
|
+
pixelDatatype: PixelDatatype.FLOAT,
|
|
106
|
+
framebuffer: this._fb.framebuffer,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return getSnapObjectsFromPixels(context, pixels, width, height);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
SnapFramebuffer.prototype.isDestroyed = function () {
|
|
113
|
+
return false;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
SnapFramebuffer.prototype.destroy = function () {
|
|
117
|
+
this._fb.destroy();
|
|
118
|
+
return destroyObject(this);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default SnapFramebuffer;
|