@hztxi/cesium-engine 25.0.7 → 26.2.2
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-2FNKHQL3.js +754 -0
- 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-3JZXI44G.js +3822 -0
- package/Build/Workers/chunk-3N2UNLWJ.js +101 -0
- package/Build/Workers/chunk-3NCG2YYR.js +58 -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-4FFIJ7ZV.js +56 -0
- package/Build/Workers/chunk-4N227IPR.js +973 -0
- package/Build/Workers/chunk-4P6OAPBM.js +97 -0
- package/Build/Workers/chunk-4XR3K4GD.js +280 -0
- package/Build/Workers/chunk-4Z2JINRS.js +519 -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-6SEICASZ.js +241 -0
- package/Build/Workers/chunk-77DBX23X.js +455 -0
- package/Build/Workers/chunk-7C2D3DTI.js +959 -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-7T4MW2W4.js +368 -0
- package/Build/Workers/chunk-7UXZUGUZ.js +82 -0
- package/Build/Workers/chunk-7Y642MCO.js +352 -0
- package/Build/Workers/chunk-7ZFKBLUE.js +1054 -0
- package/Build/Workers/chunk-A2UHPWPL.js +38 -0
- package/Build/Workers/chunk-A7LGY5XS.js +140 -0
- package/Build/Workers/chunk-AN2NVYL6.js +1483 -0
- package/Build/Workers/chunk-AS2QC7H2.js +219 -0
- package/Build/Workers/chunk-AVOLMIGJ.js +57 -0
- package/Build/Workers/chunk-B7PT2VL5.js +630 -0
- package/Build/Workers/chunk-BHRHMUDM.js +147 -0
- package/Build/Workers/chunk-BUWAHRK5.js +672 -0
- package/Build/Workers/chunk-C5ET5HON.js +198 -0
- package/Build/Workers/chunk-C6XQGBPV.js +476 -0
- package/Build/Workers/chunk-C7B672RR.js +73 -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-DCMOBPLG.js +352 -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-E6IPM6HP.js +56 -0
- package/Build/Workers/chunk-EB2HAHRY.js +1054 -0
- package/Build/Workers/chunk-ECDCQXCO.js +1992 -0
- package/Build/Workers/chunk-ECN3VUMA.js +73 -0
- package/Build/Workers/chunk-ECSKVHUB.js +476 -0
- package/Build/Workers/chunk-EIENGLA5.js +278 -0
- package/Build/Workers/chunk-EK5CWDW2.js +476 -0
- package/Build/Workers/chunk-EL4B5CSQ.js +162 -0
- package/Build/Workers/chunk-EUCUBIEZ.js +97 -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-FM6EQUFX.js +1800 -0
- package/Build/Workers/chunk-FPFGGQ4X.js +301 -0
- package/Build/Workers/chunk-FQ42MT7M.js +58 -0
- package/Build/Workers/chunk-FQDYQG4P.js +1284 -0
- package/Build/Workers/chunk-FQTV6W3I.js +973 -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-GTA727KQ.js +140 -0
- package/Build/Workers/chunk-GVUJ6O3R.js +73 -0
- package/Build/Workers/chunk-GXTM7AG3.js +1483 -0
- package/Build/Workers/chunk-HAXQB2FS.js +2719 -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-IEPPOHF3.js +44 -0
- package/Build/Workers/chunk-IU3YAYPT.js +1344 -0
- package/Build/Workers/chunk-J3AXZ4WC.js +124 -0
- package/Build/Workers/chunk-J7MZR7B2.js +1483 -0
- package/Build/Workers/chunk-KBNW776Q.js +305 -0
- package/Build/Workers/chunk-KBSWXVSY.js +837 -0
- package/Build/Workers/chunk-KEYTLNVK.js +1067 -0
- package/Build/Workers/chunk-KN3RQWUA.js +3201 -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-L2TFZKN6.js +455 -0
- package/Build/Workers/chunk-LHKE2VUR.js +945 -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-MICPAD7R.js +398 -0
- package/Build/Workers/chunk-ML7OMD72.js +2342 -0
- package/Build/Workers/chunk-MPJ73WMH.js +138 -0
- package/Build/Workers/chunk-MUTHG7T7.js +171 -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-PHUELDXQ.js +76 -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-PQZW2QZG.js +163 -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-R2JQAAU7.js +630 -0
- package/Build/Workers/chunk-RC4YC3VU.js +278 -0
- package/Build/Workers/chunk-RGNNWVR6.js +171 -0
- package/Build/Workers/chunk-RUOETBWP.js +288 -0
- package/Build/Workers/chunk-RV4EPLBO.js +2342 -0
- package/Build/Workers/chunk-SBBIEHYT.js +44 -0
- package/Build/Workers/chunk-SBEQLEO5.js +352 -0
- package/Build/Workers/chunk-SGC2GT3Y.js +1284 -0
- package/Build/Workers/chunk-SKLK4CBL.js +162 -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-TNDQT5AB.js +682 -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-VDBQVKTF.js +387 -0
- package/Build/Workers/chunk-VJIL5H6K.js +2719 -0
- package/Build/Workers/chunk-VJLDRHKN.js +511 -0
- package/Build/Workers/chunk-VMF7KOGY.js +162 -0
- package/Build/Workers/chunk-W3X2ZAEJ.js +52 -0
- package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
- package/Build/Workers/chunk-X4VZ33YL.js +454 -0
- package/Build/Workers/chunk-XDM5A6C4.js +102 -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-Y6AQK4FY.js +1344 -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-YJBPRW4A.js +415 -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-YX2FOQMF.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 +214 -184
- package/package.json +13 -13
|
@@ -15,6 +15,8 @@ import czm_passCesium3DTile from './Constants/passCesium3DTile.js'
|
|
|
15
15
|
import czm_passCesium3DTileClassification from './Constants/passCesium3DTileClassification.js'
|
|
16
16
|
import czm_passCesium3DTileClassificationIgnoreShow from './Constants/passCesium3DTileClassificationIgnoreShow.js'
|
|
17
17
|
import czm_passCesium3DTileEdges from './Constants/passCesium3DTileEdges.js'
|
|
18
|
+
import czm_passCesium3DTileEdgesDirect from './Constants/passCesium3DTileEdgesDirect.js'
|
|
19
|
+
import czm_passCesium3DTilePlanarFillId from './Constants/passCesium3DTilePlanarFillId.js'
|
|
18
20
|
import czm_passClassification from './Constants/passClassification.js'
|
|
19
21
|
import czm_passCompute from './Constants/passCompute.js'
|
|
20
22
|
import czm_passEnvironment from './Constants/passEnvironment.js'
|
|
@@ -158,6 +160,8 @@ export default {
|
|
|
158
160
|
czm_passCesium3DTileClassification : czm_passCesium3DTileClassification,
|
|
159
161
|
czm_passCesium3DTileClassificationIgnoreShow : czm_passCesium3DTileClassificationIgnoreShow,
|
|
160
162
|
czm_passCesium3DTileEdges : czm_passCesium3DTileEdges,
|
|
163
|
+
czm_passCesium3DTileEdgesDirect : czm_passCesium3DTileEdgesDirect,
|
|
164
|
+
czm_passCesium3DTilePlanarFillId : czm_passCesium3DTilePlanarFillId,
|
|
161
165
|
czm_passClassification : czm_passClassification,
|
|
162
166
|
czm_passCompute : czm_passCompute,
|
|
163
167
|
czm_passEnvironment : czm_passEnvironment,
|
|
@@ -121,7 +121,7 @@ uniform float u_minimumBrightness;
|
|
|
121
121
|
#endif
|
|
122
122
|
|
|
123
123
|
// Based on colorCorrect
|
|
124
|
-
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
|
|
124
|
+
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
|
|
125
125
|
// are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
|
|
126
126
|
// - The tileProvider.hue/saturation/brightnessShift are just passed through
|
|
127
127
|
// from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
|
|
@@ -149,8 +149,8 @@ uniform vec4 u_translucencyRectangle;
|
|
|
149
149
|
#endif
|
|
150
150
|
|
|
151
151
|
// Based on showUndergroundColor
|
|
152
|
-
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible
|
|
153
|
-
// returns true, AND the tileProvider.undergroundColor had a value with
|
|
152
|
+
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible
|
|
153
|
+
// returns true, AND the tileProvider.undergroundColor had a value with
|
|
154
154
|
// nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
|
|
155
155
|
// was in the right range
|
|
156
156
|
#ifdef UNDERGROUND_COLOR
|
|
@@ -618,11 +618,16 @@ void main()
|
|
|
618
618
|
}
|
|
619
619
|
#endif
|
|
620
620
|
|
|
621
|
+
#ifdef HAS_VECTOR_LAYER
|
|
622
|
+
finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor);
|
|
623
|
+
finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor);
|
|
624
|
+
#endif
|
|
625
|
+
|
|
621
626
|
#ifdef TRANSLUCENT
|
|
622
627
|
if (inTranslucencyRectangle())
|
|
623
628
|
{
|
|
624
|
-
|
|
625
|
-
|
|
629
|
+
vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
|
|
630
|
+
finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
|
|
626
631
|
}
|
|
627
632
|
#endif
|
|
628
633
|
|
|
@@ -732,4 +737,3 @@ vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat
|
|
|
732
737
|
}
|
|
733
738
|
|
|
734
739
|
#endif // #ifdef SHOW_REFLECTIVE_OCEAN
|
|
735
|
-
|
|
@@ -122,7 +122,7 @@ uniform float u_minimumBrightness;\n\
|
|
|
122
122
|
#endif\n\
|
|
123
123
|
\n\
|
|
124
124
|
// Based on colorCorrect\n\
|
|
125
|
-
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
|
|
125
|
+
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift\n\
|
|
126
126
|
// are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider\n\
|
|
127
127
|
// - The tileProvider.hue/saturation/brightnessShift are just passed through\n\
|
|
128
128
|
// from the Globe hue/saturation/brightness, like atmosphereBrightnessShift\n\
|
|
@@ -150,8 +150,8 @@ uniform vec4 u_translucencyRectangle;\n\
|
|
|
150
150
|
#endif\n\
|
|
151
151
|
\n\
|
|
152
152
|
// Based on showUndergroundColor\n\
|
|
153
|
-
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible
|
|
154
|
-
// returns true, AND the tileProvider.undergroundColor had a value with
|
|
153
|
+
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible\n\
|
|
154
|
+
// returns true, AND the tileProvider.undergroundColor had a value with\n\
|
|
155
155
|
// nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance\n\
|
|
156
156
|
// was in the right range\n\
|
|
157
157
|
#ifdef UNDERGROUND_COLOR\n\
|
|
@@ -619,11 +619,16 @@ void main()\n\
|
|
|
619
619
|
}\n\
|
|
620
620
|
#endif\n\
|
|
621
621
|
\n\
|
|
622
|
+
#ifdef HAS_VECTOR_LAYER\n\
|
|
623
|
+
finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor);\n\
|
|
624
|
+
finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor);\n\
|
|
625
|
+
#endif\n\
|
|
626
|
+
\n\
|
|
622
627
|
#ifdef TRANSLUCENT\n\
|
|
623
628
|
if (inTranslucencyRectangle())\n\
|
|
624
629
|
{\n\
|
|
625
|
-
|
|
626
|
-
|
|
630
|
+
vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\n\
|
|
631
|
+
finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n\
|
|
627
632
|
}\n\
|
|
628
633
|
#endif\n\
|
|
629
634
|
\n\
|
|
@@ -733,5 +738,4 @@ vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat
|
|
|
733
738
|
}\n\
|
|
734
739
|
\n\
|
|
735
740
|
#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n\
|
|
736
|
-
\n\
|
|
737
741
|
";
|
|
@@ -15,7 +15,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
15
15
|
|
|
16
16
|
vec4 fragColor;
|
|
17
17
|
fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
|
|
18
|
-
fragColor.a = clamp(0.0, 1.0
|
|
18
|
+
fragColor.a = clamp(glow, 0.0, 1.0) * color.a;
|
|
19
19
|
fragColor = czm_gammaCorrect(fragColor);
|
|
20
20
|
|
|
21
21
|
material.emission = fragColor.rgb;
|
|
@@ -16,7 +16,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
|
16
16
|
\n\
|
|
17
17
|
vec4 fragColor;\n\
|
|
18
18
|
fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n\
|
|
19
|
-
fragColor.a = clamp(0.0, 1.0
|
|
19
|
+
fragColor.a = clamp(glow, 0.0, 1.0) * color.a;\n\
|
|
20
20
|
fragColor = czm_gammaCorrect(fragColor);\n\
|
|
21
21
|
\n\
|
|
22
22
|
material.emission = fragColor.rgb;\n\
|
|
@@ -6,7 +6,6 @@ void edgeVisibilityStageVS() {\n\
|
|
|
6
6
|
}\n\
|
|
7
7
|
\n\
|
|
8
8
|
v_edgeType = a_edgeType;\n\
|
|
9
|
-
v_silhouetteNormalView = czm_normal * a_silhouetteNormal;\n\
|
|
10
9
|
v_faceNormalAView = czm_normal * a_faceNormalA;\n\
|
|
11
10
|
v_faceNormalBView = czm_normal * a_faceNormalB;\n\
|
|
12
11
|
v_edgeOffset = a_edgeOffset;\n\
|
|
@@ -463,8 +463,14 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
463
463
|
#endif
|
|
464
464
|
|
|
465
465
|
vec4 baseColorWithAlpha = vec4(1.0);
|
|
466
|
-
// Regardless of whether we use PBR, set a base color
|
|
467
|
-
|
|
466
|
+
// Regardless of whether we use PBR, set a base color.
|
|
467
|
+
// HAS_BACKGROUND_FILL (from BENTLEY_materials_planar_fill) overrides with
|
|
468
|
+
// the view's background color to create an invisible masking polygon.
|
|
469
|
+
// The background color is in sRGB, so convert to linear to match the
|
|
470
|
+
// material pipeline's expected color space.
|
|
471
|
+
#ifdef HAS_BACKGROUND_FILL
|
|
472
|
+
baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor);
|
|
473
|
+
#elif defined(HAS_BASE_COLOR_TEXTURE)
|
|
468
474
|
baseColorWithAlpha = getBaseColorFromTexture();
|
|
469
475
|
#elif defined(HAS_BASE_COLOR_FACTOR)
|
|
470
476
|
baseColorWithAlpha = u_baseColorFactor;
|
|
@@ -464,8 +464,14 @@ void materialStage(inout czm_modelMaterial material, ProcessedAttributes attribu
|
|
|
464
464
|
#endif\n\
|
|
465
465
|
\n\
|
|
466
466
|
vec4 baseColorWithAlpha = vec4(1.0);\n\
|
|
467
|
-
// Regardless of whether we use PBR, set a base color
|
|
468
|
-
|
|
467
|
+
// Regardless of whether we use PBR, set a base color.\n\
|
|
468
|
+
// HAS_BACKGROUND_FILL (from BENTLEY_materials_planar_fill) overrides with\n\
|
|
469
|
+
// the view's background color to create an invisible masking polygon.\n\
|
|
470
|
+
// The background color is in sRGB, so convert to linear to match the\n\
|
|
471
|
+
// material pipeline's expected color space.\n\
|
|
472
|
+
#ifdef HAS_BACKGROUND_FILL\n\
|
|
473
|
+
baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor);\n\
|
|
474
|
+
#elif defined(HAS_BASE_COLOR_TEXTURE)\n\
|
|
469
475
|
baseColorWithAlpha = getBaseColorFromTexture();\n\
|
|
470
476
|
#elif defined(HAS_BASE_COLOR_FACTOR)\n\
|
|
471
477
|
baseColorWithAlpha = u_baseColorFactor;\n\
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
|
|
2
2
|
precision highp float;
|
|
3
3
|
|
|
4
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
5
|
+
// BENTLEY_materials_planar_fill constants
|
|
6
|
+
//
|
|
7
|
+
// These factors scale gl_FragDepth AFTER czm_writeLogDepth has run, so
|
|
8
|
+
// they are proportional offsets in log-depth space. The corresponding
|
|
9
|
+
// eye-space offset therefore varies with the fragment's distance from
|
|
10
|
+
// the camera (growing with distance). This is the intended behavior: it
|
|
11
|
+
// matches the proportional depth comparison tolerance used by the edge
|
|
12
|
+
// visibility system, so fills and edges stay consistently ordered at all
|
|
13
|
+
// viewing distances.
|
|
14
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
15
|
+
// Depth pull factor for all planar fills: scales log depth by 0.9995,
|
|
16
|
+
// i.e. a 0.05% pull toward the camera in log-depth space.
|
|
17
|
+
const float PLANAR_DEPTH_PULL = 0.9995;
|
|
18
|
+
// Depth push factor for behind fills: scales log depth by 1.0002, i.e. a
|
|
19
|
+
// 0.02% push away from the camera in log-depth space, so behind fills sit
|
|
20
|
+
// behind same-object siblings.
|
|
21
|
+
const float BEHIND_DEPTH_PUSH = 1.0002;
|
|
22
|
+
// Tolerance for comparing feature IDs stored as floats (integer equality).
|
|
23
|
+
const float FEATURE_ID_TOLERANCE = 0.5;
|
|
24
|
+
// Offset added to feature IDs so 0 means "no planar fill" in the texture.
|
|
25
|
+
const float FEATURE_ID_OFFSET = 1.0;
|
|
26
|
+
|
|
4
27
|
czm_modelMaterial defaultModelMaterial()
|
|
5
28
|
{
|
|
6
29
|
czm_modelMaterial material;
|
|
@@ -40,6 +63,10 @@ void lineStyleStage()
|
|
|
40
63
|
|
|
41
64
|
SelectedFeature selectedFeature;
|
|
42
65
|
|
|
66
|
+
// Set by edge-pass fragments below; consumed by the snapId expression built
|
|
67
|
+
// in PickingPipelineStage (see Scene#snap).
|
|
68
|
+
bool isEdge = false;
|
|
69
|
+
|
|
43
70
|
void main()
|
|
44
71
|
{
|
|
45
72
|
#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)
|
|
@@ -69,6 +96,26 @@ void main()
|
|
|
69
96
|
FeatureIds featureIds;
|
|
70
97
|
featureIdStage(featureIds, attributes);
|
|
71
98
|
|
|
99
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
100
|
+
// BENTLEY_materials_planar_fill: Feature-ID pre-pass output.
|
|
101
|
+
//
|
|
102
|
+
// When HAS_PLANAR_FILL_ID_PASS is defined this command is being rendered
|
|
103
|
+
// into the planar fill ID framebuffer. Non-behind planar geometry writes
|
|
104
|
+
// its feature ID + 1 into the R channel (0 = no feature) and returns.
|
|
105
|
+
// No material / lighting / post-process stages are needed.
|
|
106
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
107
|
+
#ifdef HAS_PLANAR_FILL_ID_PASS
|
|
108
|
+
if (u_isPlanarFillIdPass) {
|
|
109
|
+
float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET;
|
|
110
|
+
out_FragColor = vec4(fid, 0.0, 0.0, 1.0);
|
|
111
|
+
// Still need to write log depth so the depth buffer is correct.
|
|
112
|
+
#ifdef LOG_DEPTH
|
|
113
|
+
czm_writeLogDepth();
|
|
114
|
+
#endif
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
#endif
|
|
118
|
+
|
|
72
119
|
Metadata metadata;
|
|
73
120
|
MetadataClass metadataClass;
|
|
74
121
|
MetadataStatistics metadataStatistics;
|
|
@@ -145,6 +192,12 @@ void main()
|
|
|
145
192
|
#ifdef HAS_EDGE_VISIBILITY
|
|
146
193
|
edgeVisibilityStage(color, featureIds);
|
|
147
194
|
edgeDetectionStage(color, featureIds);
|
|
195
|
+
// Edge-pass fragments rasterize the edge band itself. Flag them so the
|
|
196
|
+
// snap payload (see Scene#snap) can distinguish edges from surfaces;
|
|
197
|
+
// surface fragments leave isEdge false.
|
|
198
|
+
if (u_isEdgePass) {
|
|
199
|
+
isEdge = true;
|
|
200
|
+
}
|
|
148
201
|
#endif
|
|
149
202
|
|
|
150
203
|
#endif
|
|
@@ -152,5 +205,57 @@ void main()
|
|
|
152
205
|
//========================================================================
|
|
153
206
|
|
|
154
207
|
out_FragColor = color;
|
|
208
|
+
|
|
209
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
210
|
+
// Explicit log-depth write.
|
|
211
|
+
//
|
|
212
|
+
// DerivedCommand.getLogDepthShaderProgram auto-wraps only when the raw
|
|
213
|
+
// source does NOT already mention czm_writeLogDepth. We mention it
|
|
214
|
+
// above in the HAS_PLANAR_FILL_ID_PASS block, so we must also handle
|
|
215
|
+
// the normal code path ourselves. The LOG_DEPTH define is injected by
|
|
216
|
+
// that same auto-wrapper, so this block is active exactly when needed.
|
|
217
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
218
|
+
#ifdef LOG_DEPTH
|
|
219
|
+
czm_writeLogDepth();
|
|
220
|
+
#endif
|
|
221
|
+
|
|
222
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
223
|
+
// BENTLEY_materials_planar_fill: Proportional depth adjustment.
|
|
224
|
+
//
|
|
225
|
+
// Per the spec, planar primitives must render in front of non-planar
|
|
226
|
+
// geometry. We use proportional depth scaling (similar to edge visibility)
|
|
227
|
+
// which scales naturally with logarithmic depth at all viewing distances.
|
|
228
|
+
//
|
|
229
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
230
|
+
#ifdef HAS_PLANAR_FILL_DEPTH
|
|
231
|
+
gl_FragDepth *= PLANAR_DEPTH_PULL;
|
|
232
|
+
#endif
|
|
233
|
+
|
|
234
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
235
|
+
// BENTLEY_materials_planar_fill: Behind fill depth adjustment.
|
|
236
|
+
//
|
|
237
|
+
// After the proportional depth pull has been applied, sample the planar
|
|
238
|
+
// fill ID texture. If the pixel already belongs to the same feature,
|
|
239
|
+
// apply a small proportional push so this "behind" fill sits behind its
|
|
240
|
+
// non-behind sibling. If the pixel has no stored feature, the base pull
|
|
241
|
+
// still keeps us in front of non-planar geometry.
|
|
242
|
+
//
|
|
243
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
244
|
+
#ifdef HAS_PLANAR_FILL_BEHIND
|
|
245
|
+
{
|
|
246
|
+
vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
|
|
247
|
+
float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r;
|
|
248
|
+
float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET;
|
|
249
|
+
float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID);
|
|
250
|
+
|
|
251
|
+
// storedFeatureId < 0 means "no planar fill at this pixel".
|
|
252
|
+
if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) {
|
|
253
|
+
// Proportional push: multiply by >1 to move away from camera.
|
|
254
|
+
// Net effect: PLANAR_DEPTH_PULL * BEHIND_DEPTH_PUSH ≈ 0.9997,
|
|
255
|
+
// still in front of non-planar but behind same-feature non-behind fills.
|
|
256
|
+
gl_FragDepth *= BEHIND_DEPTH_PUSH;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
#endif
|
|
155
260
|
}
|
|
156
261
|
|
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
export default "\n\
|
|
3
3
|
precision highp float;\n\
|
|
4
4
|
\n\
|
|
5
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
6
|
+
// BENTLEY_materials_planar_fill constants\n\
|
|
7
|
+
//\n\
|
|
8
|
+
// These factors scale gl_FragDepth AFTER czm_writeLogDepth has run, so\n\
|
|
9
|
+
// they are proportional offsets in log-depth space. The corresponding\n\
|
|
10
|
+
// eye-space offset therefore varies with the fragment's distance from\n\
|
|
11
|
+
// the camera (growing with distance). This is the intended behavior: it\n\
|
|
12
|
+
// matches the proportional depth comparison tolerance used by the edge\n\
|
|
13
|
+
// visibility system, so fills and edges stay consistently ordered at all\n\
|
|
14
|
+
// viewing distances.\n\
|
|
15
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
16
|
+
// Depth pull factor for all planar fills: scales log depth by 0.9995,\n\
|
|
17
|
+
// i.e. a 0.05% pull toward the camera in log-depth space.\n\
|
|
18
|
+
const float PLANAR_DEPTH_PULL = 0.9995;\n\
|
|
19
|
+
// Depth push factor for behind fills: scales log depth by 1.0002, i.e. a\n\
|
|
20
|
+
// 0.02% push away from the camera in log-depth space, so behind fills sit\n\
|
|
21
|
+
// behind same-object siblings.\n\
|
|
22
|
+
const float BEHIND_DEPTH_PUSH = 1.0002;\n\
|
|
23
|
+
// Tolerance for comparing feature IDs stored as floats (integer equality).\n\
|
|
24
|
+
const float FEATURE_ID_TOLERANCE = 0.5;\n\
|
|
25
|
+
// Offset added to feature IDs so 0 means \"no planar fill\" in the texture.\n\
|
|
26
|
+
const float FEATURE_ID_OFFSET = 1.0;\n\
|
|
27
|
+
\n\
|
|
5
28
|
czm_modelMaterial defaultModelMaterial()\n\
|
|
6
29
|
{\n\
|
|
7
30
|
czm_modelMaterial material;\n\
|
|
@@ -41,6 +64,10 @@ void lineStyleStage()\n\
|
|
|
41
64
|
\n\
|
|
42
65
|
SelectedFeature selectedFeature;\n\
|
|
43
66
|
\n\
|
|
67
|
+
// Set by edge-pass fragments below; consumed by the snapId expression built\n\
|
|
68
|
+
// in PickingPipelineStage (see Scene#snap).\n\
|
|
69
|
+
bool isEdge = false;\n\
|
|
70
|
+
\n\
|
|
44
71
|
void main()\n\
|
|
45
72
|
{\n\
|
|
46
73
|
#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)\n\
|
|
@@ -69,6 +96,26 @@ void main()\n\
|
|
|
69
96
|
\n\
|
|
70
97
|
FeatureIds featureIds;\n\
|
|
71
98
|
featureIdStage(featureIds, attributes);\n\
|
|
99
|
+
\n\
|
|
100
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
101
|
+
// BENTLEY_materials_planar_fill: Feature-ID pre-pass output.\n\
|
|
102
|
+
//\n\
|
|
103
|
+
// When HAS_PLANAR_FILL_ID_PASS is defined this command is being rendered\n\
|
|
104
|
+
// into the planar fill ID framebuffer. Non-behind planar geometry writes\n\
|
|
105
|
+
// its feature ID + 1 into the R channel (0 = no feature) and returns.\n\
|
|
106
|
+
// No material / lighting / post-process stages are needed.\n\
|
|
107
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
108
|
+
#ifdef HAS_PLANAR_FILL_ID_PASS\n\
|
|
109
|
+
if (u_isPlanarFillIdPass) {\n\
|
|
110
|
+
float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET;\n\
|
|
111
|
+
out_FragColor = vec4(fid, 0.0, 0.0, 1.0);\n\
|
|
112
|
+
// Still need to write log depth so the depth buffer is correct.\n\
|
|
113
|
+
#ifdef LOG_DEPTH\n\
|
|
114
|
+
czm_writeLogDepth();\n\
|
|
115
|
+
#endif\n\
|
|
116
|
+
return;\n\
|
|
117
|
+
}\n\
|
|
118
|
+
#endif\n\
|
|
72
119
|
\n\
|
|
73
120
|
Metadata metadata;\n\
|
|
74
121
|
MetadataClass metadataClass;\n\
|
|
@@ -146,6 +193,12 @@ void main()\n\
|
|
|
146
193
|
#ifdef HAS_EDGE_VISIBILITY\n\
|
|
147
194
|
edgeVisibilityStage(color, featureIds);\n\
|
|
148
195
|
edgeDetectionStage(color, featureIds);\n\
|
|
196
|
+
// Edge-pass fragments rasterize the edge band itself. Flag them so the\n\
|
|
197
|
+
// snap payload (see Scene#snap) can distinguish edges from surfaces;\n\
|
|
198
|
+
// surface fragments leave isEdge false.\n\
|
|
199
|
+
if (u_isEdgePass) {\n\
|
|
200
|
+
isEdge = true;\n\
|
|
201
|
+
}\n\
|
|
149
202
|
#endif\n\
|
|
150
203
|
\n\
|
|
151
204
|
#endif\n\
|
|
@@ -153,6 +206,58 @@ void main()\n\
|
|
|
153
206
|
//========================================================================\n\
|
|
154
207
|
\n\
|
|
155
208
|
out_FragColor = color;\n\
|
|
209
|
+
\n\
|
|
210
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
211
|
+
// Explicit log-depth write.\n\
|
|
212
|
+
//\n\
|
|
213
|
+
// DerivedCommand.getLogDepthShaderProgram auto-wraps only when the raw\n\
|
|
214
|
+
// source does NOT already mention czm_writeLogDepth. We mention it\n\
|
|
215
|
+
// above in the HAS_PLANAR_FILL_ID_PASS block, so we must also handle\n\
|
|
216
|
+
// the normal code path ourselves. The LOG_DEPTH define is injected by\n\
|
|
217
|
+
// that same auto-wrapper, so this block is active exactly when needed.\n\
|
|
218
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
219
|
+
#ifdef LOG_DEPTH\n\
|
|
220
|
+
czm_writeLogDepth();\n\
|
|
221
|
+
#endif\n\
|
|
222
|
+
\n\
|
|
223
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
224
|
+
// BENTLEY_materials_planar_fill: Proportional depth adjustment.\n\
|
|
225
|
+
//\n\
|
|
226
|
+
// Per the spec, planar primitives must render in front of non-planar\n\
|
|
227
|
+
// geometry. We use proportional depth scaling (similar to edge visibility)\n\
|
|
228
|
+
// which scales naturally with logarithmic depth at all viewing distances.\n\
|
|
229
|
+
//\n\
|
|
230
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
231
|
+
#ifdef HAS_PLANAR_FILL_DEPTH\n\
|
|
232
|
+
gl_FragDepth *= PLANAR_DEPTH_PULL;\n\
|
|
233
|
+
#endif\n\
|
|
234
|
+
\n\
|
|
235
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
236
|
+
// BENTLEY_materials_planar_fill: Behind fill depth adjustment.\n\
|
|
237
|
+
//\n\
|
|
238
|
+
// After the proportional depth pull has been applied, sample the planar\n\
|
|
239
|
+
// fill ID texture. If the pixel already belongs to the same feature,\n\
|
|
240
|
+
// apply a small proportional push so this \"behind\" fill sits behind its\n\
|
|
241
|
+
// non-behind sibling. If the pixel has no stored feature, the base pull\n\
|
|
242
|
+
// still keeps us in front of non-planar geometry.\n\
|
|
243
|
+
//\n\
|
|
244
|
+
// ──────────────────────────────────────────────────────────────────────\n\
|
|
245
|
+
#ifdef HAS_PLANAR_FILL_BEHIND\n\
|
|
246
|
+
{\n\
|
|
247
|
+
vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;\n\
|
|
248
|
+
float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r;\n\
|
|
249
|
+
float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET;\n\
|
|
250
|
+
float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID);\n\
|
|
251
|
+
\n\
|
|
252
|
+
// storedFeatureId < 0 means \"no planar fill at this pixel\".\n\
|
|
253
|
+
if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) {\n\
|
|
254
|
+
// Proportional push: multiply by >1 to move away from camera.\n\
|
|
255
|
+
// Net effect: PLANAR_DEPTH_PULL * BEHIND_DEPTH_PUSH ≈ 0.9997,\n\
|
|
256
|
+
// still in front of non-planar but behind same-feature non-behind fills.\n\
|
|
257
|
+
gl_FragDepth *= BEHIND_DEPTH_PUSH;\n\
|
|
258
|
+
}\n\
|
|
259
|
+
}\n\
|
|
260
|
+
#endif\n\
|
|
156
261
|
}\n\
|
|
157
262
|
\n\
|
|
158
263
|
";
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
uniform highp sampler2D u_vectorSegmentTexture;
|
|
2
|
+
uniform highp sampler2D u_vectorWidthTexture;
|
|
3
|
+
uniform highp sampler2D u_vectorColorTexture;
|
|
4
|
+
uniform highp sampler2D u_vectorSegmentPrimitiveIndicesTexture;
|
|
5
|
+
uniform highp sampler2D u_vectorGridCellIndicesTexture;
|
|
6
|
+
uniform highp sampler2D u_vectorPolygonEdgeTexture;
|
|
7
|
+
uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture;
|
|
8
|
+
uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture;
|
|
9
|
+
|
|
10
|
+
// UV-space offset from the closest point on the segment to p.
|
|
11
|
+
vec2 vectorOffsetToLine(vec2 p, vec4 line)
|
|
12
|
+
{
|
|
13
|
+
vec2 a = line.xy;
|
|
14
|
+
vec2 b = line.zw;
|
|
15
|
+
vec2 ab = b - a;
|
|
16
|
+
float abLengthSquared = dot(ab, ab);
|
|
17
|
+
if (abLengthSquared < 1.0e-8)
|
|
18
|
+
{
|
|
19
|
+
return p - a;
|
|
20
|
+
}
|
|
21
|
+
float t = clamp(dot(p - a, ab) / abLengthSquared, 0.0, 1.0);
|
|
22
|
+
return p - (a + t * ab);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ivec2 vectorIndexToUv(int index, ivec2 size)
|
|
26
|
+
{
|
|
27
|
+
int v = index / size.x;
|
|
28
|
+
int u = index - v * size.x;
|
|
29
|
+
return ivec2(u, v);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Drape clamped vector polylines onto the terrain surface. The fragment's
|
|
33
|
+
// tile UV picks a grid cell, then only that cell's line segments (packed in
|
|
34
|
+
// tile-local UV space) are tested for proximity. Within the line width, the
|
|
35
|
+
// vector color is alpha-composited over the terrain (no discard).
|
|
36
|
+
vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor)
|
|
37
|
+
{
|
|
38
|
+
// A tile without polylines binds a 1x1 placeholder; a real grid header
|
|
39
|
+
// [gridWidth, gridHeight, ...] is at least 3 texels.
|
|
40
|
+
ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0);
|
|
41
|
+
if (headerSize.x * headerSize.y < 3)
|
|
42
|
+
{
|
|
43
|
+
return baseColor;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Inverse UV-per-pixel Jacobian: measures line distance in screen pixels so
|
|
47
|
+
// width stays constant under anisotropic (oblique) foreshortening.
|
|
48
|
+
mat2 screenFromUv = inverse(mat2(dFdx(vectorUv), dFdy(vectorUv)));
|
|
49
|
+
int gridWidth = int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r);
|
|
50
|
+
int gridHeight = int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r);
|
|
51
|
+
int cellX = clamp(int(vectorUv.x * float(gridWidth)), 0, gridWidth - 1);
|
|
52
|
+
int cellY = clamp(int(vectorUv.y * float(gridHeight)), 0, gridHeight - 1);
|
|
53
|
+
int cellIndex = cellX + cellY * gridWidth;
|
|
54
|
+
|
|
55
|
+
// Cell end offsets follow the two gridWidth/gridHeight texels, so cell
|
|
56
|
+
// N's end is at texel N + 2. A cell's start is the previous cell's end
|
|
57
|
+
// (texel N + 1); cell 0's start is implicitly 0.
|
|
58
|
+
int indexEnd = int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r);
|
|
59
|
+
int indexStart = cellIndex == 0
|
|
60
|
+
? 0
|
|
61
|
+
: int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r);
|
|
62
|
+
|
|
63
|
+
ivec2 segmentTextureSize = textureSize(u_vectorSegmentTexture, 0);
|
|
64
|
+
ivec2 primitiveTextureSize = textureSize(u_vectorWidthTexture, 0);
|
|
65
|
+
|
|
66
|
+
for (int i = indexStart; i < indexEnd; i++)
|
|
67
|
+
{
|
|
68
|
+
ivec2 segmentUv = vectorIndexToUv(i, segmentTextureSize);
|
|
69
|
+
vec4 segment = texelFetch(u_vectorSegmentTexture, segmentUv, 0);
|
|
70
|
+
|
|
71
|
+
int primitiveIndex = int(texelFetch(u_vectorSegmentPrimitiveIndicesTexture, segmentUv, 0).r);
|
|
72
|
+
ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize);
|
|
73
|
+
|
|
74
|
+
float lineWidth = texelFetch(u_vectorWidthTexture, primitiveUv, 0).r * 255.0;
|
|
75
|
+
|
|
76
|
+
vec2 offsetUv = vectorOffsetToLine(vectorUv, segment);
|
|
77
|
+
if (length(screenFromUv * offsetUv) < lineWidth)
|
|
78
|
+
{
|
|
79
|
+
// Alpha-composite vector over terrain.
|
|
80
|
+
vec4 vectorColor = texelFetch(u_vectorColorTexture, primitiveUv, 0);
|
|
81
|
+
baseColor = vectorColor * vec4(vectorColor.aaa, 1.0) + baseColor * (1.0 - vectorColor.a);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return baseColor;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Composites a polygon's fill over baseColor when the pixel is inside it. A
|
|
90
|
+
// negative index (empty cell or first iteration) or an outside pixel is a
|
|
91
|
+
// no-op.
|
|
92
|
+
vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize)
|
|
93
|
+
{
|
|
94
|
+
if (!inside || primitiveIndex < 0)
|
|
95
|
+
{
|
|
96
|
+
return baseColor;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize);
|
|
100
|
+
vec4 fillColor = texelFetch(u_vectorColorTexture, primitiveUv, 0);
|
|
101
|
+
return fillColor * vec4(fillColor.aaa, 1.0) + baseColor * (1.0 - fillColor.a);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// True if a horizontal +x ray from p crosses the edge. The half-open interval
|
|
105
|
+
// (> vs <=) counts a ray through a shared vertex exactly once.
|
|
106
|
+
bool vectorEdgeCrossesRay(vec4 edge, vec2 p)
|
|
107
|
+
{
|
|
108
|
+
if ((edge.y > p.y) == (edge.w > p.y))
|
|
109
|
+
{
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
float t = (p.y - edge.y) / (edge.w - edge.y);
|
|
114
|
+
float xIntersect = edge.x + t * (edge.z - edge.x);
|
|
115
|
+
return p.x < xIntersect;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Drape clamped vector polygon fills onto the terrain surface. The fragment's
|
|
119
|
+
// tile UV picks a grid cell whose edges were clipped to the cell on the CPU,
|
|
120
|
+
// forming closed loops, so an even-odd horizontal ray cast within the cell
|
|
121
|
+
// decides coverage. Edges arrive grouped by primitive; each covering
|
|
122
|
+
// primitive's fill color is alpha-composited in primitive order (no discard).
|
|
123
|
+
vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor)
|
|
124
|
+
{
|
|
125
|
+
// A tile without polygons binds a 1x1 placeholder; a real grid header
|
|
126
|
+
// [gridWidth, gridHeight, ...] is at least 3 texels.
|
|
127
|
+
ivec2 headerSize = textureSize(u_vectorPolygonGridCellIndicesTexture, 0);
|
|
128
|
+
if (headerSize.x * headerSize.y < 3)
|
|
129
|
+
{
|
|
130
|
+
return baseColor;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
int gridWidth = int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r);
|
|
134
|
+
int gridHeight = int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r);
|
|
135
|
+
int cellX = clamp(int(vectorUv.x * float(gridWidth)), 0, gridWidth - 1);
|
|
136
|
+
int cellY = clamp(int(vectorUv.y * float(gridHeight)), 0, gridHeight - 1);
|
|
137
|
+
int cellIndex = cellX + cellY * gridWidth;
|
|
138
|
+
|
|
139
|
+
// Cell end offsets follow the two gridWidth/gridHeight texels, so cell
|
|
140
|
+
// N's end is at texel N + 2. A cell's start is the previous cell's end
|
|
141
|
+
// (texel N + 1); cell 0's start is implicitly 0.
|
|
142
|
+
int indexEnd = int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r);
|
|
143
|
+
int indexStart = cellIndex == 0
|
|
144
|
+
? 0
|
|
145
|
+
: int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r);
|
|
146
|
+
|
|
147
|
+
ivec2 edgeTextureSize = textureSize(u_vectorPolygonEdgeTexture, 0);
|
|
148
|
+
ivec2 primitiveTextureSize = textureSize(u_vectorColorTexture, 0);
|
|
149
|
+
|
|
150
|
+
int currentPrimitive = -1;
|
|
151
|
+
bool inside = false;
|
|
152
|
+
|
|
153
|
+
for (int i = indexStart; i < indexEnd; i++)
|
|
154
|
+
{
|
|
155
|
+
ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize);
|
|
156
|
+
vec4 edge = texelFetch(u_vectorPolygonEdgeTexture, edgeUv, 0);
|
|
157
|
+
int primitiveIndex = int(texelFetch(u_vectorPolygonEdgePrimitiveIndicesTexture, edgeUv, 0).r);
|
|
158
|
+
|
|
159
|
+
// A new primitive means the previous group is complete: composite it,
|
|
160
|
+
// then start counting the new one fresh.
|
|
161
|
+
if (primitiveIndex != currentPrimitive)
|
|
162
|
+
{
|
|
163
|
+
baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize);
|
|
164
|
+
currentPrimitive = primitiveIndex;
|
|
165
|
+
inside = false;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (vectorEdgeCrossesRay(edge, vectorUv))
|
|
169
|
+
{
|
|
170
|
+
inside = !inside;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// The last primitive group has no trailing edge to trigger its composite.
|
|
175
|
+
baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize);
|
|
176
|
+
|
|
177
|
+
return baseColor;
|
|
178
|
+
}
|