@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.
Files changed (393) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +707 -600
  2. package/Build/Workers/chunk-2P3WKV6V.js +290 -0
  3. package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
  4. package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
  5. package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
  6. package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
  7. package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
  8. package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
  9. package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
  10. package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
  11. package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
  12. package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
  13. package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
  14. package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
  15. package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
  16. package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
  17. package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
  18. package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
  19. package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
  20. package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
  21. package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
  22. package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
  23. package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
  24. package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
  25. package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
  26. package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
  27. package/Build/Workers/chunk-NYKURYFR.js +2131 -0
  28. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
  29. package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
  30. package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
  31. package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
  32. package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
  33. package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
  34. package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
  35. package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
  36. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
  37. package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
  38. package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
  39. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
  40. package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
  41. package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
  42. package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
  43. package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
  44. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
  45. package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
  46. package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
  47. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
  48. package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
  49. package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
  50. package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
  51. package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
  52. package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
  53. package/Build/Workers/chunk-YUICDZKO.js +2660 -0
  54. package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
  55. package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
  56. package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
  57. package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
  58. package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
  59. package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
  60. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
  61. package/Build/Workers/combineGeometry.js +24 -24
  62. package/Build/Workers/createBoxGeometry.js +18 -18
  63. package/Build/Workers/createBoxOutlineGeometry.js +20 -19
  64. package/Build/Workers/createCircleGeometry.js +28 -27
  65. package/Build/Workers/createCircleOutlineGeometry.js +21 -20
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
  68. package/Build/Workers/createCorridorGeometry.js +31 -31
  69. package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
  70. package/Build/Workers/createCylinderGeometry.js +20 -20
  71. package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
  72. package/Build/Workers/createEllipseGeometry.js +26 -26
  73. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  74. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  76. package/Build/Workers/createFrustumGeometry.js +18 -18
  77. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  78. package/Build/Workers/createGeometry.js +27 -26
  79. package/Build/Workers/createGroundPolylineGeometry.js +27 -26
  80. package/Build/Workers/createPlaneGeometry.js +18 -17
  81. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  82. package/Build/Workers/createPolygonGeometry.js +35 -35
  83. package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
  84. package/Build/Workers/createPolylineGeometry.js +28 -29
  85. package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
  87. package/Build/Workers/createRectangleGeometry.js +30 -30
  88. package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
  89. package/Build/Workers/createSimplePolylineGeometry.js +26 -27
  90. package/Build/Workers/createSphereGeometry.js +19 -19
  91. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  92. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  93. package/Build/Workers/createVectorTileClampedPolylines.js +17 -16
  94. package/Build/Workers/createVectorTileGeometries.js +24 -24
  95. package/Build/Workers/createVectorTilePoints.js +13 -13
  96. package/Build/Workers/createVectorTilePolygons.js +22 -22
  97. package/Build/Workers/createVectorTilePolylines.js +17 -16
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
  100. package/Build/Workers/createVerticesFromHeightmap.js +24 -25
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  102. package/Build/Workers/createWallGeometry.js +27 -28
  103. package/Build/Workers/createWallOutlineGeometry.js +26 -27
  104. package/Build/Workers/decodeDraco.js +16 -12
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
  106. package/Build/Workers/decodeI3S.js +17 -12
  107. package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
  108. package/Build/Workers/decodeSpz.js +1960 -0
  109. package/Build/Workers/gaussianSplatSorter.js +13 -6
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
  112. package/Build/Workers/transcodeKTX2.js +26 -12
  113. package/Build/Workers/transferTypedArrayTest.js +1 -1
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  116. package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
  117. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
  118. package/Source/Core/Ion.js +1 -1
  119. package/Source/Core/IonResource.js +5 -0
  120. package/Source/Core/IonSnapGeometryType.js +59 -0
  121. package/Source/Core/IonSnapHeat.js +33 -0
  122. package/Source/Core/IonSnapMode.js +45 -0
  123. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  124. package/Source/Core/IonSnapService.js +369 -0
  125. package/Source/Core/KTX2Transcoder.js +99 -5
  126. package/Source/Core/Resource.js +2 -0
  127. package/Source/Core/SnapService.js +63 -0
  128. package/Source/Core/TaskProcessor.js +249 -129
  129. package/Source/Core/TrustedServers.js +34 -1
  130. package/Source/Core/VectorPipeline.js +139 -45
  131. package/Source/Core/VectorProvider.js +311 -71
  132. package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
  133. package/Source/Core/fetchWebAssemblyBinary.js +52 -0
  134. package/Source/Renderer/AutomaticUniforms.js +44 -2
  135. package/Source/Renderer/ShaderBuilder.js +1 -1
  136. package/Source/Renderer/UniformState.js +47 -1
  137. package/Source/Scene/ArcGisMapService.js +1 -1
  138. package/Source/Scene/BufferPointCollection.js +4 -7
  139. package/Source/Scene/BufferPolygonCollection.js +56 -27
  140. package/Source/Scene/BufferPolylineCollection.js +61 -8
  141. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  142. package/Source/Scene/BufferPrimitiveCollection.js +199 -29
  143. package/Source/Scene/Cesium3DTile.js +12 -0
  144. package/Source/Scene/Cesium3DTileset.js +61 -8
  145. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  146. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  147. package/Source/Scene/ClippingPolygon.js +154 -100
  148. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  149. package/Source/Scene/CreditDisplay.js +62 -0
  150. package/Source/Scene/GaussianSplatPrimitive.js +153 -66
  151. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  152. package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
  153. package/Source/Scene/GlobeSurfaceTile.js +14 -1
  154. package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
  155. package/Source/Scene/GltfBufferViewLoader.js +25 -13
  156. package/Source/Scene/GltfLoader.js +56 -6
  157. package/Source/Scene/GltfSpzLoader.js +5 -4
  158. package/Source/Scene/HeightReference.js +1 -1
  159. package/Source/Scene/MVTDataProvider.js +9 -0
  160. package/Source/Scene/Model/Model.js +242 -16
  161. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  162. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  163. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  164. package/Source/Scene/Model/ModelSceneGraph.js +10 -1
  165. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  166. package/Source/Scene/Model/PickingPipelineStage.js +4 -0
  167. package/Source/Scene/PostProcessStage.js +22 -3
  168. package/Source/Scene/Scene.js +56 -1
  169. package/Source/Scene/Snapping.js +57 -0
  170. package/Source/Scene/SpzDecoder.js +106 -0
  171. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
  172. package/Source/Scene/VectorGltf3DTileContent.js +10 -2
  173. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  174. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  175. package/Source/Scene/renderBufferPolylineCollection.js +5 -1
  176. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  177. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  178. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
  179. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  180. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  181. package/Source/Shaders/GlobeFS.glsl +10 -9
  182. package/Source/Shaders/GlobeFS.js +11 -9
  183. package/Source/Shaders/GlobeVS.glsl +0 -32
  184. package/Source/Shaders/GlobeVS.js +0 -32
  185. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  186. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  187. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  188. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  189. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  190. package/Source/Shaders/Model/ModelFS.js +4 -0
  191. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  192. package/Source/Shaders/Model/ModelVS.js +7 -2
  193. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  194. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  195. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  196. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  197. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  198. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  199. package/Source/Shaders/VectorCommon.glsl +177 -50
  200. package/Source/Shaders/VectorCommon.js +251 -19
  201. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  202. package/Source/ThirdParty/zip-module.wasm +0 -0
  203. package/Source/Workers/createTaskProcessorWorker.js +2 -0
  204. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
  205. package/Source/Workers/decodeDraco.js +7 -3
  206. package/Source/Workers/decodeI3S.js +7 -3
  207. package/Source/Workers/decodeMeshopt.js +21 -0
  208. package/Source/Workers/decodeSpz.js +20 -0
  209. package/Source/Workers/gaussianSplatSorter.js +7 -3
  210. package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
  211. package/Source/Workers/transcodeKTX2.js +22 -5
  212. package/index.d.ts +649 -55
  213. package/index.js +23 -13
  214. package/package.json +6 -6
  215. package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
  216. package/Build/Workers/chunk-2H5264K7.js +0 -1284
  217. package/Build/Workers/chunk-2H73KDBM.js +0 -511
  218. package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
  219. package/Build/Workers/chunk-36NI5E6W.js +0 -3820
  220. package/Build/Workers/chunk-37SW7SYS.js +0 -778
  221. package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
  222. package/Build/Workers/chunk-3LB4UVPU.js +0 -387
  223. package/Build/Workers/chunk-3PONLKEL.js +0 -778
  224. package/Build/Workers/chunk-3QR662HH.js +0 -3820
  225. package/Build/Workers/chunk-3SX2WYSO.js +0 -973
  226. package/Build/Workers/chunk-3UDN6LYX.js +0 -476
  227. package/Build/Workers/chunk-47MCBSXI.js +0 -9237
  228. package/Build/Workers/chunk-4E626OCE.js +0 -1067
  229. package/Build/Workers/chunk-4NW2MJKH.js +0 -455
  230. package/Build/Workers/chunk-52YK5BSN.js +0 -198
  231. package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
  232. package/Build/Workers/chunk-5YPQBFRD.js +0 -519
  233. package/Build/Workers/chunk-6FHT43QR.js +0 -140
  234. package/Build/Workers/chunk-6HK6IXK2.js +0 -138
  235. package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
  236. package/Build/Workers/chunk-7A2OGDHT.js +0 -305
  237. package/Build/Workers/chunk-7CGEQUM2.js +0 -305
  238. package/Build/Workers/chunk-7D2HZKH7.js +0 -455
  239. package/Build/Workers/chunk-7I325HV6.js +0 -1344
  240. package/Build/Workers/chunk-7KVKHY7O.js +0 -147
  241. package/Build/Workers/chunk-7TKLTCZW.js +0 -219
  242. package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
  243. package/Build/Workers/chunk-7W6DUHAB.js +0 -693
  244. package/Build/Workers/chunk-7XM5JK5F.js +0 -162
  245. package/Build/Workers/chunk-7YG3ND3P.js +0 -454
  246. package/Build/Workers/chunk-A3O6EDBK.js +0 -73
  247. package/Build/Workers/chunk-A6X24AZI.js +0 -1992
  248. package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
  249. package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
  250. package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
  251. package/Build/Workers/chunk-AHWAZRBV.js +0 -82
  252. package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
  253. package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
  254. package/Build/Workers/chunk-BKPQFCXH.js +0 -511
  255. package/Build/Workers/chunk-BSPCI2LO.js +0 -959
  256. package/Build/Workers/chunk-BUJWSX5S.js +0 -301
  257. package/Build/Workers/chunk-C7JQVRLM.js +0 -497
  258. package/Build/Workers/chunk-C7QDUNI3.js +0 -138
  259. package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
  260. package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
  261. package/Build/Workers/chunk-CLCTQVVL.js +0 -241
  262. package/Build/Workers/chunk-CQNFIAZU.js +0 -56
  263. package/Build/Workers/chunk-DBD5WWG2.js +0 -959
  264. package/Build/Workers/chunk-DZBQUULR.js +0 -138
  265. package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
  266. package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
  267. package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
  268. package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
  269. package/Build/Workers/chunk-ELE6SC2C.js +0 -837
  270. package/Build/Workers/chunk-ENNFMWDW.js +0 -789
  271. package/Build/Workers/chunk-EOWDZN5S.js +0 -288
  272. package/Build/Workers/chunk-ERKUET22.js +0 -3201
  273. package/Build/Workers/chunk-F2IMBMZY.js +0 -241
  274. package/Build/Workers/chunk-F4CSNRZO.js +0 -219
  275. package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
  276. package/Build/Workers/chunk-FDK4K5IA.js +0 -280
  277. package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
  278. package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
  279. package/Build/Workers/chunk-FQ42MT7M.js +0 -58
  280. package/Build/Workers/chunk-GGNWQWSB.js +0 -301
  281. package/Build/Workers/chunk-GNKXEN4C.js +0 -682
  282. package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
  283. package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
  284. package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
  285. package/Build/Workers/chunk-H2WCFXLP.js +0 -241
  286. package/Build/Workers/chunk-HHV3MCGV.js +0 -162
  287. package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
  288. package/Build/Workers/chunk-HS6AD4P2.js +0 -398
  289. package/Build/Workers/chunk-HT6FASOT.js +0 -973
  290. package/Build/Workers/chunk-IDVHUDZT.js +0 -352
  291. package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
  292. package/Build/Workers/chunk-ILME5BXA.js +0 -301
  293. package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
  294. package/Build/Workers/chunk-IUIFLOYO.js +0 -44
  295. package/Build/Workers/chunk-J73T2VOY.js +0 -171
  296. package/Build/Workers/chunk-JALGQYDY.js +0 -288
  297. package/Build/Workers/chunk-JW6OZT4R.js +0 -288
  298. package/Build/Workers/chunk-JXYLJCTC.js +0 -124
  299. package/Build/Workers/chunk-K27QOAW6.js +0 -97
  300. package/Build/Workers/chunk-KMV25A63.js +0 -789
  301. package/Build/Workers/chunk-KZWFWJML.js +0 -2719
  302. package/Build/Workers/chunk-LCXRRALY.js +0 -387
  303. package/Build/Workers/chunk-LD64RPYV.js +0 -368
  304. package/Build/Workers/chunk-LGNDTZVX.js +0 -97
  305. package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
  306. package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
  307. package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
  308. package/Build/Workers/chunk-MEENMEAH.js +0 -198
  309. package/Build/Workers/chunk-NAWU5RF4.js +0 -162
  310. package/Build/Workers/chunk-NIWITKQK.js +0 -693
  311. package/Build/Workers/chunk-OA6MYL2C.js +0 -837
  312. package/Build/Workers/chunk-OBEU25PI.js +0 -1067
  313. package/Build/Workers/chunk-OHP4ELS7.js +0 -198
  314. package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
  315. package/Build/Workers/chunk-PD4GK4EM.js +0 -57
  316. package/Build/Workers/chunk-PEDU33QG.js +0 -2342
  317. package/Build/Workers/chunk-PVTSNNVI.js +0 -288
  318. package/Build/Workers/chunk-QHPZH22L.js +0 -241
  319. package/Build/Workers/chunk-QIZDWZK6.js +0 -301
  320. package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
  321. package/Build/Workers/chunk-QVLAFFJY.js +0 -56
  322. package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
  323. package/Build/Workers/chunk-R4K7EHOU.js +0 -171
  324. package/Build/Workers/chunk-R7JGHDD6.js +0 -789
  325. package/Build/Workers/chunk-RASQEYD4.js +0 -1483
  326. package/Build/Workers/chunk-RG4F5R57.js +0 -454
  327. package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
  328. package/Build/Workers/chunk-RYSQVJR6.js +0 -398
  329. package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
  330. package/Build/Workers/chunk-SDFHDNS4.js +0 -147
  331. package/Build/Workers/chunk-SF6K72D7.js +0 -124
  332. package/Build/Workers/chunk-SGRGNDOD.js +0 -682
  333. package/Build/Workers/chunk-SM2CDCYF.js +0 -198
  334. package/Build/Workers/chunk-SS5ABQGY.js +0 -102
  335. package/Build/Workers/chunk-T5QBPLE3.js +0 -414
  336. package/Build/Workers/chunk-TN35HP5B.js +0 -1067
  337. package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
  338. package/Build/Workers/chunk-TOAF47AQ.js +0 -102
  339. package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
  340. package/Build/Workers/chunk-TSDSILQB.js +0 -124
  341. package/Build/Workers/chunk-TVZD72WJ.js +0 -778
  342. package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
  343. package/Build/Workers/chunk-UEY73NRN.js +0 -38
  344. package/Build/Workers/chunk-UF46SZEZ.js +0 -789
  345. package/Build/Workers/chunk-UNRTMCET.js +0 -398
  346. package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
  347. package/Build/Workers/chunk-UVO6COT2.js +0 -352
  348. package/Build/Workers/chunk-V46YGZE6.js +0 -352
  349. package/Build/Workers/chunk-VAL7DYNR.js +0 -278
  350. package/Build/Workers/chunk-VDGOCROW.js +0 -57
  351. package/Build/Workers/chunk-VFWSSBPT.js +0 -511
  352. package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
  353. package/Build/Workers/chunk-VXWHPYQM.js +0 -837
  354. package/Build/Workers/chunk-VXYUBRSB.js +0 -219
  355. package/Build/Workers/chunk-VZLDLEWI.js +0 -387
  356. package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
  357. package/Build/Workers/chunk-WBSY7HDY.js +0 -837
  358. package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
  359. package/Build/Workers/chunk-WPRUWXGV.js +0 -693
  360. package/Build/Workers/chunk-WTO2ERBP.js +0 -414
  361. package/Build/Workers/chunk-WVHMDVG4.js +0 -959
  362. package/Build/Workers/chunk-XGA23TAX.js +0 -73
  363. package/Build/Workers/chunk-XLQZNQ4Z.js +0 -163
  364. package/Build/Workers/chunk-XLXSDIP5.js +0 -973
  365. package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
  366. package/Build/Workers/chunk-XQH66YJC.js +0 -147
  367. package/Build/Workers/chunk-XTA7BXJG.js +0 -682
  368. package/Build/Workers/chunk-XTIDAFRS.js +0 -476
  369. package/Build/Workers/chunk-XUEDWBUD.js +0 -682
  370. package/Build/Workers/chunk-XYFLRH3H.js +0 -124
  371. package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
  372. package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
  373. package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
  374. package/Build/Workers/chunk-YEYOSTJX.js +0 -219
  375. package/Build/Workers/chunk-YGFVAGYF.js +0 -630
  376. package/Build/Workers/chunk-YIIACKQO.js +0 -368
  377. package/Build/Workers/chunk-YJGSP6PE.js +0 -511
  378. package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
  379. package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
  380. package/Build/Workers/chunk-Z66EVE2A.js +0 -44
  381. package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
  382. package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
  383. package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
  384. package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
  385. package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
  386. package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
  387. package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
  388. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  389. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  390. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  391. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  392. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  393. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -48,7 +48,10 @@ const excludesReverseAxis = [
48
48
  * @property {object} [getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
49
49
  * @property {Resource|string} [getFeatureInfoUrl] The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url.
50
50
  * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats
51
- * in which to try WMS GetFeatureInfo requests.
51
+ * in which to try WMS GetFeatureInfo requests. Since feature info responses vary across WMS services,
52
+ * you may need to supply a custom format and parsing callback; see the
53
+ * {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Sandcastle example} for a complete
54
+ * example of writing your own callback.
52
55
  * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.
53
56
  * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.
54
57
  * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
@@ -90,6 +93,7 @@ const excludesReverseAxis = [
90
93
  *
91
94
  * @see {@link https://enterprise.arcgis.com/en/server/latest/publish-services/linux/wms-services.htm|ArcGIS Server WMS Services}
92
95
  * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
96
+ * @see {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Custom GetFeatureInfo Sandcastle Example}
93
97
  *
94
98
  * @example
95
99
  * // WMS servers operated by the US government https://apps.nationalmap.gov/services/
@@ -29,7 +29,10 @@ import GetFeatureInfoFormat from "./GetFeatureInfoFormat.js";
29
29
  * @property {object} [getFeatureInfoParameters] Additional parameters to include in GetFeatureInfo requests. Keys are lowercased internally.
30
30
  * @property {Resource|string} [getFeatureInfoUrl] The GetFeatureInfo URL of the WMTS service. If not specified, the value of <code>url</code> is used.
31
31
  * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapTileServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats
32
- * in which to try WMTS GetFeatureInfo requests.
32
+ * in which to try WMTS GetFeatureInfo requests. Since feature info responses vary across WMTS services,
33
+ * you may need to supply a custom format and parsing callback; see the
34
+ * {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Sandcastle example} for a complete
35
+ * example of writing your own callback.
33
36
  * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer.
34
37
  * @property {TilingScheme} [tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
35
38
  * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
@@ -176,6 +179,8 @@ import GetFeatureInfoFormat from "./GetFeatureInfoFormat.js";
176
179
  * @see TileMapServiceImageryProvider
177
180
  * @see WebMapServiceImageryProvider
178
181
  * @see UrlTemplateImageryProvider
182
+ *
183
+ * @see {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Custom GetFeatureInfo Sandcastle Example}
179
184
  */
180
185
  function WebMapTileServiceImageryProvider(options) {
181
186
  options = options ?? Frozen.EMPTY_OBJECT;
@@ -168,6 +168,8 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
168
168
  if (collection._dirtyCount > 0) {
169
169
  const { _dirtyOffset, _dirtyCount } = collection;
170
170
 
171
+ const widthInMeters = collection.widthUnits === "meters";
172
+
171
173
  const indexArray = renderContext.indexArray;
172
174
 
173
175
  const {
@@ -200,6 +202,8 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
200
202
  polyline.getMaterial(material);
201
203
  const encodedColor = AttributeCompression.encodeRGB8(material.color);
202
204
  const colorAlpha = material.color.alpha;
205
+ // A negative width marks a width in meters, which the shader converts to pixels.
206
+ const signedWidth = widthInMeters ? -material.width : material.width;
203
207
  Color.fromRgba(polyline._pickId, pickColor);
204
208
  const show = polyline.show;
205
209
 
@@ -306,7 +310,7 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
306
310
 
307
311
  showColorWidthAndTexCoordArray[vOffset * 4] = show ? 1 : 0;
308
312
  showColorWidthAndTexCoordArray[vOffset * 4 + 1] = encodedColor;
309
- showColorWidthAndTexCoordArray[vOffset * 4 + 2] = material.width;
313
+ showColorWidthAndTexCoordArray[vOffset * 4 + 2] = signedWidth;
310
314
  showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1);
311
315
 
312
316
  alphaArray[vOffset] = colorAlpha * 255.0;
@@ -24,7 +24,7 @@ void main()
24
24
  {
25
25
  float show = showColorWidthAndTexCoord.x;
26
26
  vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
27
- float width = showColorWidthAndTexCoord.z;
27
+ float signedWidth = showColorWidthAndTexCoord.z;
28
28
  float texCoord = showColorWidthAndTexCoord.w;
29
29
 
30
30
  ///////////////////////////////////////////////////////////////////////////
@@ -37,11 +37,23 @@ void main()
37
37
  vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
38
38
  vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
39
39
  vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
40
- vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
41
40
  #else
42
41
  vec4 positionEC = czm_modelView * vec4(position, 1.0);
43
42
  vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0);
44
43
  vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0);
44
+ #endif
45
+
46
+ // A negative width is in meters; see renderBufferPolylineCollection. The quad is
47
+ // extruded in window coordinates, so convert it at this vertex's depth.
48
+ float width = abs(signedWidth);
49
+ if (signedWidth < 0.0)
50
+ {
51
+ width /= max(czm_metersPerPixel(positionEC), czm_epsilon7);
52
+ }
53
+
54
+ #ifdef USE_FLOAT64
55
+ vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
56
+ #else
45
57
  // Positions are already in eye space; use the EC variant to skip the redundant transform.
46
58
  vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
47
59
  #endif
@@ -25,7 +25,7 @@ void main()\n\
25
25
  {\n\
26
26
  float show = showColorWidthAndTexCoord.x;\n\
27
27
  vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);\n\
28
- float width = showColorWidthAndTexCoord.z;\n\
28
+ float signedWidth = showColorWidthAndTexCoord.z;\n\
29
29
  float texCoord = showColorWidthAndTexCoord.w;\n\
30
30
  \n\
31
31
  ///////////////////////////////////////////////////////////////////////////\n\
@@ -38,11 +38,23 @@ void main()\n\
38
38
  vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);\n\
39
39
  vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);\n\
40
40
  vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);\n\
41
- vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
42
41
  #else\n\
43
42
  vec4 positionEC = czm_modelView * vec4(position, 1.0);\n\
44
43
  vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0);\n\
45
44
  vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0);\n\
45
+ #endif\n\
46
+ \n\
47
+ // A negative width is in meters; see renderBufferPolylineCollection. The quad is\n\
48
+ // extruded in window coordinates, so convert it at this vertex's depth.\n\
49
+ float width = abs(signedWidth);\n\
50
+ if (signedWidth < 0.0)\n\
51
+ {\n\
52
+ width /= max(czm_metersPerPixel(positionEC), czm_epsilon7);\n\
53
+ }\n\
54
+ \n\
55
+ #ifdef USE_FLOAT64\n\
56
+ vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
57
+ #else\n\
46
58
  // Positions are already in eye space; use the EC variant to skip the redundant transform.\n\
47
59
  vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
48
60
  #endif\n\
@@ -67,7 +67,6 @@ import czm_cascadeColor from './Functions/cascadeColor.js'
67
67
  import czm_cascadeDistance from './Functions/cascadeDistance.js'
68
68
  import czm_cascadeMatrix from './Functions/cascadeMatrix.js'
69
69
  import czm_cascadeWeights from './Functions/cascadeWeights.js'
70
- import czm_clipPolygons from './Functions/clipPolygons.js'
71
70
  import czm_columbusViewMorph from './Functions/columbusViewMorph.js'
72
71
  import czm_computeAtmosphereColor from './Functions/computeAtmosphereColor.js'
73
72
  import czm_computeGroundAtmosphereScattering from './Functions/computeGroundAtmosphereScattering.js'
@@ -83,6 +82,7 @@ import czm_ellipsoidContainsPoint from './Functions/ellipsoidContainsPoint.js'
83
82
  import czm_ellipsoidTextureCoordinates from './Functions/ellipsoidTextureCoordinates.js'
84
83
  import czm_equalsEpsilon from './Functions/equalsEpsilon.js'
85
84
  import czm_eyeOffset from './Functions/eyeOffset.js'
85
+ import czm_eyeToCartographicDelta from './Functions/eyeToCartographicDelta.js'
86
86
  import czm_eyeToWindowCoordinates from './Functions/eyeToWindowCoordinates.js'
87
87
  import czm_fastApproximateAtan from './Functions/fastApproximateAtan.js'
88
88
  import czm_fog from './Functions/fog.js'
@@ -131,7 +131,6 @@ import czm_transformPlane from './Functions/transformPlane.js'
131
131
  import czm_translateRelativeToEye from './Functions/translateRelativeToEye.js'
132
132
  import czm_translucentPhong from './Functions/translucentPhong.js'
133
133
  import czm_transpose from './Functions/transpose.js'
134
- import czm_unpackClippingExtents from './Functions/unpackClippingExtents.js'
135
134
  import czm_unpackDepth from './Functions/unpackDepth.js'
136
135
  import czm_unpackFloat from './Functions/unpackFloat.js'
137
136
  import czm_unpackTexture from './Functions/unpackTexture.js'
@@ -212,7 +211,6 @@ export default {
212
211
  czm_cascadeDistance : czm_cascadeDistance,
213
212
  czm_cascadeMatrix : czm_cascadeMatrix,
214
213
  czm_cascadeWeights : czm_cascadeWeights,
215
- czm_clipPolygons : czm_clipPolygons,
216
214
  czm_columbusViewMorph : czm_columbusViewMorph,
217
215
  czm_computeAtmosphereColor : czm_computeAtmosphereColor,
218
216
  czm_computeGroundAtmosphereScattering : czm_computeGroundAtmosphereScattering,
@@ -228,6 +226,7 @@ export default {
228
226
  czm_ellipsoidTextureCoordinates : czm_ellipsoidTextureCoordinates,
229
227
  czm_equalsEpsilon : czm_equalsEpsilon,
230
228
  czm_eyeOffset : czm_eyeOffset,
229
+ czm_eyeToCartographicDelta : czm_eyeToCartographicDelta,
231
230
  czm_eyeToWindowCoordinates : czm_eyeToWindowCoordinates,
232
231
  czm_fastApproximateAtan : czm_fastApproximateAtan,
233
232
  czm_fog : czm_fog,
@@ -276,7 +275,6 @@ export default {
276
275
  czm_translateRelativeToEye : czm_translateRelativeToEye,
277
276
  czm_translucentPhong : czm_translucentPhong,
278
277
  czm_transpose : czm_transpose,
279
- czm_unpackClippingExtents : czm_unpackClippingExtents,
280
278
  czm_unpackDepth : czm_unpackDepth,
281
279
  czm_unpackFloat : czm_unpackFloat,
282
280
  czm_unpackTexture : czm_unpackTexture,
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Computes the geodetic offset (delta longitude, latitude, and height) from a reference cartographic position
3
+ * to a point given in eye coordinates.
4
+ *
5
+ * This is designed to preserve precision. Rather than converting the point's absolute world position to
6
+ * cartographic -- which is too large to process precisely at 32 bits -- it works entirely with the small
7
+ * delta between the point and the camera. By projecting the eye-space offset onto the ellipsoid's equatorial
8
+ * and meridional planes, it derives the change in (longitude, latitude, height) as small, precisely-representable
9
+ * quantities. The delta gets smaller and more precise as one zooms in.
10
+ * <br /><br />
11
+ * This assumes an ellipsoid of revolution (equatorial radii equal, as with WGS84), so that longitude is exact.
12
+ * The latitude calculation is only first-order accurate, since the meridian is an ellipse rather than a circle.
13
+ *
14
+ * @name czm_eyeToCartographicDelta
15
+ * @glslFunction
16
+ *
17
+ * @param {vec3} positionEC The position, in eye coordinates, to measure to.
18
+ *
19
+ * @returns {vec3} The geodetic offset from the camera to <code>positionEC</code>, as (delta longitude, delta latitude in radians, delta height in meters).
20
+ */
21
+ vec3 czm_eyeToCartographicDelta(vec3 positionEC)
22
+ {
23
+ // A vector representing the camera-to-vertex offset, in an ENU oriented reference frame (centered at the camera)
24
+ vec3 cameraToVertex = czm_eyeToEnu * positionEC;
25
+
26
+ float cosLatitude = cos(czm_eyeCartographic.y);
27
+ float sinLatitude = sin(czm_eyeCartographic.y);
28
+
29
+ // To derive longitude, project the camera and vertex onto the equatorial plane, in a frame such that the camera lies along the +x axis. In this frame,
30
+ // the vertex's (delta) longitude is simply the atan of its x and y components.
31
+ float primeVerticalRadius = 1.0 / czm_eyeEllipsoidCurvature.x;
32
+ vec2 cameraEquatorialPos = vec2((primeVerticalRadius + czm_eyeCartographic.z) * cosLatitude, 0.0);
33
+ vec2 vertexEquatorialPos = cameraEquatorialPos + vec2(-cameraToVertex.y * sinLatitude + cameraToVertex.z * cosLatitude, cameraToVertex.x);
34
+ float deltaLongitude = atan(vertexEquatorialPos.y, vertexEquatorialPos.x);
35
+
36
+ // Deriving latitude is a bit harder: we can't directly project the vertex onto the camera's meridian — the latitude projection is dependent on the longitude.
37
+ // Instead we can rotate the vertex (by -deltaLongitude) onto the camera's meridional plane. (Note: (unlike the exact longitude case) this is only first-order accurate because the meridian is an ellipse rather than a circle)
38
+ // Using a 2D rotation formula introduces precision issues (subtraction of large-magnitude quantities), so instead we can calculate the vector difference
39
+ // between the vertex and its rotated version, and apply that offset to the cameraToVertex vector. Then, the cameraToVertex vector accurately
40
+ // reflects the difference between the camera and the _rotated_ vertex, so we can then project the camera onto the meridional plane and apply this offset - just as we did for deltaLongitude, above.
41
+ // Best of all, we can do this all with small delta quantities which preserve precision.
42
+ //
43
+ // (I suggest drawing this out -- with the vertex and camera vectors projected onto the equatorial plane, with the camera on the +x axis)
44
+ // Mathematically: if you compare (subtract) vertexEquatorialPos and the same vector rotated onto the camera's meridional plane, you get
45
+ // |dx| = |vertexEquatorialPos| - vertexEquatorialPos.x = (r - x) = r * (1 - cos(deltaLongitude))
46
+ // |dy| = cameraToVertex.x (the east component)
47
+ // (To avoid precision issues, we'll use the identity (1 - cos(x) = 2 * sin^2(x/2)))
48
+ //
49
+ // Since these offsets were produced in the equatorial plane, and cameraToVertex is in the camera's ENU frame, we need to deconstruct along the camera's north and up axes. And we only care about
50
+ // dx, since dy is in the camera's east direction, and that component gets zeroed out when projecting onto the camera's meridional plane.
51
+ float sinHalfLongitude = sin(deltaLongitude * 0.5);
52
+ float dx = length(vertexEquatorialPos) * 2.0 * sinHalfLongitude * sinHalfLongitude;
53
+ vec3 meridionalOffset = vec3(
54
+ 0.0, // east
55
+ cameraToVertex.y - dx * sinLatitude, // north
56
+ cameraToVertex.z + dx * cosLatitude // up
57
+ );
58
+
59
+ // Reframe the camera in a meridional plane, where it lies along the +z axis, and apply the meridionalOffset to get the vertex's position in that plane.
60
+ // Then, deltaLatitude is simply the atan of its x and y components.
61
+ float meridionalRadius = 1.0 / czm_eyeEllipsoidCurvature.y;
62
+ vec2 cameraMeridionalPos = vec2(meridionalRadius + czm_eyeCartographic.z, 0.0);
63
+ vec2 vertMeridionalPos = cameraMeridionalPos + vec2(meridionalOffset.z, meridionalOffset.y);
64
+ float deltaLatitude = atan(vertMeridionalPos.y, vertMeridionalPos.x);
65
+
66
+ // Finally, derive the change in height above the ellipsoid. This is the meridional-plane analogue of the dx step above:
67
+ // there we rotated the vertex (in the equatorial plane) to the camera's longitude; here we rotate it (in the meridional plane, by -deltaLatitude)
68
+ // to the camera's latitude, aligning it with the camera's radial (up) direction.
69
+ float sinHalfLatitude = sin(deltaLatitude * 0.5);
70
+ float dz = length(vertMeridionalPos) * 2.0 * sinHalfLatitude * sinHalfLatitude;
71
+ float deltaHeight = meridionalOffset.z + dz;
72
+
73
+ return vec3(deltaLongitude, deltaLatitude, deltaHeight);
74
+ }
@@ -0,0 +1,76 @@
1
+ //This file is automatically rebuilt by the Cesium build process.
2
+ export default "/**\n\
3
+ * Computes the geodetic offset (delta longitude, latitude, and height) from a reference cartographic position\n\
4
+ * to a point given in eye coordinates.\n\
5
+ *\n\
6
+ * This is designed to preserve precision. Rather than converting the point's absolute world position to\n\
7
+ * cartographic -- which is too large to process precisely at 32 bits -- it works entirely with the small\n\
8
+ * delta between the point and the camera. By projecting the eye-space offset onto the ellipsoid's equatorial\n\
9
+ * and meridional planes, it derives the change in (longitude, latitude, height) as small, precisely-representable\n\
10
+ * quantities. The delta gets smaller and more precise as one zooms in.\n\
11
+ * <br /><br />\n\
12
+ * This assumes an ellipsoid of revolution (equatorial radii equal, as with WGS84), so that longitude is exact.\n\
13
+ * The latitude calculation is only first-order accurate, since the meridian is an ellipse rather than a circle.\n\
14
+ *\n\
15
+ * @name czm_eyeToCartographicDelta\n\
16
+ * @glslFunction\n\
17
+ *\n\
18
+ * @param {vec3} positionEC The position, in eye coordinates, to measure to.\n\
19
+ *\n\
20
+ * @returns {vec3} The geodetic offset from the camera to <code>positionEC</code>, as (delta longitude, delta latitude in radians, delta height in meters).\n\
21
+ */\n\
22
+ vec3 czm_eyeToCartographicDelta(vec3 positionEC)\n\
23
+ {\n\
24
+ // A vector representing the camera-to-vertex offset, in an ENU oriented reference frame (centered at the camera)\n\
25
+ vec3 cameraToVertex = czm_eyeToEnu * positionEC;\n\
26
+ \n\
27
+ float cosLatitude = cos(czm_eyeCartographic.y);\n\
28
+ float sinLatitude = sin(czm_eyeCartographic.y);\n\
29
+ \n\
30
+ // To derive longitude, project the camera and vertex onto the equatorial plane, in a frame such that the camera lies along the +x axis. In this frame,\n\
31
+ // the vertex's (delta) longitude is simply the atan of its x and y components.\n\
32
+ float primeVerticalRadius = 1.0 / czm_eyeEllipsoidCurvature.x;\n\
33
+ vec2 cameraEquatorialPos = vec2((primeVerticalRadius + czm_eyeCartographic.z) * cosLatitude, 0.0);\n\
34
+ vec2 vertexEquatorialPos = cameraEquatorialPos + vec2(-cameraToVertex.y * sinLatitude + cameraToVertex.z * cosLatitude, cameraToVertex.x);\n\
35
+ float deltaLongitude = atan(vertexEquatorialPos.y, vertexEquatorialPos.x);\n\
36
+ \n\
37
+ // Deriving latitude is a bit harder: we can't directly project the vertex onto the camera's meridian — the latitude projection is dependent on the longitude.\n\
38
+ // Instead we can rotate the vertex (by -deltaLongitude) onto the camera's meridional plane. (Note: (unlike the exact longitude case) this is only first-order accurate because the meridian is an ellipse rather than a circle)\n\
39
+ // Using a 2D rotation formula introduces precision issues (subtraction of large-magnitude quantities), so instead we can calculate the vector difference\n\
40
+ // between the vertex and its rotated version, and apply that offset to the cameraToVertex vector. Then, the cameraToVertex vector accurately\n\
41
+ // reflects the difference between the camera and the _rotated_ vertex, so we can then project the camera onto the meridional plane and apply this offset - just as we did for deltaLongitude, above.\n\
42
+ // Best of all, we can do this all with small delta quantities which preserve precision.\n\
43
+ //\n\
44
+ // (I suggest drawing this out -- with the vertex and camera vectors projected onto the equatorial plane, with the camera on the +x axis)\n\
45
+ // Mathematically: if you compare (subtract) vertexEquatorialPos and the same vector rotated onto the camera's meridional plane, you get\n\
46
+ // |dx| = |vertexEquatorialPos| - vertexEquatorialPos.x = (r - x) = r * (1 - cos(deltaLongitude))\n\
47
+ // |dy| = cameraToVertex.x (the east component)\n\
48
+ // (To avoid precision issues, we'll use the identity (1 - cos(x) = 2 * sin^2(x/2)))\n\
49
+ //\n\
50
+ // Since these offsets were produced in the equatorial plane, and cameraToVertex is in the camera's ENU frame, we need to deconstruct along the camera's north and up axes. And we only care about\n\
51
+ // dx, since dy is in the camera's east direction, and that component gets zeroed out when projecting onto the camera's meridional plane.\n\
52
+ float sinHalfLongitude = sin(deltaLongitude * 0.5);\n\
53
+ float dx = length(vertexEquatorialPos) * 2.0 * sinHalfLongitude * sinHalfLongitude;\n\
54
+ vec3 meridionalOffset = vec3(\n\
55
+ 0.0, // east\n\
56
+ cameraToVertex.y - dx * sinLatitude, // north\n\
57
+ cameraToVertex.z + dx * cosLatitude // up\n\
58
+ );\n\
59
+ \n\
60
+ // Reframe the camera in a meridional plane, where it lies along the +z axis, and apply the meridionalOffset to get the vertex's position in that plane.\n\
61
+ // Then, deltaLatitude is simply the atan of its x and y components.\n\
62
+ float meridionalRadius = 1.0 / czm_eyeEllipsoidCurvature.y;\n\
63
+ vec2 cameraMeridionalPos = vec2(meridionalRadius + czm_eyeCartographic.z, 0.0);\n\
64
+ vec2 vertMeridionalPos = cameraMeridionalPos + vec2(meridionalOffset.z, meridionalOffset.y);\n\
65
+ float deltaLatitude = atan(vertMeridionalPos.y, vertMeridionalPos.x);\n\
66
+ \n\
67
+ // Finally, derive the change in height above the ellipsoid. This is the meridional-plane analogue of the dx step above:\n\
68
+ // there we rotated the vertex (in the equatorial plane) to the camera's longitude; here we rotate it (in the meridional plane, by -deltaLatitude)\n\
69
+ // to the camera's latitude, aligning it with the camera's radial (up) direction.\n\
70
+ float sinHalfLatitude = sin(deltaLatitude * 0.5);\n\
71
+ float dz = length(vertMeridionalPos) * 2.0 * sinHalfLatitude * sinHalfLatitude;\n\
72
+ float deltaHeight = meridionalOffset.z + dz;\n\
73
+ \n\
74
+ return vec3(deltaLongitude, deltaLatitude, deltaHeight);\n\
75
+ }\n\
76
+ ";
@@ -77,12 +77,6 @@ uniform mat4 u_clippingPlanesMatrix;
77
77
  uniform vec4 u_clippingPlanesEdgeStyle;
78
78
  #endif
79
79
 
80
- #ifdef ENABLE_CLIPPING_POLYGONS
81
- uniform highp sampler2D u_clippingDistance;
82
- in vec2 v_clippingPosition;
83
- flat in int v_regionIndex;
84
- #endif
85
-
86
80
  #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
87
81
  uniform float u_minimumBrightness;
88
82
  #endif
@@ -457,9 +451,16 @@ void main()
457
451
  #endif
458
452
 
459
453
  #ifdef ENABLE_CLIPPING_POLYGONS
460
- vec2 clippingPosition = v_clippingPosition;
461
- int regionIndex = v_regionIndex;
462
- clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
454
+ bool insideAny = vectorClip(v_textureCoordinates.xy);
455
+ #ifdef CLIPPING_INVERSE
456
+ if (!insideAny) {
457
+ discard;
458
+ }
459
+ #else
460
+ if (insideAny) {
461
+ discard;
462
+ }
463
+ #endif
463
464
  #endif
464
465
 
465
466
  #ifdef HIGHLIGHT_FILL_TILE
@@ -78,12 +78,6 @@ uniform mat4 u_clippingPlanesMatrix;\n\
78
78
  uniform vec4 u_clippingPlanesEdgeStyle;\n\
79
79
  #endif\n\
80
80
  \n\
81
- #ifdef ENABLE_CLIPPING_POLYGONS\n\
82
- uniform highp sampler2D u_clippingDistance;\n\
83
- in vec2 v_clippingPosition;\n\
84
- flat in int v_regionIndex;\n\
85
- #endif\n\
86
- \n\
87
81
  #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\n\
88
82
  uniform float u_minimumBrightness;\n\
89
83
  #endif\n\
@@ -458,9 +452,16 @@ void main()\n\
458
452
  #endif\n\
459
453
  \n\
460
454
  #ifdef ENABLE_CLIPPING_POLYGONS\n\
461
- vec2 clippingPosition = v_clippingPosition;\n\
462
- int regionIndex = v_regionIndex;\n\
463
- clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);\n\
455
+ bool insideAny = vectorClip(v_textureCoordinates.xy);\n\
456
+ #ifdef CLIPPING_INVERSE\n\
457
+ if (!insideAny) {\n\
458
+ discard;\n\
459
+ }\n\
460
+ #else\n\
461
+ if (insideAny) {\n\
462
+ discard;\n\
463
+ }\n\
464
+ #endif\n\
464
465
  #endif\n\
465
466
  \n\
466
467
  #ifdef HIGHLIGHT_FILL_TILE\n\
@@ -578,6 +579,7 @@ void main()\n\
578
579
  #endif\n\
579
580
  \n\
580
581
  #ifdef HAS_VECTOR_LAYER\n\
582
+ finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor);\n\
581
583
  finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor);\n\
582
584
  #endif\n\
583
585
  \n\
@@ -46,12 +46,6 @@ out vec3 v_atmosphereMieColor;
46
46
  out float v_atmosphereOpacity;
47
47
  #endif
48
48
 
49
- #ifdef ENABLE_CLIPPING_POLYGONS
50
- uniform highp sampler2D u_clippingExtents;
51
- out vec2 v_clippingPosition;
52
- flat out int v_regionIndex;
53
- #endif
54
-
55
49
  // These functions are generated at runtime.
56
50
  vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
57
51
  float get2DYPositionFraction(vec2 textureCoordinates);
@@ -214,32 +208,6 @@ void main()
214
208
  v_normalEC = czm_normal3D * v_normalMC;
215
209
  #endif
216
210
 
217
- #ifdef ENABLE_CLIPPING_POLYGONS
218
- vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
219
- sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
220
-
221
- vec2 minDistance = vec2(czm_infinity);
222
- v_clippingPosition = vec2(czm_infinity);
223
- v_regionIndex = -1;
224
-
225
- for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
226
- vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
227
- vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
228
-
229
- vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
230
- vec2 distance = abs(rectUv - clamped) * extents.wz;
231
-
232
- float threshold = 0.01;
233
- if (minDistance.x > distance.x || minDistance.y > distance.y) {
234
- minDistance = distance;
235
- v_clippingPosition = rectUv;
236
- if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
237
- v_regionIndex = regionIndex;
238
- }
239
- }
240
- }
241
- #endif
242
-
243
211
  #if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
