@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
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import combine from "../../Core/combine.js";
|
|
2
|
-
import ModelClippingPolygonsStageVS from "../../Shaders/Model/ModelClippingPolygonsStageVS.js";
|
|
3
2
|
import ModelClippingPolygonsStageFS from "../../Shaders/Model/ModelClippingPolygonsStageFS.js";
|
|
3
|
+
import ModelClippingPolygonsStageVS from "../../Shaders/Model/ModelClippingPolygonsStageVS.js";
|
|
4
4
|
import ShaderDestination from "../../Renderer/ShaderDestination.js";
|
|
5
|
+
import VectorCommon from "../../Shaders/VectorCommon.js";
|
|
6
|
+
import Cartesian2 from "../../Core/Cartesian2.js";
|
|
7
|
+
import CesiumMath from "../../Core/Math.js";
|
|
8
|
+
import Rectangle from "../../Core/Rectangle.js";
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* The model clipping planes stage is responsible for applying clipping planes to the model.
|
|
@@ -14,6 +18,10 @@ const ModelClippingPolygonsPipelineStage = {
|
|
|
14
18
|
name: "ModelClippingPolygonsPipelineStage", // Helps with debugging
|
|
15
19
|
};
|
|
16
20
|
|
|
21
|
+
const scratchCameraUv = new Cartesian2();
|
|
22
|
+
const scratchRectangleInverseSize = new Cartesian2();
|
|
23
|
+
const defaultRectangle = Rectangle.MAX_VALUE;
|
|
24
|
+
|
|
17
25
|
/**
|
|
18
26
|
* Process a model for polygon clipping. This modifies the following parts of the render resources:
|
|
19
27
|
*
|
|
@@ -54,40 +62,67 @@ ModelClippingPolygonsPipelineStage.process = function (
|
|
|
54
62
|
);
|
|
55
63
|
}
|
|
56
64
|
|
|
57
|
-
shaderBuilder.
|
|
58
|
-
"CLIPPING_POLYGON_REGIONS_LENGTH",
|
|
59
|
-
clippingPolygons.extentsCount,
|
|
60
|
-
ShaderDestination.BOTH,
|
|
61
|
-
);
|
|
65
|
+
shaderBuilder.addVarying("vec2", "v_clippingUv");
|
|
62
66
|
|
|
63
67
|
shaderBuilder.addUniform(
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
ShaderDestination.
|
|
68
|
+
"vec2",
|
|
69
|
+
"u_clippingCameraUv",
|
|
70
|
+
ShaderDestination.VERTEX,
|
|
67
71
|
);
|
|
68
72
|
|
|
69
73
|
shaderBuilder.addUniform(
|
|
70
|
-
"
|
|
71
|
-
"
|
|
74
|
+
"vec2",
|
|
75
|
+
"u_clippingRectangleInverseSize",
|
|
72
76
|
ShaderDestination.VERTEX,
|
|
73
77
|
);
|
|
74
78
|
|
|
75
|
-
shaderBuilder.addVarying("vec2", "v_clippingPosition");
|
|
76
|
-
shaderBuilder.addVarying("int", "v_regionIndex", "flat");
|
|
77
79
|
shaderBuilder.addVertexLines(ModelClippingPolygonsStageVS);
|
|
80
|
+
shaderBuilder.addFragmentLines(VectorCommon);
|
|
78
81
|
shaderBuilder.addFragmentLines(ModelClippingPolygonsStageFS);
|
|
79
82
|
|
|
80
83
|
const uniformMap = {
|
|
81
|
-
|
|
84
|
+
// The UV coordinates of the camera within the model's clipping rectangle.
|
|
85
|
+
u_clippingCameraUv: function () {
|
|
86
|
+
const rectangle =
|
|
87
|
+
model._clippingPolygonData?.rectangle ?? defaultRectangle;
|
|
88
|
+
const halfWidth = rectangle.width * 0.5;
|
|
89
|
+
const centerLongitude = rectangle.west + halfWidth;
|
|
90
|
+
const carto = frameState.camera.positionCartographic;
|
|
91
|
+
|
|
92
|
+
const longitudeOffset =
|
|
93
|
+
CesiumMath.negativePiToPi(carto.longitude - centerLongitude) +
|
|
94
|
+
halfWidth;
|
|
95
|
+
return Cartesian2.fromElements(
|
|
96
|
+
longitudeOffset / rectangle.width,
|
|
97
|
+
(carto.latitude - rectangle.south) / rectangle.height,
|
|
98
|
+
scratchCameraUv,
|
|
99
|
+
);
|
|
100
|
+
},
|
|
101
|
+
u_clippingRectangleInverseSize: function () {
|
|
102
|
+
const rectangle =
|
|
103
|
+
model._clippingPolygonData?.rectangle ?? defaultRectangle;
|
|
104
|
+
return Cartesian2.fromElements(
|
|
105
|
+
1.0 / rectangle.width,
|
|
106
|
+
1.0 / rectangle.height,
|
|
107
|
+
scratchRectangleInverseSize,
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
u_clippingEdgeTexture: function () {
|
|
111
|
+
return (
|
|
112
|
+
model._clippingPolygonData?.polygonEdgeTexture ??
|
|
113
|
+
frameState.context.defaultTexture
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
u_clippingEdgePrimitiveIndicesTexture: function () {
|
|
82
117
|
return (
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
model._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture ??
|
|
119
|
+
frameState.context.defaultTexture
|
|
85
120
|
);
|
|
86
121
|
},
|
|
87
|
-
|
|
122
|
+
u_clippingGridCellIndicesTexture: function () {
|
|
88
123
|
return (
|
|
89
|
-
|
|
90
|
-
|
|
124
|
+
model._clippingPolygonData?.polygonGridCellIndicesTexture ??
|
|
125
|
+
frameState.context.defaultTexture
|
|
91
126
|
);
|
|
92
127
|
},
|
|
93
128
|
};
|
|
@@ -103,6 +103,9 @@ function ModelDrawCommand(options) {
|
|
|
103
103
|
this._needsSkipLevelOfDetailCommands = needsSkipLevelOfDetailCommands;
|
|
104
104
|
this._needsSilhouetteCommands = needsSilhouetteCommands;
|
|
105
105
|
this._needsEdgeCommands = needsEdgeCommands;
|
|
106
|
+
// Non-behind planar fill primitives write their feature IDs in a pre-pass
|
|
107
|
+
// so that behind fills can test same-object coplanarity.
|
|
108
|
+
this._needsPlanarFillIdCommand = renderResources.planarFillIdPass;
|
|
106
109
|
|
|
107
110
|
// Derived commands
|
|
108
111
|
this._originalCommand = undefined;
|
|
@@ -112,6 +115,10 @@ function ModelDrawCommand(options) {
|
|
|
112
115
|
this._silhouetteModelCommand = undefined;
|
|
113
116
|
this._silhouetteColorCommand = undefined;
|
|
114
117
|
this._edgeCommand = undefined;
|
|
118
|
+
// Snap-pass variant of the edge command, pinned at 1 px width.
|
|
119
|
+
// See deriveEdgeCommand.
|
|
120
|
+
this._edgeSnapCommand = undefined;
|
|
121
|
+
this._planarFillIdCommand = undefined;
|
|
115
122
|
|
|
116
123
|
// All derived commands (including 2D commands)
|
|
117
124
|
this._derivedCommands = [];
|
|
@@ -226,8 +233,27 @@ function initialize(drawCommand) {
|
|
|
226
233
|
|
|
227
234
|
if (drawCommand._needsEdgeCommands) {
|
|
228
235
|
const renderResources = drawCommand._primitiveRenderResources;
|
|
236
|
+
const edgeGeometry = renderResources.edgeGeometry;
|
|
237
|
+
const colorLineWidth = defined(edgeGeometry.lineWidth)
|
|
238
|
+
? edgeGeometry.lineWidth
|
|
239
|
+
: 1.0;
|
|
240
|
+
// Snap-pass edge width is held at 1 px independent of the color width.
|
|
241
|
+
// A wider snap band results in snap wiggle: as the cursor moves
|
|
242
|
+
// perpendicular to an edge inside the band, the "edge pixel nearest
|
|
243
|
+
// the cursor" shifts, so Snapping.snap returns a slightly different
|
|
244
|
+
// point each frame.
|
|
245
|
+
const snapLineWidth = 1.0;
|
|
246
|
+
|
|
229
247
|
drawCommand._edgeCommand = new ModelDerivedCommand({
|
|
230
|
-
command: deriveEdgeCommand(command, renderResources,
|
|
248
|
+
command: deriveEdgeCommand(command, renderResources, colorLineWidth),
|
|
249
|
+
updateShadows: false,
|
|
250
|
+
updateBackFaceCulling: false,
|
|
251
|
+
updateCullFace: false,
|
|
252
|
+
updateDebugShowBoundingVolume: false,
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
drawCommand._edgeSnapCommand = new ModelDerivedCommand({
|
|
256
|
+
command: deriveEdgeCommand(command, renderResources, snapLineWidth),
|
|
231
257
|
updateShadows: false,
|
|
232
258
|
updateBackFaceCulling: false,
|
|
233
259
|
updateCullFace: false,
|
|
@@ -235,6 +261,19 @@ function initialize(drawCommand) {
|
|
|
235
261
|
});
|
|
236
262
|
|
|
237
263
|
derivedCommands.push(drawCommand._edgeCommand);
|
|
264
|
+
derivedCommands.push(drawCommand._edgeSnapCommand);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (drawCommand._needsPlanarFillIdCommand) {
|
|
268
|
+
drawCommand._planarFillIdCommand = new ModelDerivedCommand({
|
|
269
|
+
command: derivePlanarFillIdCommand(command),
|
|
270
|
+
updateShadows: false,
|
|
271
|
+
updateBackFaceCulling: false,
|
|
272
|
+
updateCullFace: false,
|
|
273
|
+
updateDebugShowBoundingVolume: false,
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
derivedCommands.push(drawCommand._planarFillIdCommand);
|
|
238
277
|
}
|
|
239
278
|
}
|
|
240
279
|
|
|
@@ -584,14 +623,6 @@ ModelDrawCommand.prototype.pushCommands = function (frameState, result) {
|
|
|
584
623
|
|
|
585
624
|
pushCommand(result, this._originalCommand, use2D);
|
|
586
625
|
|
|
587
|
-
// Push edge commands after the original command
|
|
588
|
-
if (
|
|
589
|
-
this._needsEdgeCommands &&
|
|
590
|
-
this._model.edgeDisplayMode !== EdgeDisplayMode.SURFACES_ONLY
|
|
591
|
-
) {
|
|
592
|
-
pushCommand(result, this._edgeCommand, use2D);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
626
|
return result;
|
|
596
627
|
};
|
|
597
628
|
|
|
@@ -636,15 +667,51 @@ ModelDrawCommand.prototype.pushEdgeCommands = function (frameState, result) {
|
|
|
636
667
|
return result;
|
|
637
668
|
}
|
|
638
669
|
|
|
639
|
-
|
|
640
|
-
|
|
670
|
+
const mode = this._model.edgeDisplayMode;
|
|
671
|
+
const passes = frameState.passes;
|
|
672
|
+
const use2D = shouldUse2DCommands(this, frameState);
|
|
673
|
+
|
|
674
|
+
if (passes.snap) {
|
|
675
|
+
// Snapping pass: route the 1 px snap variant directly into the bound
|
|
676
|
+
// snap framebuffer, regardless of display mode -- snapping works even
|
|
677
|
+
// when edges are visually suppressed (SURFACES_ONLY).
|
|
678
|
+
const edgeCommand = this._edgeSnapCommand;
|
|
679
|
+
edgeCommand.command.pass = Pass.CESIUM_3D_TILE_EDGES_DIRECT;
|
|
680
|
+
if (defined(edgeCommand.derivedCommand2D)) {
|
|
681
|
+
edgeCommand.derivedCommand2D.command.pass =
|
|
682
|
+
Pass.CESIUM_3D_TILE_EDGES_DIRECT;
|
|
683
|
+
}
|
|
684
|
+
pushCommand(result, edgeCommand, use2D);
|
|
685
|
+
return result;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (passes.pick) {
|
|
689
|
+
// Plain pick pass: edges contribute nothing to the RGBA8 pick
|
|
690
|
+
// framebuffer except in EDGES_ONLY mode, where they are the only
|
|
691
|
+
// pickable geometry (pushCommands skips the surface command).
|
|
692
|
+
if (mode !== EdgeDisplayMode.EDGES_ONLY) {
|
|
693
|
+
return result;
|
|
694
|
+
}
|
|
695
|
+
const edgeCommand = this._edgeCommand;
|
|
696
|
+
edgeCommand.command.pass = Pass.CESIUM_3D_TILE_EDGES_DIRECT;
|
|
697
|
+
if (defined(edgeCommand.derivedCommand2D)) {
|
|
698
|
+
edgeCommand.derivedCommand2D.command.pass =
|
|
699
|
+
Pass.CESIUM_3D_TILE_EDGES_DIRECT;
|
|
700
|
+
}
|
|
701
|
+
pushCommand(result, edgeCommand, use2D);
|
|
641
702
|
return result;
|
|
642
703
|
}
|
|
643
704
|
|
|
644
|
-
//
|
|
645
|
-
|
|
705
|
+
// Color pass. SURFACES_ONLY mode suppresses all edge rendering.
|
|
706
|
+
if (mode === EdgeDisplayMode.SURFACES_ONLY) {
|
|
707
|
+
return result;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// Use direct pass (renders to currently bound framebuffer) when EDGES_ONLY
|
|
711
|
+
// mode is enabled, otherwise use MRT pass (renders to edge framebuffer for
|
|
712
|
+
// compositing).
|
|
646
713
|
const edgePass =
|
|
647
|
-
|
|
714
|
+
mode === EdgeDisplayMode.EDGES_ONLY
|
|
648
715
|
? Pass.CESIUM_3D_TILE_EDGES_DIRECT
|
|
649
716
|
: Pass.CESIUM_3D_TILE_EDGES;
|
|
650
717
|
|
|
@@ -653,12 +720,34 @@ ModelDrawCommand.prototype.pushEdgeCommands = function (frameState, result) {
|
|
|
653
720
|
this._edgeCommand.derivedCommand2D.command.pass = edgePass;
|
|
654
721
|
}
|
|
655
722
|
|
|
656
|
-
const use2D = shouldUse2DCommands(this, frameState);
|
|
657
723
|
pushCommand(result, this._edgeCommand, use2D);
|
|
658
724
|
|
|
659
725
|
return result;
|
|
660
726
|
};
|
|
661
727
|
|
|
728
|
+
/**
|
|
729
|
+
* Push the planar fill feature-ID pre-pass command (if any).
|
|
730
|
+
*
|
|
731
|
+
* @param {FrameState} frameState The frame state.
|
|
732
|
+
* @param {DrawCommand[]} result The draw commands to push to.
|
|
733
|
+
* @returns {DrawCommand[]} The modified command list.
|
|
734
|
+
*
|
|
735
|
+
* @private
|
|
736
|
+
*/
|
|
737
|
+
ModelDrawCommand.prototype.pushPlanarFillIdCommands = function (
|
|
738
|
+
frameState,
|
|
739
|
+
result,
|
|
740
|
+
) {
|
|
741
|
+
if (!defined(this._planarFillIdCommand)) {
|
|
742
|
+
return result;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
const use2D = shouldUse2DCommands(this, frameState);
|
|
746
|
+
pushCommand(result, this._planarFillIdCommand, use2D);
|
|
747
|
+
|
|
748
|
+
return result;
|
|
749
|
+
};
|
|
750
|
+
|
|
662
751
|
function pushCommand(commandList, derivedCommand, use2D) {
|
|
663
752
|
commandList.push(derivedCommand.command);
|
|
664
753
|
if (use2D) {
|
|
@@ -718,6 +807,8 @@ function derive2DCommands(drawCommand) {
|
|
|
718
807
|
derive2DCommand(drawCommand, drawCommand._silhouetteModelCommand);
|
|
719
808
|
derive2DCommand(drawCommand, drawCommand._silhouetteColorCommand);
|
|
720
809
|
derive2DCommand(drawCommand, drawCommand._edgeCommand);
|
|
810
|
+
derive2DCommand(drawCommand, drawCommand._edgeSnapCommand);
|
|
811
|
+
derive2DCommand(drawCommand, drawCommand._planarFillIdCommand);
|
|
721
812
|
}
|
|
722
813
|
|
|
723
814
|
function deriveTranslucentCommand(command) {
|
|
@@ -826,7 +917,13 @@ function deriveSilhouetteColorCommand(command, model) {
|
|
|
826
917
|
return silhouetteColorCommand;
|
|
827
918
|
}
|
|
828
919
|
|
|
829
|
-
|
|
920
|
+
// Builds an edge draw command at the given screen-space line width.
|
|
921
|
+
//
|
|
922
|
+
// Two variants are derived per primitive (one for the color pass and one
|
|
923
|
+
// for the snapping pass). Therefore, the visual line width and the snap-pass line
|
|
924
|
+
// width can be set independently. The snap variant is pinned at 1 px to
|
|
925
|
+
// avoid snap wiggle (see initialize). In practice both default to 1 px.
|
|
926
|
+
function deriveEdgeCommand(command, renderResources, lineWidth) {
|
|
830
927
|
const edgeGeometry = renderResources.edgeGeometry;
|
|
831
928
|
const edgeCommand = DrawCommand.shallowClone(command);
|
|
832
929
|
|
|
@@ -848,6 +945,12 @@ function deriveEdgeCommand(command, renderResources) {
|
|
|
848
945
|
uniformMap.u_isEdgePass = function () {
|
|
849
946
|
return true; // This is the edge pass
|
|
850
947
|
};
|
|
948
|
+
|
|
949
|
+
// Set line width uniform for quad-based edge rendering
|
|
950
|
+
uniformMap.u_lineWidth = function () {
|
|
951
|
+
return lineWidth;
|
|
952
|
+
};
|
|
953
|
+
|
|
851
954
|
edgeCommand.uniformMap = uniformMap;
|
|
852
955
|
edgeCommand.castShadows = false;
|
|
853
956
|
edgeCommand.receiveShadows = false;
|
|
@@ -855,6 +958,47 @@ function deriveEdgeCommand(command, renderResources) {
|
|
|
855
958
|
return edgeCommand;
|
|
856
959
|
}
|
|
857
960
|
|
|
961
|
+
/**
|
|
962
|
+
* Derive a command for the planar fill feature-ID pre-pass.
|
|
963
|
+
*
|
|
964
|
+
* This command uses the same geometry as the original but writes only a
|
|
965
|
+
* feature-ID value to the color attachment (no lighting, no material).
|
|
966
|
+
* The fragment shader outputs <code>vec4(featureId, 0, 0, 1)</code>
|
|
967
|
+
* via the <code>PLANAR_FILL_ID_PASS</code> define.
|
|
968
|
+
*
|
|
969
|
+
* No polygon offset is applied: the pre-pass uses the natural depth of the
|
|
970
|
+
* non-behind planar fill geometry (same program as the main command minus
|
|
971
|
+
* the POLYGON_OFFSET path that would shift it).
|
|
972
|
+
*
|
|
973
|
+
* Like the other derived commands (translucent, silhouette, edge, etc.),
|
|
974
|
+
* this is called once per draw command from <code>initialize</code> when the
|
|
975
|
+
* ModelDrawCommand is constructed — not per frame.
|
|
976
|
+
*
|
|
977
|
+
* @param {DrawCommand} command The original draw command.
|
|
978
|
+
* @returns {DrawCommand} The derived command for the feature-ID pass.
|
|
979
|
+
* @private
|
|
980
|
+
*/
|
|
981
|
+
function derivePlanarFillIdCommand(command) {
|
|
982
|
+
const derived = DrawCommand.shallowClone(command);
|
|
983
|
+
derived.pass = Pass.CESIUM_3D_TILE_PLANAR_FILL_ID;
|
|
984
|
+
derived.castShadows = false;
|
|
985
|
+
derived.receiveShadows = false;
|
|
986
|
+
|
|
987
|
+
// Use the same render state but disable blending.
|
|
988
|
+
const rs = clone(command.renderState, true);
|
|
989
|
+
rs.blending.enabled = false;
|
|
990
|
+
derived.renderState = RenderState.fromCache(rs);
|
|
991
|
+
|
|
992
|
+
// Override uniformMap to set u_isPlanarFillIdPass to true for the pre-pass
|
|
993
|
+
const uniformMap = clone(command.uniformMap);
|
|
994
|
+
uniformMap.u_isPlanarFillIdPass = function () {
|
|
995
|
+
return true;
|
|
996
|
+
};
|
|
997
|
+
derived.uniformMap = uniformMap;
|
|
998
|
+
|
|
999
|
+
return derived;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
858
1002
|
function updateSkipLodStencilCommand(drawCommand, tile, use2D) {
|
|
859
1003
|
const stencilDerivedComand = drawCommand._skipLodStencilCommand;
|
|
860
1004
|
const stencilCommand = stencilDerivedComand.command;
|
|
@@ -169,6 +169,9 @@ function buildDrawCommandForModel(
|
|
|
169
169
|
const pickId = hasClassification
|
|
170
170
|
? undefined
|
|
171
171
|
: primitiveRenderResources.pickId;
|
|
172
|
+
const snapId = hasClassification
|
|
173
|
+
? undefined
|
|
174
|
+
: primitiveRenderResources.snapId;
|
|
172
175
|
|
|
173
176
|
const command = new DrawCommand({
|
|
174
177
|
boundingVolume: boundingSphere,
|
|
@@ -182,6 +185,7 @@ function buildDrawCommandForModel(
|
|
|
182
185
|
count: primitiveRenderResources.count,
|
|
183
186
|
owner: model,
|
|
184
187
|
pickId: pickId,
|
|
188
|
+
snapId: snapId,
|
|
185
189
|
pickMetadataAllowed: true,
|
|
186
190
|
instanceCount: primitiveRenderResources.instanceCount,
|
|
187
191
|
primitiveType: primitiveRenderResources.primitiveType,
|
|
@@ -25,7 +25,7 @@ function ModelRenderResources(model) {
|
|
|
25
25
|
* @type {ShaderBuilder}
|
|
26
26
|
* @readonly
|
|
27
27
|
*
|
|
28
|
-
* @
|
|
28
|
+
* @ignore
|
|
29
29
|
*/
|
|
30
30
|
this.shaderBuilder = new ShaderBuilder();
|
|
31
31
|
|
|
@@ -44,9 +44,8 @@ function ModelRenderResources(model) {
|
|
|
44
44
|
* values.
|
|
45
45
|
*
|
|
46
46
|
* @type {Object<string, Function>}
|
|
47
|
-
* @readonly
|
|
48
47
|
*
|
|
49
|
-
* @
|
|
48
|
+
* @ignore
|
|
50
49
|
*/
|
|
51
50
|
this.uniformMap = {};
|
|
52
51
|
|
|
@@ -14,6 +14,7 @@ import ModelArticulation from "./ModelArticulation.js";
|
|
|
14
14
|
import ModelColorPipelineStage from "./ModelColorPipelineStage.js";
|
|
15
15
|
import ModelClippingPlanesPipelineStage from "./ModelClippingPlanesPipelineStage.js";
|
|
16
16
|
import ModelClippingPolygonsPipelineStage from "./ModelClippingPolygonsPipelineStage.js";
|
|
17
|
+
import ModelVectorLookupPipelineStage from "./ModelVectorLookupPipelineStage.js";
|
|
17
18
|
import ModelNode from "./ModelNode.js";
|
|
18
19
|
import ModelRuntimeNode from "./ModelRuntimeNode.js";
|
|
19
20
|
import ModelRuntimePrimitive from "./ModelRuntimePrimitive.js";
|
|
@@ -735,10 +736,18 @@ ModelSceneGraph.prototype.configurePipeline = function (frameState) {
|
|
|
735
736
|
modelPipelineStages.push(ModelClippingPlanesPipelineStage);
|
|
736
737
|
}
|
|
737
738
|
|
|
738
|
-
if
|
|
739
|
+
// Even if a model has a clipping polygon collection, the polygons may not overlap the model geometry,
|
|
740
|
+
// in which case the clipping polygon pipeline stage should not be added.
|
|
741
|
+
const hasClippingPolygonGeometry =
|
|
742
|
+
(model._clippingPolygonData?.polygonRings.length ?? 0) > 0;
|
|
743
|
+
if (model.isClippingPolygonsEnabled() && hasClippingPolygonGeometry) {
|
|
739
744
|
modelPipelineStages.push(ModelClippingPolygonsPipelineStage);
|
|
740
745
|
}
|
|
741
746
|
|
|
747
|
+
if (model.hasDrapedVectors()) {
|
|
748
|
+
modelPipelineStages.push(ModelVectorLookupPipelineStage);
|
|
749
|
+
}
|
|
750
|
+
|
|
742
751
|
if (model.hasSilhouette(frameState)) {
|
|
743
752
|
modelPipelineStages.push(ModelSilhouettePipelineStage);
|
|
744
753
|
}
|
|
@@ -986,6 +995,7 @@ function updatePrimitiveShowBoundingVolume(runtimePrimitive, options) {
|
|
|
986
995
|
|
|
987
996
|
const scratchSilhouetteCommands = [];
|
|
988
997
|
const scratchEdgeCommands = [];
|
|
998
|
+
const scratchPlanarFillIdCommands = [];
|
|
989
999
|
const scratchPushDrawCommandOptions = {
|
|
990
1000
|
frameState: undefined,
|
|
991
1001
|
hasSilhouette: undefined,
|
|
@@ -1011,6 +1021,10 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) {
|
|
|
1011
1021
|
const edgeCommands = scratchEdgeCommands;
|
|
1012
1022
|
edgeCommands.length = 0;
|
|
1013
1023
|
|
|
1024
|
+
// Gather planar fill feature-ID pre-pass commands
|
|
1025
|
+
const planarFillIdCommands = scratchPlanarFillIdCommands;
|
|
1026
|
+
planarFillIdCommands.length = 0;
|
|
1027
|
+
|
|
1014
1028
|
// Since this function is called each frame, the options object is
|
|
1015
1029
|
// preallocated in a scratch variable
|
|
1016
1030
|
const pushDrawCommandOptions = scratchPushDrawCommandOptions;
|
|
@@ -1026,6 +1040,7 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) {
|
|
|
1026
1040
|
|
|
1027
1041
|
addAllToArray(frameState.commandList, silhouetteCommands);
|
|
1028
1042
|
addAllToArray(frameState.commandList, edgeCommands);
|
|
1043
|
+
addAllToArray(frameState.commandList, planarFillIdCommands);
|
|
1029
1044
|
};
|
|
1030
1045
|
|
|
1031
1046
|
// Callback is defined here to avoid allocating a closure in the render loop
|
|
@@ -1036,9 +1051,16 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) {
|
|
|
1036
1051
|
const passes = frameState.passes;
|
|
1037
1052
|
const silhouetteCommands = scratchSilhouetteCommands;
|
|
1038
1053
|
const edgeCommands = scratchEdgeCommands;
|
|
1054
|
+
const planarFillIdCommands = scratchPlanarFillIdCommands;
|
|
1039
1055
|
const primitiveDrawCommand = runtimePrimitive.drawCommand;
|
|
1040
1056
|
primitiveDrawCommand.pushCommands(frameState, frameState.commandList);
|
|
1041
1057
|
|
|
1058
|
+
// Renew the per-frame planar fill request while this primitive renders.
|
|
1059
|
+
const material = runtimePrimitive.primitive.material;
|
|
1060
|
+
if (defined(material) && defined(material.planarFill)) {
|
|
1061
|
+
frameState.planarFillRequested = true;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1042
1064
|
// If a model has silhouettes, the commands that draw the silhouettes for
|
|
1043
1065
|
// each primitive can only be invoked after the entire model has drawn.
|
|
1044
1066
|
// Otherwise, the silhouette may draw on top of the model. This requires
|
|
@@ -1051,6 +1073,14 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) {
|
|
|
1051
1073
|
if (defined(primitiveDrawCommand.pushEdgeCommands)) {
|
|
1052
1074
|
primitiveDrawCommand.pushEdgeCommands(frameState, edgeCommands);
|
|
1053
1075
|
}
|
|
1076
|
+
|
|
1077
|
+
// Add planar fill feature-ID pre-pass commands
|
|
1078
|
+
if (defined(primitiveDrawCommand.pushPlanarFillIdCommands)) {
|
|
1079
|
+
primitiveDrawCommand.pushPlanarFillIdCommands(
|
|
1080
|
+
frameState,
|
|
1081
|
+
planarFillIdCommands,
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1054
1084
|
}
|
|
1055
1085
|
|
|
1056
1086
|
/**
|