@cesium/engine 26.2.0 → 26.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +656 -518
  2. package/Build/Workers/{chunk-FU4BGABC.js → chunk-2DKJSPYF.js} +14 -14
  3. package/Build/Workers/{chunk-NCL22ZUX.js → chunk-2PWVICP6.js} +1 -1
  4. package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
  5. package/Build/Workers/{chunk-IJZJMIUY.js → chunk-4DMAXPKB.js} +11 -11
  6. package/Build/Workers/{chunk-IMBVP57H.js → chunk-4LRFYRBX.js} +2 -2
  7. package/Build/Workers/{chunk-76FDC45O.js → chunk-5JCZHJUU.js} +13 -13
  8. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-5KG7KDDW.js} +7 -7
  9. package/Build/Workers/{chunk-UAZUP4I5.js → chunk-6BSNYZZG.js} +5 -5
  10. package/Build/Workers/{chunk-D6AY775A.js → chunk-6R6SGKYN.js} +6 -6
  11. package/Build/Workers/{chunk-3PSS3T43.js → chunk-6V2KDEHL.js} +4 -4
  12. package/Build/Workers/{chunk-GHXVQVUM.js → chunk-75BC2IHI.js} +7 -7
  13. package/Build/Workers/{chunk-SMTGMFBL.js → chunk-7SESBH2I.js} +4 -4
  14. package/Build/Workers/{chunk-NEFDMMLY.js → chunk-7WXBTNRV.js} +8 -8
  15. package/Build/Workers/{chunk-NXGQBQWE.js → chunk-A7SMPV6B.js} +12 -12
  16. package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-ATSXKJ3L.js} +7 -7
  17. package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
  18. package/Build/Workers/{chunk-OZGPS7FB.js → chunk-B7Q2WF6Q.js} +4 -4
  19. package/Build/Workers/{chunk-2RGJPWQX.js → chunk-BNDSDQ7D.js} +9 -9
  20. package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-CKK6CUXK.js} +6 -6
  21. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
  22. package/Build/Workers/{chunk-6FZDPMTO.js → chunk-CQ4TZXAT.js} +6 -6
  23. package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-DKSANM4A.js} +12 -12
  24. package/Build/Workers/{chunk-XCBZVTIV.js → chunk-DZK34ZVD.js} +1 -1
  25. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-E7G32DWL.js} +1 -1
  26. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-EDETO6NY.js} +2 -2
  27. package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-F34TJJLA.js} +14 -14
  28. package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
  29. package/Build/Workers/{chunk-SJYSIOEM.js → chunk-GS7RY2DH.js} +11 -11
  30. package/Build/Workers/{chunk-5YPQBFRD.js → chunk-HDD3RFLT.js} +3 -3
  31. package/Build/Workers/{chunk-36NI5E6W.js → chunk-HDPNFEPP.js} +18 -18
  32. package/Build/Workers/{chunk-DSGLDRTI.js → chunk-JBJ6BRIM.js} +4 -4
  33. package/Build/Workers/{chunk-DZUFEE4L.js → chunk-JKTWW7IO.js} +5 -5
  34. package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-JL4NWWQY.js} +5 -5
  35. package/Build/Workers/{chunk-I74ZH5LK.js → chunk-JMUUAW4X.js} +10 -10
  36. package/Build/Workers/{chunk-SXSP3JHS.js → chunk-KBGAHN5R.js} +1 -1
  37. package/Build/Workers/{chunk-GVA7XQI2.js → chunk-KEWK6VZL.js} +12 -12
  38. package/Build/Workers/{chunk-EOWDZN5S.js → chunk-L73K5UPP.js} +10 -10
  39. package/Build/Workers/{chunk-J73T2VOY.js → chunk-LL2SGJYH.js} +6 -6
  40. package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-LYJUL4XQ.js} +6 -6
  41. package/Build/Workers/{chunk-MAAHFYPC.js → chunk-M6W46OAP.js} +7 -7
  42. package/Build/Workers/{chunk-FX3VEAIU.js → chunk-MDDKCLMF.js} +16 -16
  43. package/Build/Workers/{chunk-M6QKXVAU.js → chunk-MUW4DJV7.js} +17 -17
  44. package/Build/Workers/{chunk-EZGQPOIG.js → chunk-N5YK44FS.js} +5 -5
  45. package/Build/Workers/{chunk-27FWRTJI.js → chunk-NZQUP52G.js} +9 -9
  46. package/Build/Workers/{chunk-A62YI6S6.js → chunk-PKZA44LH.js} +4 -4
  47. package/Build/Workers/{chunk-7MM3N2VE.js → chunk-Q2JS5LCB.js} +17 -17
  48. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
  49. package/Build/Workers/{chunk-KP5QD7WU.js → chunk-SEJIXZZ4.js} +10 -10
  50. package/Build/Workers/{chunk-PRWUMCXF.js → chunk-SL2HCFYW.js} +10 -10
  51. package/Build/Workers/{chunk-NJVBJG63.js → chunk-SLHK3KAR.js} +5 -5
  52. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
  53. package/Build/Workers/{chunk-LDRQSYBN.js → chunk-VRECSMG3.js} +2 -2
  54. package/Build/Workers/{chunk-NLLCQBX3.js → chunk-X27HKF5E.js} +2 -2
  55. package/Build/Workers/{chunk-B3QHNA4A.js → chunk-XBY3354M.js} +6 -6
  56. package/Build/Workers/{chunk-CRCGE4J4.js → chunk-XRZCS3HE.js} +8 -8
  57. package/Build/Workers/{chunk-XLQZNQ4Z.js → chunk-XSIUYAT6.js} +2 -2
  58. package/Build/Workers/{chunk-SA2A2AN5.js → chunk-Z2DW5NM2.js} +4 -4
  59. package/Build/Workers/combineGeometry.js +24 -24
  60. package/Build/Workers/createBoxGeometry.js +18 -18
  61. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  62. package/Build/Workers/createCircleGeometry.js +26 -26
  63. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  64. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  65. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  66. package/Build/Workers/createCorridorGeometry.js +29 -29
  67. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  68. package/Build/Workers/createCylinderGeometry.js +20 -20
  69. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  70. package/Build/Workers/createEllipseGeometry.js +26 -26
  71. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  73. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  74. package/Build/Workers/createFrustumGeometry.js +18 -18
  75. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  76. package/Build/Workers/createGeometry.js +24 -24
  77. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  78. package/Build/Workers/createPlaneGeometry.js +16 -16
  79. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  80. package/Build/Workers/createPolygonGeometry.js +32 -32
  81. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  82. package/Build/Workers/createPolylineGeometry.js +25 -25
  83. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  84. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  85. package/Build/Workers/createRectangleGeometry.js +27 -27
  86. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  87. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  88. package/Build/Workers/createSphereGeometry.js +19 -19
  89. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  90. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  91. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  92. package/Build/Workers/createVectorTileGeometries.js +24 -24
  93. package/Build/Workers/createVectorTilePoints.js +13 -13
  94. package/Build/Workers/createVectorTilePolygons.js +22 -22
  95. package/Build/Workers/createVectorTilePolylines.js +14 -14
  96. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  97. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  98. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  99. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  100. package/Build/Workers/createWallGeometry.js +24 -24
  101. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  102. package/Build/Workers/decodeDraco.js +10 -10
  103. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  104. package/Build/Workers/decodeI3S.js +10 -10
  105. package/Build/Workers/gaussianSplatSorter.js +4 -4
  106. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  107. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  108. package/Build/Workers/transcodeKTX2.js +6 -6
  109. package/Build/Workers/transferTypedArrayTest.js +1 -1
  110. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  111. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  112. package/Source/Core/Ion.js +1 -1
  113. package/Source/Core/IonResource.js +5 -0
  114. package/Source/Core/IonSnapGeometryType.js +59 -0
  115. package/Source/Core/IonSnapHeat.js +33 -0
  116. package/Source/Core/IonSnapMode.js +45 -0
  117. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  118. package/Source/Core/IonSnapService.js +369 -0
  119. package/Source/Core/SnapService.js +63 -0
  120. package/Source/Core/VectorPipeline.js +139 -45
  121. package/Source/Core/VectorProvider.js +311 -71
  122. package/Source/Renderer/AutomaticUniforms.js +44 -2
  123. package/Source/Renderer/ShaderBuilder.js +1 -1
  124. package/Source/Renderer/UniformState.js +47 -1
  125. package/Source/Scene/ArcGisMapService.js +1 -1
  126. package/Source/Scene/BufferPointCollection.js +4 -7
  127. package/Source/Scene/BufferPolygonCollection.js +56 -27
  128. package/Source/Scene/BufferPolylineCollection.js +61 -8
  129. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  130. package/Source/Scene/BufferPrimitiveCollection.js +199 -29
  131. package/Source/Scene/Cesium3DTile.js +12 -0
  132. package/Source/Scene/Cesium3DTileset.js +61 -8
  133. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  134. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  135. package/Source/Scene/ClippingPolygon.js +154 -100
  136. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  137. package/Source/Scene/CreditDisplay.js +62 -0
  138. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  139. package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
  140. package/Source/Scene/GlobeSurfaceTile.js +14 -1
  141. package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
  142. package/Source/Scene/GltfLoader.js +56 -6
  143. package/Source/Scene/HeightReference.js +1 -1
  144. package/Source/Scene/MVTDataProvider.js +9 -0
  145. package/Source/Scene/Model/Model.js +242 -16
  146. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  147. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  148. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  149. package/Source/Scene/Model/ModelSceneGraph.js +10 -1
  150. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  151. package/Source/Scene/Model/PickingPipelineStage.js +4 -0
  152. package/Source/Scene/PostProcessStage.js +22 -3
  153. package/Source/Scene/Scene.js +56 -1
  154. package/Source/Scene/Snapping.js +57 -0
  155. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
  156. package/Source/Scene/VectorGltf3DTileContent.js +10 -2
  157. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  158. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  159. package/Source/Scene/renderBufferPolylineCollection.js +5 -1
  160. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  161. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  162. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
  163. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  164. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  165. package/Source/Shaders/GlobeFS.glsl +10 -9
  166. package/Source/Shaders/GlobeFS.js +11 -9
  167. package/Source/Shaders/GlobeVS.glsl +0 -32
  168. package/Source/Shaders/GlobeVS.js +0 -32
  169. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  170. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  171. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  172. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  173. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  174. package/Source/Shaders/Model/ModelFS.js +4 -0
  175. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  176. package/Source/Shaders/Model/ModelVS.js +7 -2
  177. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  178. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  179. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  180. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  181. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  182. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  183. package/Source/Shaders/VectorCommon.glsl +177 -50
  184. package/Source/Shaders/VectorCommon.js +251 -19
  185. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  186. package/index.d.ts +556 -55
  187. package/index.js +20 -13
  188. package/package.json +6 -6
  189. package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
  190. package/Build/Workers/chunk-2H5264K7.js +0 -1284
  191. package/Build/Workers/chunk-2H73KDBM.js +0 -511
  192. package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
  193. package/Build/Workers/chunk-37SW7SYS.js +0 -778
  194. package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
  195. package/Build/Workers/chunk-3LB4UVPU.js +0 -387
  196. package/Build/Workers/chunk-3PONLKEL.js +0 -778
  197. package/Build/Workers/chunk-3QR662HH.js +0 -3820
  198. package/Build/Workers/chunk-3SX2WYSO.js +0 -973
  199. package/Build/Workers/chunk-3UDN6LYX.js +0 -476
  200. package/Build/Workers/chunk-47MCBSXI.js +0 -9237
  201. package/Build/Workers/chunk-4E626OCE.js +0 -1067
  202. package/Build/Workers/chunk-4NW2MJKH.js +0 -455
  203. package/Build/Workers/chunk-52YK5BSN.js +0 -198
  204. package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
  205. package/Build/Workers/chunk-6FHT43QR.js +0 -140
  206. package/Build/Workers/chunk-6HK6IXK2.js +0 -138
  207. package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
  208. package/Build/Workers/chunk-6YR6JBMY.js +0 -163
  209. package/Build/Workers/chunk-7A2OGDHT.js +0 -305
  210. package/Build/Workers/chunk-7CGEQUM2.js +0 -305
  211. package/Build/Workers/chunk-7D2HZKH7.js +0 -455
  212. package/Build/Workers/chunk-7I325HV6.js +0 -1344
  213. package/Build/Workers/chunk-7KVKHY7O.js +0 -147
  214. package/Build/Workers/chunk-7TKLTCZW.js +0 -219
  215. package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
  216. package/Build/Workers/chunk-7W6DUHAB.js +0 -693
  217. package/Build/Workers/chunk-7XM5JK5F.js +0 -162
  218. package/Build/Workers/chunk-7YG3ND3P.js +0 -454
  219. package/Build/Workers/chunk-A3O6EDBK.js +0 -73
  220. package/Build/Workers/chunk-A6X24AZI.js +0 -1992
  221. package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
  222. package/Build/Workers/chunk-ACTVJHSP.js +0 -519
  223. package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
  224. package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
  225. package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
  226. package/Build/Workers/chunk-ARZICEEP.js +0 -301
  227. package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
  228. package/Build/Workers/chunk-BKPQFCXH.js +0 -511
  229. package/Build/Workers/chunk-BSPCI2LO.js +0 -959
  230. package/Build/Workers/chunk-BUJWSX5S.js +0 -301
  231. package/Build/Workers/chunk-C7JQVRLM.js +0 -497
  232. package/Build/Workers/chunk-C7QDUNI3.js +0 -138
  233. package/Build/Workers/chunk-CDJDJ5LK.js +0 -44
  234. package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
  235. package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
  236. package/Build/Workers/chunk-CLCTQVVL.js +0 -241
  237. package/Build/Workers/chunk-CQNFIAZU.js +0 -56
  238. package/Build/Workers/chunk-CUTRKXUQ.js +0 -288
  239. package/Build/Workers/chunk-DBD5WWG2.js +0 -959
  240. package/Build/Workers/chunk-DIGUUD6G.js +0 -171
  241. package/Build/Workers/chunk-DZBQUULR.js +0 -138
  242. package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
  243. package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
  244. package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
  245. package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
  246. package/Build/Workers/chunk-ELE6SC2C.js +0 -837
  247. package/Build/Workers/chunk-ENNFMWDW.js +0 -789
  248. package/Build/Workers/chunk-ERKUET22.js +0 -3201
  249. package/Build/Workers/chunk-F2IMBMZY.js +0 -241
  250. package/Build/Workers/chunk-F4CSNRZO.js +0 -219
  251. package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
  252. package/Build/Workers/chunk-FDK4K5IA.js +0 -280
  253. package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
  254. package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
  255. package/Build/Workers/chunk-FQ42MT7M.js +0 -58
  256. package/Build/Workers/chunk-GGNWQWSB.js +0 -301
  257. package/Build/Workers/chunk-GNKXEN4C.js +0 -682
  258. package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
  259. package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
  260. package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
  261. package/Build/Workers/chunk-H2WCFXLP.js +0 -241
  262. package/Build/Workers/chunk-HHV3MCGV.js +0 -162
  263. package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
  264. package/Build/Workers/chunk-HS6AD4P2.js +0 -398
  265. package/Build/Workers/chunk-HT6FASOT.js +0 -973
  266. package/Build/Workers/chunk-IDVHUDZT.js +0 -352
  267. package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
  268. package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
  269. package/Build/Workers/chunk-IUIFLOYO.js +0 -44
  270. package/Build/Workers/chunk-JALGQYDY.js +0 -288
  271. package/Build/Workers/chunk-JW6OZT4R.js +0 -288
  272. package/Build/Workers/chunk-JXYLJCTC.js +0 -124
  273. package/Build/Workers/chunk-K27QOAW6.js +0 -97
  274. package/Build/Workers/chunk-KMV25A63.js +0 -789
  275. package/Build/Workers/chunk-KZWFWJML.js +0 -2719
  276. package/Build/Workers/chunk-LCXRRALY.js +0 -387
  277. package/Build/Workers/chunk-LD64RPYV.js +0 -368
  278. package/Build/Workers/chunk-LGNDTZVX.js +0 -97
  279. package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
  280. package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
  281. package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
  282. package/Build/Workers/chunk-MEENMEAH.js +0 -198
  283. package/Build/Workers/chunk-NAWU5RF4.js +0 -162
  284. package/Build/Workers/chunk-NIWITKQK.js +0 -693
  285. package/Build/Workers/chunk-OA6MYL2C.js +0 -837
  286. package/Build/Workers/chunk-OBEU25PI.js +0 -1067
  287. package/Build/Workers/chunk-OHP4ELS7.js +0 -198
  288. package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
  289. package/Build/Workers/chunk-PD4GK4EM.js +0 -57
  290. package/Build/Workers/chunk-PEDU33QG.js +0 -2342
  291. package/Build/Workers/chunk-PVTSNNVI.js +0 -288
  292. package/Build/Workers/chunk-QHPZH22L.js +0 -241
  293. package/Build/Workers/chunk-QIZDWZK6.js +0 -301
  294. package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
  295. package/Build/Workers/chunk-QVLAFFJY.js +0 -56
  296. package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
  297. package/Build/Workers/chunk-R4K7EHOU.js +0 -171
  298. package/Build/Workers/chunk-R7JGHDD6.js +0 -789
  299. package/Build/Workers/chunk-RASQEYD4.js +0 -1483
  300. package/Build/Workers/chunk-RG4F5R57.js +0 -454
  301. package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
  302. package/Build/Workers/chunk-RYSQVJR6.js +0 -398
  303. package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
  304. package/Build/Workers/chunk-SDFHDNS4.js +0 -147
  305. package/Build/Workers/chunk-SF6K72D7.js +0 -124
  306. package/Build/Workers/chunk-SGRGNDOD.js +0 -682
  307. package/Build/Workers/chunk-SM2CDCYF.js +0 -198
  308. package/Build/Workers/chunk-SS5ABQGY.js +0 -102
  309. package/Build/Workers/chunk-T5QBPLE3.js +0 -414
  310. package/Build/Workers/chunk-TN35HP5B.js +0 -1067
  311. package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
  312. package/Build/Workers/chunk-TOAF47AQ.js +0 -102
  313. package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
  314. package/Build/Workers/chunk-TSDSILQB.js +0 -124
  315. package/Build/Workers/chunk-TVZD72WJ.js +0 -778
  316. package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
  317. package/Build/Workers/chunk-UEY73NRN.js +0 -38
  318. package/Build/Workers/chunk-UF46SZEZ.js +0 -789
  319. package/Build/Workers/chunk-UNRTMCET.js +0 -398
  320. package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
  321. package/Build/Workers/chunk-UVO6COT2.js +0 -352
  322. package/Build/Workers/chunk-V46YGZE6.js +0 -352
  323. package/Build/Workers/chunk-VAL7DYNR.js +0 -278
  324. package/Build/Workers/chunk-VDGOCROW.js +0 -57
  325. package/Build/Workers/chunk-VFWSSBPT.js +0 -511
  326. package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
  327. package/Build/Workers/chunk-VXWHPYQM.js +0 -837
  328. package/Build/Workers/chunk-VXYUBRSB.js +0 -219
  329. package/Build/Workers/chunk-VZLDLEWI.js +0 -387
  330. package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
  331. package/Build/Workers/chunk-WBSY7HDY.js +0 -837
  332. package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
  333. package/Build/Workers/chunk-WPRUWXGV.js +0 -693
  334. package/Build/Workers/chunk-WTO2ERBP.js +0 -414
  335. package/Build/Workers/chunk-WVHMDVG4.js +0 -959
  336. package/Build/Workers/chunk-XGA23TAX.js +0 -73
  337. package/Build/Workers/chunk-XLXSDIP5.js +0 -973
  338. package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
  339. package/Build/Workers/chunk-XQH66YJC.js +0 -147
  340. package/Build/Workers/chunk-XTA7BXJG.js +0 -682
  341. package/Build/Workers/chunk-XTIDAFRS.js +0 -476
  342. package/Build/Workers/chunk-XUEDWBUD.js +0 -682
  343. package/Build/Workers/chunk-XYFLRH3H.js +0 -124
  344. package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
  345. package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
  346. package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
  347. package/Build/Workers/chunk-YEYOSTJX.js +0 -219
  348. package/Build/Workers/chunk-YGFVAGYF.js +0 -630
  349. package/Build/Workers/chunk-YIIACKQO.js +0 -368
  350. package/Build/Workers/chunk-YJGSP6PE.js +0 -511
  351. package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
  352. package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
  353. package/Build/Workers/chunk-Z66EVE2A.js +0 -44
  354. package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
  355. package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
  356. package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
  357. package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
  358. package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
  359. package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
  360. package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
  361. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  362. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  363. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  364. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  365. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  366. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -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
  }
@@ -1,29 +1,25 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
- export default "void modelClippingPolygonsStage(ProcessedAttributes attributes)\n\
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
- vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);\n\
5
- sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n\
18
+ // (We don't need the height component)\n\
19
+ vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy;\n\
6
20
  \n\
7
- vec2 minDistance = vec2(czm_infinity);\n\
8
- v_regionIndex = -1;\n\
9
- v_clippingPosition = vec2(czm_infinity);\n\
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 ENABLE_CLIPPING_POLYGONS
123
- modelClippingPolygonsStage(attributes);
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 ENABLE_CLIPPING_POLYGONS\n\
124
- modelClippingPolygonsStage(attributes);\n\
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,6 @@
1
+ void modelVectorLookupStage(inout vec4 color)
2
+ {
3
+ // Fills composite before strokes. Both no-op against 1x1 placeholder textures.
4
+ color = vectorPolygonRender(v_vectorUv, color);
5
+ color = vectorPolylineRender(v_vectorUv, color);
6
+ }
@@ -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
+ ";