244
212
 
245
213
  bool dynamicLighting = false;
@@ -47,12 +47,6 @@ out vec3 v_atmosphereMieColor;\n\
47
47
  out float v_atmosphereOpacity;\n\
48
48
  #endif\n\
49
49
  \n\
50
- #ifdef ENABLE_CLIPPING_POLYGONS\n\
51
- uniform highp sampler2D u_clippingExtents;\n\
52
- out vec2 v_clippingPosition;\n\
53
- flat out int v_regionIndex;\n\
54
- #endif\n\
55
- \n\
56
50
  // These functions are generated at runtime.\n\
57
51
  vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\n\
58
52
  float get2DYPositionFraction(vec2 textureCoordinates);\n\
@@ -215,32 +209,6 @@ void main()\n\
215
209
  v_normalEC = czm_normal3D * v_normalMC;\n\
216
210
  #endif\n\
217
211
  \n\
218
- #ifdef ENABLE_CLIPPING_POLYGONS\n\
219
- vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);\n\
220
- sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n\
221
- \n\
222
- vec2 minDistance = vec2(czm_infinity);\n\
223
- v_clippingPosition = vec2(czm_infinity);\n\
224
- v_regionIndex = -1;\n\
225
- \n\
226
- for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {\n\
227
- vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);\n\
228
- vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;\n\
229
- \n\
230
- vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));\n\
231
- vec2 distance = abs(rectUv - clamped) * extents.wz;\n\
232
- \n\
233
- float threshold = 0.01;\n\
234
- if (minDistance.x > distance.x || minDistance.y > distance.y) {\n\
235
- minDistance = distance;\n\
236
- v_clippingPosition = rectUv;\n\
237
- if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {\n\
238
- v_regionIndex = regionIndex;\n\
239
- }\n\
240
- }\n\
241
- }\n\
242
- #endif\n\
243
- \n\
244
212
  #if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))\n\
