@cesium/engine 26.2.0 → 26.3.1-wasm.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 +707 -600
- package/Build/Workers/chunk-2P3WKV6V.js +290 -0
- package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
- package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
- package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
- package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
- package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
- package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
- package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
- package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
- package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
- package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
- package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
- package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
- package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
- package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
- package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
- package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
- package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
- package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
- package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
- package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
- package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
- package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
- package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
- package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
- package/Build/Workers/chunk-NYKURYFR.js +2131 -0
- package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
- package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
- package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
- package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
- package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
- package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
- package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
- package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
- package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
- package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
- package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
- package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
- package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
- package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
- package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
- package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
- package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
- package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
- package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
- package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
- package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
- package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
- package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
- package/Build/Workers/chunk-YUICDZKO.js +2660 -0
- package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
- package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
- package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
- package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
- package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
- package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +20 -19
- package/Build/Workers/createCircleGeometry.js +28 -27
- package/Build/Workers/createCircleOutlineGeometry.js +21 -20
- package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
- package/Build/Workers/createCorridorGeometry.js +31 -31
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
- 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 +27 -26
- package/Build/Workers/createGroundPolylineGeometry.js +27 -26
- package/Build/Workers/createPlaneGeometry.js +18 -17
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +35 -35
- package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
- package/Build/Workers/createPolylineGeometry.js +28 -29
- package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
- package/Build/Workers/createRectangleGeometry.js +30 -30
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
- package/Build/Workers/createSimplePolylineGeometry.js +26 -27
- 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 +17 -16
- 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 +17 -16
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
- package/Build/Workers/createVerticesFromHeightmap.js +24 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +27 -28
- package/Build/Workers/createWallOutlineGeometry.js +26 -27
- package/Build/Workers/decodeDraco.js +16 -12
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
- package/Build/Workers/decodeI3S.js +17 -12
- package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
- package/Build/Workers/decodeSpz.js +1960 -0
- package/Build/Workers/gaussianSplatSorter.js +13 -6
- package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
- package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
- package/Build/Workers/transcodeKTX2.js +26 -12
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
- 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/KTX2Transcoder.js +99 -5
- package/Source/Core/Resource.js +2 -0
- package/Source/Core/SnapService.js +63 -0
- package/Source/Core/TaskProcessor.js +249 -129
- package/Source/Core/TrustedServers.js +34 -1
- package/Source/Core/VectorPipeline.js +139 -45
- package/Source/Core/VectorProvider.js +311 -71
- package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
- package/Source/Core/fetchWebAssemblyBinary.js +52 -0
- package/Source/Renderer/AutomaticUniforms.js +44 -2
- package/Source/Renderer/ShaderBuilder.js +1 -1
- package/Source/Renderer/UniformState.js +47 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- 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 +199 -29
- package/Source/Scene/Cesium3DTile.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +61 -8
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
- package/Source/Scene/Cesium3DTilesetCache.js +15 -0
- package/Source/Scene/ClippingPolygon.js +154 -100
- package/Source/Scene/ClippingPolygonCollection.js +352 -694
- package/Source/Scene/CreditDisplay.js +62 -0
- package/Source/Scene/GaussianSplatPrimitive.js +153 -66
- package/Source/Scene/GeoJsonPrimitive.js +114 -24
- package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
- package/Source/Scene/GlobeSurfaceTile.js +14 -1
- package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
- package/Source/Scene/GltfBufferViewLoader.js +25 -13
- package/Source/Scene/GltfLoader.js +56 -6
- package/Source/Scene/GltfSpzLoader.js +5 -4
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/MVTDataProvider.js +9 -0
- package/Source/Scene/Model/Model.js +242 -16
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
- package/Source/Scene/Model/ModelRenderResources.js +2 -3
- package/Source/Scene/Model/ModelSceneGraph.js +10 -1
- package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
- package/Source/Scene/Model/PickingPipelineStage.js +4 -0
- package/Source/Scene/PostProcessStage.js +22 -3
- package/Source/Scene/Scene.js +56 -1
- package/Source/Scene/Snapping.js +57 -0
- package/Source/Scene/SpzDecoder.js +106 -0
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
- package/Source/Scene/VectorGltf3DTileContent.js +10 -2
- package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
- package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
- package/Source/Scene/renderBufferPolylineCollection.js +5 -1
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
- package/Source/Shaders/GlobeFS.glsl +10 -9
- package/Source/Shaders/GlobeFS.js +11 -9
- package/Source/Shaders/GlobeVS.glsl +0 -32
- package/Source/Shaders/GlobeVS.js +0 -32
- 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 +4 -0
- package/Source/Shaders/Model/ModelFS.js +4 -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 +177 -50
- package/Source/Shaders/VectorCommon.js +251 -19
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createTaskProcessorWorker.js +2 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
- package/Source/Workers/decodeDraco.js +7 -3
- package/Source/Workers/decodeI3S.js +7 -3
- package/Source/Workers/decodeMeshopt.js +21 -0
- package/Source/Workers/decodeSpz.js +20 -0
- package/Source/Workers/gaussianSplatSorter.js +7 -3
- package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
- package/Source/Workers/transcodeKTX2.js +22 -5
- package/index.d.ts +649 -55
- package/index.js +23 -13
- package/package.json +6 -6
- package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
- package/Build/Workers/chunk-2H5264K7.js +0 -1284
- package/Build/Workers/chunk-2H73KDBM.js +0 -511
- package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
- package/Build/Workers/chunk-36NI5E6W.js +0 -3820
- package/Build/Workers/chunk-37SW7SYS.js +0 -778
- package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
- package/Build/Workers/chunk-3LB4UVPU.js +0 -387
- package/Build/Workers/chunk-3PONLKEL.js +0 -778
- package/Build/Workers/chunk-3QR662HH.js +0 -3820
- package/Build/Workers/chunk-3SX2WYSO.js +0 -973
- package/Build/Workers/chunk-3UDN6LYX.js +0 -476
- package/Build/Workers/chunk-47MCBSXI.js +0 -9237
- package/Build/Workers/chunk-4E626OCE.js +0 -1067
- package/Build/Workers/chunk-4NW2MJKH.js +0 -455
- package/Build/Workers/chunk-52YK5BSN.js +0 -198
- package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
- package/Build/Workers/chunk-5YPQBFRD.js +0 -519
- package/Build/Workers/chunk-6FHT43QR.js +0 -140
- package/Build/Workers/chunk-6HK6IXK2.js +0 -138
- package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
- package/Build/Workers/chunk-7A2OGDHT.js +0 -305
- package/Build/Workers/chunk-7CGEQUM2.js +0 -305
- package/Build/Workers/chunk-7D2HZKH7.js +0 -455
- package/Build/Workers/chunk-7I325HV6.js +0 -1344
- package/Build/Workers/chunk-7KVKHY7O.js +0 -147
- package/Build/Workers/chunk-7TKLTCZW.js +0 -219
- package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
- package/Build/Workers/chunk-7W6DUHAB.js +0 -693
- package/Build/Workers/chunk-7XM5JK5F.js +0 -162
- package/Build/Workers/chunk-7YG3ND3P.js +0 -454
- package/Build/Workers/chunk-A3O6EDBK.js +0 -73
- package/Build/Workers/chunk-A6X24AZI.js +0 -1992
- package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
- package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
- package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
- package/Build/Workers/chunk-AHWAZRBV.js +0 -82
- package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
- package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
- package/Build/Workers/chunk-BKPQFCXH.js +0 -511
- package/Build/Workers/chunk-BSPCI2LO.js +0 -959
- package/Build/Workers/chunk-BUJWSX5S.js +0 -301
- package/Build/Workers/chunk-C7JQVRLM.js +0 -497
- package/Build/Workers/chunk-C7QDUNI3.js +0 -138
- package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
- package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
- package/Build/Workers/chunk-CLCTQVVL.js +0 -241
- package/Build/Workers/chunk-CQNFIAZU.js +0 -56
- package/Build/Workers/chunk-DBD5WWG2.js +0 -959
- package/Build/Workers/chunk-DZBQUULR.js +0 -138
- package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
- package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
- package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
- package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
- package/Build/Workers/chunk-ELE6SC2C.js +0 -837
- package/Build/Workers/chunk-ENNFMWDW.js +0 -789
- package/Build/Workers/chunk-EOWDZN5S.js +0 -288
- package/Build/Workers/chunk-ERKUET22.js +0 -3201
- package/Build/Workers/chunk-F2IMBMZY.js +0 -241
- package/Build/Workers/chunk-F4CSNRZO.js +0 -219
- package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
- package/Build/Workers/chunk-FDK4K5IA.js +0 -280
- package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
- package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
- package/Build/Workers/chunk-FQ42MT7M.js +0 -58
- package/Build/Workers/chunk-GGNWQWSB.js +0 -301
- package/Build/Workers/chunk-GNKXEN4C.js +0 -682
- package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
- package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
- package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
- package/Build/Workers/chunk-H2WCFXLP.js +0 -241
- package/Build/Workers/chunk-HHV3MCGV.js +0 -162
- package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
- package/Build/Workers/chunk-HS6AD4P2.js +0 -398
- package/Build/Workers/chunk-HT6FASOT.js +0 -973
- package/Build/Workers/chunk-IDVHUDZT.js +0 -352
- package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
- package/Build/Workers/chunk-ILME5BXA.js +0 -301
- package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
- package/Build/Workers/chunk-IUIFLOYO.js +0 -44
- package/Build/Workers/chunk-J73T2VOY.js +0 -171
- package/Build/Workers/chunk-JALGQYDY.js +0 -288
- package/Build/Workers/chunk-JW6OZT4R.js +0 -288
- package/Build/Workers/chunk-JXYLJCTC.js +0 -124
- package/Build/Workers/chunk-K27QOAW6.js +0 -97
- package/Build/Workers/chunk-KMV25A63.js +0 -789
- package/Build/Workers/chunk-KZWFWJML.js +0 -2719
- package/Build/Workers/chunk-LCXRRALY.js +0 -387
- package/Build/Workers/chunk-LD64RPYV.js +0 -368
- package/Build/Workers/chunk-LGNDTZVX.js +0 -97
- package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
- package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
- package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
- package/Build/Workers/chunk-MEENMEAH.js +0 -198
- package/Build/Workers/chunk-NAWU5RF4.js +0 -162
- package/Build/Workers/chunk-NIWITKQK.js +0 -693
- package/Build/Workers/chunk-OA6MYL2C.js +0 -837
- package/Build/Workers/chunk-OBEU25PI.js +0 -1067
- package/Build/Workers/chunk-OHP4ELS7.js +0 -198
- package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
- package/Build/Workers/chunk-PD4GK4EM.js +0 -57
- package/Build/Workers/chunk-PEDU33QG.js +0 -2342
- package/Build/Workers/chunk-PVTSNNVI.js +0 -288
- package/Build/Workers/chunk-QHPZH22L.js +0 -241
- package/Build/Workers/chunk-QIZDWZK6.js +0 -301
- package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
- package/Build/Workers/chunk-QVLAFFJY.js +0 -56
- package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
- package/Build/Workers/chunk-R4K7EHOU.js +0 -171
- package/Build/Workers/chunk-R7JGHDD6.js +0 -789
- package/Build/Workers/chunk-RASQEYD4.js +0 -1483
- package/Build/Workers/chunk-RG4F5R57.js +0 -454
- package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
- package/Build/Workers/chunk-RYSQVJR6.js +0 -398
- package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
- package/Build/Workers/chunk-SDFHDNS4.js +0 -147
- package/Build/Workers/chunk-SF6K72D7.js +0 -124
- package/Build/Workers/chunk-SGRGNDOD.js +0 -682
- package/Build/Workers/chunk-SM2CDCYF.js +0 -198
- package/Build/Workers/chunk-SS5ABQGY.js +0 -102
- package/Build/Workers/chunk-T5QBPLE3.js +0 -414
- package/Build/Workers/chunk-TN35HP5B.js +0 -1067
- package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
- package/Build/Workers/chunk-TOAF47AQ.js +0 -102
- package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
- package/Build/Workers/chunk-TSDSILQB.js +0 -124
- package/Build/Workers/chunk-TVZD72WJ.js +0 -778
- package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
- package/Build/Workers/chunk-UEY73NRN.js +0 -38
- package/Build/Workers/chunk-UF46SZEZ.js +0 -789
- package/Build/Workers/chunk-UNRTMCET.js +0 -398
- package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
- package/Build/Workers/chunk-UVO6COT2.js +0 -352
- package/Build/Workers/chunk-V46YGZE6.js +0 -352
- package/Build/Workers/chunk-VAL7DYNR.js +0 -278
- package/Build/Workers/chunk-VDGOCROW.js +0 -57
- package/Build/Workers/chunk-VFWSSBPT.js +0 -511
- package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
- package/Build/Workers/chunk-VXWHPYQM.js +0 -837
- package/Build/Workers/chunk-VXYUBRSB.js +0 -219
- package/Build/Workers/chunk-VZLDLEWI.js +0 -387
- package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
- package/Build/Workers/chunk-WBSY7HDY.js +0 -837
- package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
- package/Build/Workers/chunk-WPRUWXGV.js +0 -693
- package/Build/Workers/chunk-WTO2ERBP.js +0 -414
- package/Build/Workers/chunk-WVHMDVG4.js +0 -959
- package/Build/Workers/chunk-XGA23TAX.js +0 -73
- package/Build/Workers/chunk-XLQZNQ4Z.js +0 -163
- package/Build/Workers/chunk-XLXSDIP5.js +0 -973
- package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
- package/Build/Workers/chunk-XQH66YJC.js +0 -147
- package/Build/Workers/chunk-XTA7BXJG.js +0 -682
- package/Build/Workers/chunk-XTIDAFRS.js +0 -476
- package/Build/Workers/chunk-XUEDWBUD.js +0 -682
- package/Build/Workers/chunk-XYFLRH3H.js +0 -124
- package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
- package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
- package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
- package/Build/Workers/chunk-YEYOSTJX.js +0 -219
- package/Build/Workers/chunk-YGFVAGYF.js +0 -630
- package/Build/Workers/chunk-YIIACKQO.js +0 -368
- package/Build/Workers/chunk-YJGSP6PE.js +0 -511
- package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
- package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
- package/Build/Workers/chunk-Z66EVE2A.js +0 -44
- package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
- package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
- package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
- package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
- package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
- package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
- package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
- 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,29 +1,25 @@
|
|
|
1
1
|
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
-
export default "
|
|
2
|
+
export default "/**\n\
|
|
3
|
+
* This vertex shader derives each vertex's UV coordinate within the model's clipping rectangle (its ellipsoid footprint).\n\
|
|
4
|
+
* This UV is a normalized vec2, where [0,1] spans the rectangle. The fragment shader then compares each fragment's uv against the clipping polygons,\n\
|
|
5
|
+
* whose positions live in the same uv space. See {@link ModelClippingPolygonsStageFS.glsl}.\n\
|
|
6
|
+
*\n\
|
|
7
|
+
* To get this uv, we need each vertex's geodetic (lon, lat), normalized against the model's rectangle.\n\
|
|
8
|
+
* What makes this complicated is precision: we *cannot* use v_positionWC, because it only has 32-bit precision and is too large to be represented precisely.\n\
|
|
9
|
+
* (Moreover, even representing v_positionWC with hi/lo components to emulate double precision, we could not perform the trig and other ops needed to derive lat/lon.)\n\
|
|
10
|
+
* Instead, we use v_positionEC, and let {@link czm_eyeToCartographicDelta} compute a geodetic delta (long, lat) between the camera and vertex. This delta is a smaller quantity (and gets smaller and more precise as we zoom in).\n\
|
|
11
|
+
* Then, we can combine this delta with the camera's own UV coordinate within the model's rectangle to obtain the vertex's uv coordinate.\n\
|
|
12
|
+
*\n\
|
|
13
|
+
* Ultimately, all this shader does is some geometry to obtain the vertex's relative position within the bounds of the model's geodetic rectangle.\n\
|
|
14
|
+
* The complexity arises from doing so in a way that preserves precision.\n\
|
|
15
|
+
*/\n\
|
|
16
|
+
void modelClippingPolygonsStage()\n\
|
|
3
17
|
{\n\
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
// (We don't need the height component)\n\
|
|
19
|
+
vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy;\n\
|
|
6
20
|
\n\
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
\n\
|
|
11
|
-
for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {\n\
|
|
12
|
-
vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);\n\
|
|
13
|
-
vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;\n\
|
|
14
|
-
\n\
|
|
15
|
-
vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));\n\
|
|
16
|
-
vec2 distance = abs(rectUv - clamped) * extents.wz;\n\
|
|
17
|
-
\n\
|
|
18
|
-
if (minDistance.x > distance.x || minDistance.y > distance.y) {\n\
|
|
19
|
-
minDistance = distance;\n\
|
|
20
|
-
v_clippingPosition = rectUv;\n\
|
|
21
|
-
}\n\
|
|
22
|
-
\n\
|
|
23
|
-
float threshold = 0.01;\n\
|
|
24
|
-
if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {\n\
|
|
25
|
-
v_regionIndex = regionIndex;\n\
|
|
26
|
-
}\n\
|
|
27
|
-
}\n\
|
|
21
|
+
// Express the vertex's position within the model's rectangle as a normalized uv coordinate, by adding the camera's uv and scaling by the rectangle's size.\n\
|
|
22
|
+
// Since the camera's UV is computed on the CPU in double precision, and gets more precise as one zooms in, this ensures good precision on the vertex's uv.\n\
|
|
23
|
+
v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize;\n\
|
|
28
24
|
}\n\
|
|
29
25
|
";
|
|
@@ -177,6 +177,10 @@ void main()
|
|
|
177
177
|
modelClippingPolygonsStage();
|
|
178
178
|
#endif
|
|
179
179
|
|
|
180
|
+
#ifdef HAS_VECTOR_LOOKUP
|
|
181
|
+
modelVectorLookupStage(color);
|
|
182
|
+
#endif
|
|
183
|
+
|
|
180
184
|
//========================================================================
|
|
181
185
|
// When not picking metadata START
|
|
182
186
|
#ifndef METADATA_PICKING_ENABLED
|
|
@@ -177,6 +177,10 @@ void main()\n\
|
|
|
177
177
|
#ifdef ENABLE_CLIPPING_POLYGONS\n\
|
|
178
178
|
modelClippingPolygonsStage();\n\
|
|
179
179
|
#endif\n\
|
|
180
|
+
\n\
|
|
181
|
+
#ifdef HAS_VECTOR_LOOKUP\n\
|
|
182
|
+
modelVectorLookupStage(color);\n\
|
|
183
|
+
#endif\n\
|
|
180
184
|
\n\
|
|
181
185
|
//========================================================================\n\
|
|
182
186
|
// When not picking metadata START\n\
|
|
@@ -110,6 +110,11 @@ void main()
|
|
|
110
110
|
// This returns the value that will be assigned to gl_Position.
|
|
111
111
|
vec4 positionClip = geometryStage(attributes, modelView, normal);
|
|
112
112
|
|
|
113
|
+
// Must go after the geometry stage, which computes v_positionEC.
|
|
114
|
+
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
115
|
+
modelClippingPolygonsStage();
|
|
116
|
+
#endif
|
|
117
|
+
|
|
113
118
|
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)
|
|
114
119
|
lineStyleStageVS(attributes);
|
|
115
120
|
#endif
|
|
@@ -119,8 +124,8 @@ void main()
|
|
|
119
124
|
atmosphereStage(attributes);
|
|
120
125
|
#endif
|
|
121
126
|
|
|
122
|
-
#ifdef
|
|
123
|
-
|
|
127
|
+
#ifdef HAS_VECTOR_LOOKUP
|
|
128
|
+
modelVectorLookupStage(attributes);
|
|
124
129
|
#endif
|
|
125
130
|
|
|
126
131
|
#ifdef HAS_SILHOUETTE
|
|
@@ -110,6 +110,11 @@ void main()\n\
|
|
|
110
110
|
// Compute the final position in each coordinate system needed.\n\
|
|
111
111
|
// This returns the value that will be assigned to gl_Position.\n\
|
|
112
112
|
vec4 positionClip = geometryStage(attributes, modelView, normal);\n\
|
|
113
|
+
\n\
|
|
114
|
+
// Must go after the geometry stage, which computes v_positionEC.\n\
|
|
115
|
+
#ifdef ENABLE_CLIPPING_POLYGONS\n\
|
|
116
|
+
modelClippingPolygonsStage();\n\
|
|
117
|
+
#endif\n\
|
|
113
118
|
\n\
|
|
114
119
|
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)\n\
|
|
115
120
|
lineStyleStageVS(attributes);\n\
|
|
@@ -120,8 +125,8 @@ void main()\n\
|
|
|
120
125
|
atmosphereStage(attributes);\n\
|
|
121
126
|
#endif\n\
|
|
122
127
|
\n\
|
|
123
|
-
#ifdef
|
|
124
|
-
|
|
128
|
+
#ifdef HAS_VECTOR_LOOKUP\n\
|
|
129
|
+
modelVectorLookupStage(attributes);\n\
|
|
125
130
|
#endif\n\
|
|
126
131
|
\n\
|
|
127
132
|
#ifdef HAS_SILHOUETTE\n\
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "void modelVectorLookupStage(inout vec4 color)\n\
|
|
3
|
+
{\n\
|
|
4
|
+
// Fills composite before strokes. Both no-op against 1x1 placeholder textures.\n\
|
|
5
|
+
color = vectorPolygonRender(v_vectorUv, color);\n\
|
|
6
|
+
color = vectorPolylineRender(v_vectorUv, color);\n\
|
|
7
|
+
}\n\
|
|
8
|
+
";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derives each vertex's UV within the rectangle the lookup textures were baked for, where [0,1] spans the rectangle.
|
|
3
|
+
* {@link ModelVectorLookupStageFS.glsl} samples those textures with it.
|
|
4
|
+
*
|
|
5
|
+
* v_positionWC is unusable here: it is 32-bit and too large to resolve a geodetic position precisely, and splitting it
|
|
6
|
+
* into hi/lo components would still not support the trigonometry needed to derive longitude and latitude. Instead,
|
|
7
|
+
* {@link czm_eyeToCartographicDelta} returns a geodetic delta from the camera to the vertex, a small quantity that
|
|
8
|
+
* grows more precise as the camera approaches. Adding it to the camera's own UV, computed on the CPU in double
|
|
9
|
+
* precision, keeps the result precise across the rectangle.
|
|
10
|
+
*/
|
|
11
|
+
void modelVectorLookupStage(ProcessedAttributes attributes)
|
|
12
|
+
{
|
|
13
|
+
vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy;
|
|
14
|
+
v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "/**\n\
|
|
3
|
+
* Derives each vertex's UV within the rectangle the lookup textures were baked for, where [0,1] spans the rectangle.\n\
|
|
4
|
+
* {@link ModelVectorLookupStageFS.glsl} samples those textures with it.\n\
|
|
5
|
+
*\n\
|
|
6
|
+
* v_positionWC is unusable here: it is 32-bit and too large to resolve a geodetic position precisely, and splitting it\n\
|
|
7
|
+
* into hi/lo components would still not support the trigonometry needed to derive longitude and latitude. Instead,\n\
|
|
8
|
+
* {@link czm_eyeToCartographicDelta} returns a geodetic delta from the camera to the vertex, a small quantity that\n\
|
|
9
|
+
* grows more precise as the camera approaches. Adding it to the camera's own UV, computed on the CPU in double\n\
|
|
10
|
+
* precision, keeps the result precise across the rectangle.\n\
|
|
11
|
+
*/\n\
|
|
12
|
+
void modelVectorLookupStage(ProcessedAttributes attributes)\n\
|
|
13
|
+
{\n\
|
|
14
|
+
vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy;\n\
|
|
15
|
+
v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize;\n\
|
|
16
|
+
}\n\
|
|
17
|
+
";
|
|
@@ -12,28 +12,27 @@ void verticalExaggerationStage(
|
|
|
12
12
|
// Uses a circular approximation for the Earth curvature along the geodesic.
|
|
13
13
|
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
|
|
14
14
|
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
|
|
15
|
-
vec3
|
|
15
|
+
vec3 vertexEllipsoidNormalEC = normalize(centerToVertex);
|
|
16
16
|
|
|
17
|
-
// Estimate the (sine of the) angle between the camera direction and the
|
|
17
|
+
// Estimate the (sine of the) angle between the camera direction and the ellipsoid normal.
|
|
18
18
|
float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
|
|
19
19
|
float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
|
|
20
20
|
float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
|
|
21
21
|
bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
|
|
22
22
|
|
|
23
23
|
// Approximate the change in height above the ellipsoid, from camera to vertex position.
|
|
24
|
-
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC,
|
|
24
|
+
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexEllipsoidNormalEC);
|
|
25
25
|
float smallAngleVersine = 0.5 * sinTheta * sinTheta;
|
|
26
26
|
float versine = isSmallAngle ? smallAngleVersine : exactVersine;
|
|
27
|
-
float dHeight = dot(vertexPositionEC,
|
|
27
|
+
float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine;
|
|
28
28
|
float vertexHeight = czm_eyeHeight + dHeight;
|
|
29
29
|
|
|
30
|
-
// Transform the approximate
|
|
31
|
-
vec3
|
|
32
|
-
vertexNormalMC = normalize(vertexNormalMC);
|
|
30
|
+
// Transform the approximate ellipsoid normal to model coordinates.
|
|
31
|
+
vec3 exaggerationDirectionScaledMC = (czm_inverseModelView * vec4(vertexEllipsoidNormalEC, 0.0)).xyz;
|
|
33
32
|
|
|
34
|
-
// Compute the exaggeration and apply it along the
|
|
33
|
+
// Compute the exaggeration and apply it along the exaggeration direction in model coordinates.
|
|
35
34
|
float stretch = u_verticalExaggerationAndRelativeHeight.x;
|
|
36
35
|
float shift = u_verticalExaggerationAndRelativeHeight.y;
|
|
37
36
|
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
|
|
38
|
-
attributes.positionMC += exaggeration *
|
|
39
|
-
}
|
|
37
|
+
attributes.positionMC += exaggeration * exaggerationDirectionScaledMC;
|
|
38
|
+
}
|
|
@@ -13,29 +13,27 @@ export default "void verticalExaggerationStage(\n\
|
|
|
13
13
|
// Uses a circular approximation for the Earth curvature along the geodesic.\n\
|
|
14
14
|
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;\n\
|
|
15
15
|
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;\n\
|
|
16
|
-
vec3
|
|
16
|
+
vec3 vertexEllipsoidNormalEC = normalize(centerToVertex);\n\
|
|
17
17
|
\n\
|
|
18
|
-
// Estimate the (sine of the) angle between the camera direction and the
|
|
18
|
+
// Estimate the (sine of the) angle between the camera direction and the ellipsoid normal.\n\
|
|
19
19
|
float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);\n\
|
|
20
20
|
float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);\n\
|
|
21
21
|
float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);\n\
|
|
22
22
|
bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;\n\
|
|
23
23
|
\n\
|
|
24
24
|
// Approximate the change in height above the ellipsoid, from camera to vertex position.\n\
|
|
25
|
-
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC,
|
|
25
|
+
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexEllipsoidNormalEC);\n\
|
|
26
26
|
float smallAngleVersine = 0.5 * sinTheta * sinTheta;\n\
|
|
27
27
|
float versine = isSmallAngle ? smallAngleVersine : exactVersine;\n\
|
|
28
|
-
float dHeight = dot(vertexPositionEC,
|
|
28
|
+
float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine;\n\
|
|
29
29
|
float vertexHeight = czm_eyeHeight + dHeight;\n\
|
|
30
30
|
\n\
|
|
31
|
-
// Transform the approximate
|
|
32
|
-
vec3
|
|
33
|
-
vertexNormalMC = normalize(vertexNormalMC);\n\
|
|
31
|
+
// Transform the approximate ellipsoid normal to model coordinates.\n\
|
|
32
|
+
vec3 exaggerationDirectionScaledMC = (czm_inverseModelView * vec4(vertexEllipsoidNormalEC, 0.0)).xyz;\n\
|
|
34
33
|
\n\
|
|
35
|
-
// Compute the exaggeration and apply it along the
|
|
34
|
+
// Compute the exaggeration and apply it along the exaggeration direction in model coordinates.\n\
|
|
36
35
|
float stretch = u_verticalExaggerationAndRelativeHeight.x;\n\
|
|
37
36
|
float shift = u_verticalExaggerationAndRelativeHeight.y;\n\
|
|
38
37
|
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);\n\
|
|
39
|
-
attributes.positionMC += exaggeration *
|
|
40
|
-
}
|
|
41
|
-
";
|
|
38
|
+
attributes.positionMC += exaggeration * exaggerationDirectionScaledMC;\n\
|
|
39
|
+
}";
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
uniform highp sampler2D u_vectorColorTexture;
|
|
2
|
+
uniform highp sampler2D u_vectorPickColorTexture;
|
|
3
|
+
|
|
4
|
+
// Primitive index of the topmost vector draped over this fragment, or -1 for none.
|
|
5
|
+
int vectorPickPrimitiveIndex = -1;
|
|
6
|
+
|
|
7
|
+
#ifdef HAS_VECTOR_POLYLINES
|
|
1
8
|
uniform highp sampler2D u_vectorSegmentTexture;
|
|
2
9
|
uniform highp sampler2D u_vectorWidthTexture;
|
|
3
|
-
uniform highp sampler2D u_vectorColorTexture;
|
|
4
10
|
uniform highp sampler2D u_vectorSegmentPrimitiveIndicesTexture;
|
|
5
11
|
uniform highp sampler2D u_vectorGridCellIndicesTexture;
|
|
12
|
+
#ifdef VECTOR_WIDTH_IN_METERS
|
|
13
|
+
// Ground size, in meters, of the tile's UV domain.
|
|
14
|
+
uniform vec2 u_vectorMetersPerUv;
|
|
15
|
+
#endif
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#ifdef HAS_VECTOR_POLYGONS
|
|
6
19
|
uniform highp sampler2D u_vectorPolygonEdgeTexture;
|
|
7
20
|
uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture;
|
|
8
21
|
uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture;
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
uniform highp sampler2D u_clippingEdgeTexture;
|
|
25
|
+
uniform highp sampler2D u_clippingEdgePrimitiveIndicesTexture;
|
|
26
|
+
uniform highp sampler2D u_clippingGridCellIndicesTexture;
|
|
9
27
|
|
|
10
28
|
// UV-space offset from the closest point on the segment to p.
|
|
11
29
|
vec2 vectorOffsetToLine(vec2 p, vec4 line)
|
|
@@ -29,12 +47,59 @@ ivec2 vectorIndexToUv(int index, ivec2 size)
|
|
|
29
47
|
return ivec2(u, v);
|
|
30
48
|
}
|
|
31
49
|
|
|
32
|
-
//
|
|
50
|
+
// Returns [start, end) index range for the grid cell containing uv. An empty
|
|
51
|
+
// range (start == end == 0) means a placeholder grid, so callers loop zero times.
|
|
52
|
+
ivec2 vectorCellRange(vec2 uv, highp sampler2D gridCellIndicesTexture)
|
|
53
|
+
{
|
|
54
|
+
ivec2 headerSize = textureSize(gridCellIndicesTexture, 0);
|
|
55
|
+
if (headerSize.x * headerSize.y < 3)
|
|
56
|
+
{
|
|
57
|
+
return ivec2(0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
int gridWidth = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r);
|
|
61
|
+
int gridHeight = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r);
|
|
62
|
+
int cellX = clamp(int(uv.x * float(gridWidth)), 0, gridWidth - 1);
|
|
63
|
+
int cellY = clamp(int(uv.y * float(gridHeight)), 0, gridHeight - 1);
|
|
64
|
+
int cellIndex = cellX + cellY * gridWidth;
|
|
65
|
+
|
|
66
|
+
int indexEnd = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r);
|
|
67
|
+
int indexStart = cellIndex == 0
|
|
68
|
+
? 0
|
|
69
|
+
: int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r);
|
|
70
|
+
|
|
71
|
+
return ivec2(indexStart, indexEnd);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#ifdef VECTOR_ANTIALIAS
|
|
75
|
+
// Half-pixel band across a line's edge over which coverage fades.
|
|
76
|
+
const float vectorCoverageRadius = 0.5;
|
|
77
|
+
#else
|
|
78
|
+
const float vectorCoverageRadius = 0.0;
|
|
79
|
+
#endif
|
|
80
|
+
|
|
81
|
+
// Drape vector polylines onto the terrain surface. The fragment's
|
|
33
82
|
// tile UV picks a grid cell, then only that cell's line segments (packed in
|
|
34
83
|
// tile-local UV space) are tested for proximity. Within the line width, the
|
|
35
84
|
// vector color is alpha-composited over the terrain (no discard).
|
|
36
85
|
vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor)
|
|
37
86
|
{
|
|
87
|
+
#ifdef HAS_VECTOR_POLYLINES
|
|
88
|
+
// Inverse UV-per-pixel Jacobian: measures line distance in screen pixels so
|
|
89
|
+
// width stays constant under anisotropic (oblique) foreshortening.
|
|
90
|
+
// Computed unconditionally so the derivatives stay in uniform control flow.
|
|
91
|
+
mat2 screenFromUv = inverse(mat2(dFdx(vectorUv), dFdy(vectorUv)));
|
|
92
|
+
|
|
93
|
+
#ifdef VECTOR_WIDTH_IN_METERS
|
|
94
|
+
mat2 metersFromUv = mat2(u_vectorMetersPerUv.x, 0.0, 0.0, u_vectorMetersPerUv.y);
|
|
95
|
+
// Edge distances are always compared in pixels, whatever unit a width was authored in,
|
|
96
|
+
// so ground meters are converted using the coarser of the two screen axes.
|
|
97
|
+
// Computed unconditionally so the derivatives stay in uniform control flow.
|
|
98
|
+
float pixelsPerMeter = 1.0 / max(
|
|
99
|
+
length(metersFromUv * dFdx(vectorUv)),
|
|
100
|
+
length(metersFromUv * dFdy(vectorUv)));
|
|
101
|
+
#endif
|
|
102
|
+
|
|
38
103
|
// A tile without polylines binds a 1x1 placeholder; a real grid header
|
|
39
104
|
// [gridWidth, gridHeight, ...] is at least 3 texels.
|
|
40
105
|
ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0);
|
|
@@ -43,27 +108,17 @@ vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor)
|
|
|
43
108
|
return baseColor;
|
|
44
109
|
}
|
|
45
110
|
|
|
46
|
-
|
|
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
|
-
|
|
111
|
+
ivec2 range = vectorCellRange(vectorUv, u_vectorGridCellIndicesTexture);
|
|
63
112
|
ivec2 segmentTextureSize = textureSize(u_vectorSegmentTexture, 0);
|
|
64
113
|
ivec2 primitiveTextureSize = textureSize(u_vectorWidthTexture, 0);
|
|
65
114
|
|
|
66
|
-
|
|
115
|
+
// Signed distance to the nearest edge, negative inside the line. Consecutive
|
|
116
|
+
// segments overlap at their shared vertex, so only the nearest is composited;
|
|
117
|
+
// compositing each in turn would darken the joints.
|
|
118
|
+
float nearestEdgeDistance = 1.0e30;
|
|
119
|
+
int nearestPrimitiveIndex = -1;
|
|
120
|
+
|
|
121
|
+
for (int i = range.x; i < range.y; i++)
|
|
67
122
|
{
|
|
68
123
|
ivec2 segmentUv = vectorIndexToUv(i, segmentTextureSize);
|
|
69
124
|
vec4 segment = texelFetch(u_vectorSegmentTexture, segmentUv, 0);
|
|
@@ -71,19 +126,56 @@ vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor)
|
|
|
71
126
|
int primitiveIndex = int(texelFetch(u_vectorSegmentPrimitiveIndicesTexture, segmentUv, 0).r);
|
|
72
127
|
ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize);
|
|
73
128
|
|
|
74
|
-
float
|
|
129
|
+
float width = texelFetch(u_vectorWidthTexture, primitiveUv, 0).r;
|
|
130
|
+
float halfWidth = abs(width) * 0.5;
|
|
131
|
+
vec2 offsetToLine = vectorOffsetToLine(vectorUv, segment);
|
|
132
|
+
|
|
133
|
+
#if defined(VECTOR_WIDTH_MIXED_UNITS)
|
|
134
|
+
// A negative width marks a width in meters; see VectorPipeline.
|
|
135
|
+
float edgeDistance = width < 0.0
|
|
136
|
+
? (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter
|
|
137
|
+
: length(screenFromUv * offsetToLine) - halfWidth;
|
|
138
|
+
#elif defined(VECTOR_WIDTH_IN_METERS)
|
|
139
|
+
float edgeDistance = (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter;
|
|
140
|
+
#else
|
|
141
|
+
float edgeDistance = length(screenFromUv * offsetToLine) - halfWidth;
|
|
142
|
+
#endif
|
|
143
|
+
|
|
144
|
+
if (edgeDistance < nearestEdgeDistance)
|
|
145
|
+
{
|
|
146
|
+
nearestEdgeDistance = edgeDistance;
|
|
147
|
+
nearestPrimitiveIndex = primitiveIndex;
|
|
148
|
+
}
|
|
75
149
|
|
|
76
|
-
|
|
77
|
-
|
|
150
|
+
// Coverage is saturated; no further segment can raise it. Only the nearest
|
|
151
|
+
// segment supplies the color, so overlapping translucent lines do not blend.
|
|
152
|
+
if (nearestEdgeDistance <= -vectorCoverageRadius)
|
|
78
153
|
{
|
|
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
154
|
break;
|
|
83
155
|
}
|
|
84
156
|
}
|
|
85
157
|
|
|
158
|
+
if (nearestEdgeDistance > vectorCoverageRadius)
|
|
159
|
+
{
|
|
160
|
+
return baseColor;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#ifdef VECTOR_ANTIALIAS
|
|
164
|
+
float coverage = 1.0 - smoothstep(-vectorCoverageRadius, vectorCoverageRadius, nearestEdgeDistance);
|
|
165
|
+
#else
|
|
166
|
+
float coverage = 1.0;
|
|
167
|
+
#endif
|
|
168
|
+
|
|
169
|
+
vectorPickPrimitiveIndex = nearestPrimitiveIndex;
|
|
170
|
+
|
|
171
|
+
// Alpha-composite vector over terrain.
|
|
172
|
+
ivec2 primitiveUv = vectorIndexToUv(nearestPrimitiveIndex, primitiveTextureSize);
|
|
173
|
+
vec4 vectorColor = texelFetch(u_vectorColorTexture, primitiveUv, 0);
|
|
174
|
+
vectorColor.a *= coverage;
|
|
175
|
+
return vectorColor * vec4(vectorColor.aaa, 1.0) + baseColor * (1.0 - vectorColor.a);
|
|
176
|
+
#else
|
|
86
177
|
return baseColor;
|
|
178
|
+
#endif
|
|
87
179
|
}
|
|
88
180
|
|
|
89
181
|
// Composites a polygon's fill over baseColor when the pixel is inside it. A
|
|
@@ -96,6 +188,8 @@ vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside,
|
|
|
96
188
|
return baseColor;
|
|
97
189
|
}
|
|
98
190
|
|
|
191
|
+
vectorPickPrimitiveIndex = primitiveIndex;
|
|
192
|
+
|
|
99
193
|
ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize);
|
|
100
194
|
vec4 fillColor = texelFetch(u_vectorColorTexture, primitiveUv, 0);
|
|
101
195
|
return fillColor * vec4(fillColor.aaa, 1.0) + baseColor * (1.0 - fillColor.a);
|
|
@@ -115,42 +209,22 @@ bool vectorEdgeCrossesRay(vec4 edge, vec2 p)
|
|
|
115
209
|
return p.x < xIntersect;
|
|
116
210
|
}
|
|
117
211
|
|
|
118
|
-
// Drape
|
|
212
|
+
// Drape vector polygon fills onto the terrain surface. The fragment's
|
|
119
213
|
// tile UV picks a grid cell whose edges were clipped to the cell on the CPU,
|
|
120
214
|
// forming closed loops, so an even-odd horizontal ray cast within the cell
|
|
121
215
|
// decides coverage. Edges arrive grouped by primitive; each covering
|
|
122
216
|
// primitive's fill color is alpha-composited in primitive order (no discard).
|
|
123
217
|
vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor)
|
|
124
218
|
{
|
|
125
|
-
|
|
126
|
-
|
|
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
|
-
|
|
219
|
+
#ifdef HAS_VECTOR_POLYGONS
|
|
220
|
+
ivec2 range = vectorCellRange(vectorUv, u_vectorPolygonGridCellIndicesTexture);
|
|
147
221
|
ivec2 edgeTextureSize = textureSize(u_vectorPolygonEdgeTexture, 0);
|
|
148
222
|
ivec2 primitiveTextureSize = textureSize(u_vectorColorTexture, 0);
|
|
149
223
|
|
|
150
224
|
int currentPrimitive = -1;
|
|
151
225
|
bool inside = false;
|
|
152
226
|
|
|
153
|
-
for (int i =
|
|
227
|
+
for (int i = range.x; i < range.y; i++)
|
|
154
228
|
{
|
|
155
229
|
ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize);
|
|
156
230
|
vec4 edge = texelFetch(u_vectorPolygonEdgeTexture, edgeUv, 0);
|
|
@@ -175,4 +249,57 @@ vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor)
|
|
|
175
249
|
baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize);
|
|
176
250
|
|
|
177
251
|
return baseColor;
|
|
252
|
+
#else
|
|
253
|
+
return baseColor;
|
|
254
|
+
#endif
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Pick color of the vector draped over this fragment, or the surface's own where none is.
|
|
258
|
+
vec4 vectorPickColorOver(vec4 surfacePickColor)
|
|
259
|
+
{
|
|
260
|
+
if (vectorPickPrimitiveIndex < 0)
|
|
261
|
+
{
|
|
262
|
+
return surfacePickColor;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0);
|
|
266
|
+
return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Returns true if uv is inside any polygon in its grid cell
|
|
270
|
+
// If performing inverse-clipping, it is up to the caller to negate the result.
|
|
271
|
+
bool vectorClip(vec2 uv)
|
|
272
|
+
{
|
|
273
|
+
// Clamp to [0, 1] to address small interpolation precision error that can occur at the boundaries of tiles
|
|
274
|
+
uv = clamp(uv, vec2(0.0), vec2(1.0));
|
|
275
|
+
ivec2 range = vectorCellRange(uv, u_clippingGridCellIndicesTexture);
|
|
276
|
+
ivec2 edgeTextureSize = textureSize(u_clippingEdgeTexture, 0);
|
|
277
|
+
|
|
278
|
+
int currentPrimitive = -1;
|
|
279
|
+
bool inside = false;
|
|
280
|
+
|
|
281
|
+
for (int i = range.x; i < range.y; i++)
|
|
282
|
+
{
|
|
283
|
+
ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize);
|
|
284
|
+
int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r);
|
|
285
|
+
|
|
286
|
+
// New primitive: the previous group is complete, check if it was inside and return early if so.
|
|
287
|
+
if (primitiveIndex != currentPrimitive)
|
|
288
|
+
{
|
|
289
|
+
if (inside)
|
|
290
|
+
{
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
currentPrimitive = primitiveIndex;
|
|
294
|
+
inside = false;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0);
|
|
298
|
+
if (vectorEdgeCrossesRay(edge, uv))
|
|
299
|
+
{
|
|
300
|
+
inside = !inside;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return inside; // last group
|
|
178
305
|
}
|