245
213
  \n\
246
214
  bool dynamicLighting = false;\n\
@@ -1,6 +1,18 @@
1
1
  void modelClippingPolygonsStage()
2
2
  {
3
- vec2 clippingPosition = v_clippingPosition;
4
- int regionIndex = v_regionIndex;
5
- czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
3
+ // The lookup uv was computed per vertex in the vertex stage and
4
+ // interpolated across the primitive, so the fragment shader only samples it.
5
+ bool insideAny = vectorClip(v_clippingUv);
6
+
7
+ #ifdef CLIPPING_INVERSE
8
+ if (!insideAny)
9
+ {
10
+ discard;
11
+ }
12
+ #else
13
+ if (insideAny)
14
+ {
15
+ discard;
16
+ }
17
+ #endif
6
18
  }
@@ -1,8 +1,20 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
2
  export default "void modelClippingPolygonsStage()\n\
3
3
  {\n\
4
- vec2 clippingPosition = v_clippingPosition;\n\
5
- int regionIndex = v_regionIndex;\n\
6
- czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);\n\
4
+ // The lookup uv was computed per vertex in the vertex stage and\n\
5
+ // interpolated across the primitive, so the fragment shader only samples it.\n\
6
+ bool insideAny = vectorClip(v_clippingUv);\n\
7
+ \n\
8
+ #ifdef CLIPPING_INVERSE\n\
9
+ if (!insideAny)\n\
10
+ {\n\
11
+ discard;\n\
12
+ }\n\
13
+ #else\n\
14
+ if (insideAny)\n\
15
+ {\n\
16
+ discard;\n\
17
+ }\n\
18
+ #endif\n\
7
19
  }\n\
8
20
  ";
@@ -1,27 +1,23 @@
1
- void modelClippingPolygonsStage(ProcessedAttributes attributes)
1
+ /**
2
+ * This vertex shader derives each vertex's UV coordinate within the model's clipping rectangle (its ellipsoid footprint).
3
+ * 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,
4
+ * whose positions live in the same uv space. See {@link ModelClippingPolygonsStageFS.glsl}.
5
+ *
6
+ * To get this uv, we need each vertex's geodetic (lon, lat), normalized against the model's rectangle.
7
+ * 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.
8
+ * (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.)
9
+ * 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).
10
+ * 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.
11
+ *
12
+ * Ultimately, all this shader does is some geometry to obtain the vertex's relative position within the bounds of the model's geodetic rectangle.
13
+ * The complexity arises from doing so in a way that preserves precision.
14
+ */
15
+ void modelClippingPolygonsStage()
2
16
  {
3
- vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
4
- sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
17
+ // (We don't need the height component)
18
+ vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy;
5
19
 
6
- vec2 minDistance = vec2(czm_infinity);
7
- v_regionIndex = -1;
8
- v_clippingPosition = vec2(czm_infinity);
9
-
10
- for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
11
- vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
12
- vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
13
-
14
- vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
15
- vec2 distance = abs(rectUv - clamped) * extents.wz;
16
-
17
- if (minDistance.x > distance.x || minDistance.y > distance.y) {
18
- minDistance = distance;
19
- v_clippingPosition = rectUv;
20
- }
21
-
22
- float threshold = 0.01;
23
- if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
24
- v_regionIndex = regionIndex;
25
- }
26
- }
20
+ // 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.
21
+ // 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.
22
+ v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize;
27
23
  }