@cesium/engine 21.0.1 → 22.0.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 (244) hide show
  1. package/Build/Workers/{chunk-LPKJSIMD.js → chunk-2D3GLFZD.js} +12 -12
  2. package/Build/Workers/chunk-34YXP222.js +352 -0
  3. package/Build/Workers/{chunk-UKA7OISV.js → chunk-3GL53OCU.js} +17 -18
  4. package/Build/Workers/{chunk-WQZL6CA2.js → chunk-5B7VZQZY.js} +6 -6
  5. package/Build/Workers/{chunk-FE565QHX.js → chunk-5T5SY63I.js} +2 -2
  6. package/Build/Workers/{chunk-RR3NCT4R.js → chunk-5ZF53EY6.js} +4 -4
  7. package/Build/Workers/{chunk-PZUZCAX3.js → chunk-6HBKE43B.js} +7 -7
  8. package/Build/Workers/{chunk-5YXA47QD.js → chunk-726NINF5.js} +16 -16
  9. package/Build/Workers/{chunk-3RKX3UFI.js → chunk-75HAJIDT.js} +1 -1
  10. package/Build/Workers/{chunk-CBPNIEGH.js → chunk-7KAXDKRU.js} +10 -10
  11. package/Build/Workers/chunk-7XEJGXX2.js +2759 -0
  12. package/Build/Workers/{chunk-U2GR5FDL.js → chunk-A4DPJIWS.js} +18 -10
  13. package/Build/Workers/{chunk-G3CKZ34K.js → chunk-A6JAFSZT.js} +5 -5
  14. package/Build/Workers/{chunk-2SI7DEW5.js → chunk-AARZSH4V.js} +5 -5
  15. package/Build/Workers/{chunk-W6KMV4F5.js → chunk-AOM3FHBN.js} +6 -6
  16. package/Build/Workers/{chunk-VVALNLSH.js → chunk-BJSNGGBM.js} +4 -4
  17. package/Build/Workers/{chunk-3YNW5K6O.js → chunk-ECHAJNQJ.js} +12 -12
  18. package/Build/Workers/{chunk-KZ7GDSAJ.js → chunk-EJO3NKMS.js} +1 -1
  19. package/Build/Workers/{chunk-UFSYRVC5.js → chunk-EZ7NJXQN.js} +4 -4
  20. package/Build/Workers/{chunk-P2UKEFCK.js → chunk-FA3SCJDX.js} +2 -2
  21. package/Build/Workers/{chunk-MXOGBWMP.js → chunk-GYRDA3XK.js} +14 -14
  22. package/Build/Workers/{chunk-KVB73ECP.js → chunk-H7B7FU2U.js} +7 -7
  23. package/Build/Workers/{chunk-XJVRYJVZ.js → chunk-IGX772ZQ.js} +1 -1
  24. package/Build/Workers/{chunk-MQPDOWGH.js → chunk-JDJAPBZP.js} +1 -1
  25. package/Build/Workers/{chunk-DDXI6UYW.js → chunk-JZFU2LEM.js} +4 -4
  26. package/Build/Workers/{chunk-DAJKOQW6.js → chunk-KGLDJRSO.js} +9 -9
  27. package/Build/Workers/{chunk-CSDYSXBI.js → chunk-KUB64XW6.js} +11 -11
  28. package/Build/Workers/{chunk-X3ZV3XNO.js → chunk-L7U26FFD.js} +16 -16
  29. package/Build/Workers/{chunk-YZ3RCE45.js → chunk-LEFQBK6H.js} +11 -11
  30. package/Build/Workers/{chunk-KEPPNSBL.js → chunk-LWJXCI3F.js} +5 -5
  31. package/Build/Workers/{chunk-YNOVMSUX.js → chunk-M7HRE4QR.js} +8 -8
  32. package/Build/Workers/{chunk-ASVODZNK.js → chunk-MXHRZHDF.js} +6 -6
  33. package/Build/Workers/{chunk-PJAA7QSC.js → chunk-N52ZRKUE.js} +6 -6
  34. package/Build/Workers/{chunk-W6I3LNPF.js → chunk-NE5JTQJP.js} +7 -7
  35. package/Build/Workers/{chunk-XG54SG4O.js → chunk-NGKF5NTR.js} +5 -5
  36. package/Build/Workers/{chunk-42EJCSIV.js → chunk-NHZNMTIR.js} +5 -5
  37. package/Build/Workers/{chunk-LU7DLY2L.js → chunk-OE22564R.js} +3 -3
  38. package/Build/Workers/{chunk-A2SP2EJZ.js → chunk-OUBBMEWX.js} +6 -6
  39. package/Build/Workers/{chunk-J2XQVKVH.js → chunk-P2H75UV5.js} +67 -33
  40. package/Build/Workers/{chunk-J3KPR6DJ.js → chunk-QCMRUVVF.js} +12 -12
  41. package/Build/Workers/{chunk-RVRN4KDB.js → chunk-QSMIHPUM.js} +2 -2
  42. package/Build/Workers/{chunk-EBDZDBJN.js → chunk-RCCYW6E7.js} +12 -12
  43. package/Build/Workers/{chunk-LV3G32QE.js → chunk-RQRODXVN.js} +4 -4
  44. package/Build/Workers/{chunk-OBS5EMZ6.js → chunk-SZN34LQ5.js} +10 -10
  45. package/Build/Workers/{chunk-IKUOV6DO.js → chunk-U4XMLGSR.js} +7 -7
  46. package/Build/Workers/{chunk-NYYQZ3LH.js → chunk-U7CX3HHE.js} +8 -8
  47. package/Build/Workers/{chunk-QNOIRRJK.js → chunk-VCVA7BMD.js} +4 -4
  48. package/Build/Workers/{chunk-TGJQMEL4.js → chunk-VVZ667H6.js} +2 -2
  49. package/Build/Workers/{chunk-DBHL2UVG.js → chunk-W4PIP5PG.js} +2 -2
  50. package/Build/Workers/{chunk-2QPH5QDK.js → chunk-XPVZWY4A.js} +8 -8
  51. package/Build/Workers/{chunk-4CORGH7N.js → chunk-XQ347YWU.js} +13 -13
  52. package/Build/Workers/{chunk-T7HU6E7G.js → chunk-XZO6F23E.js} +1 -1
  53. package/Build/Workers/{chunk-DTKSVIH5.js → chunk-YLILBDWK.js} +2 -2
  54. package/Build/Workers/{chunk-JG3C3LPY.js → chunk-YLXWC7OW.js} +4 -4
  55. package/Build/Workers/combineGeometry.js +21 -21
  56. package/Build/Workers/createBoxGeometry.js +15 -15
  57. package/Build/Workers/createBoxOutlineGeometry.js +13 -13
  58. package/Build/Workers/createCircleGeometry.js +23 -23
  59. package/Build/Workers/createCircleOutlineGeometry.js +16 -16
  60. package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
  61. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
  62. package/Build/Workers/createCorridorGeometry.js +26 -26
  63. package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
  64. package/Build/Workers/createCylinderGeometry.js +17 -17
  65. package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
  66. package/Build/Workers/createEllipseGeometry.js +23 -23
  67. package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
  68. package/Build/Workers/createEllipsoidGeometry.js +16 -16
  69. package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
  70. package/Build/Workers/createFrustumGeometry.js +15 -15
  71. package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
  72. package/Build/Workers/createGeometry.js +24 -22
  73. package/Build/Workers/createGroundPolylineGeometry.js +19 -19
  74. package/Build/Workers/createPlaneGeometry.js +13 -13
  75. package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
  76. package/Build/Workers/createPolygonGeometry.js +29 -29
  77. package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
  78. package/Build/Workers/createPolylineGeometry.js +22 -22
  79. package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
  80. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
  81. package/Build/Workers/createRectangleGeometry.js +24 -24
  82. package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
  83. package/Build/Workers/createSimplePolylineGeometry.js +20 -20
  84. package/Build/Workers/createSphereGeometry.js +16 -16
  85. package/Build/Workers/createSphereOutlineGeometry.js +15 -15
  86. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  87. package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
  88. package/Build/Workers/createVectorTileGeometries.js +21 -21
  89. package/Build/Workers/createVectorTilePoints.js +11 -11
  90. package/Build/Workers/createVectorTilePolygons.js +19 -19
  91. package/Build/Workers/createVectorTilePolylines.js +12 -12
  92. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +88 -0
  93. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +21 -21
  94. package/Build/Workers/createVerticesFromHeightmap.js +21 -21
  95. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -277
  96. package/Build/Workers/createWallGeometry.js +21 -21
  97. package/Build/Workers/createWallOutlineGeometry.js +20 -20
  98. package/Build/Workers/decodeDraco.js +10 -10
  99. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  100. package/Build/Workers/decodeI3S.js +9 -9
  101. package/Build/Workers/gaussianSplatSorter.js +4 -4
  102. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  103. package/Build/Workers/transcodeKTX2.js +6 -6
  104. package/Build/Workers/transferTypedArrayTest.js +1 -1
  105. package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
  106. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +92 -0
  107. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +2 -2
  108. package/Source/Core/Cesium3DTilesTerrainData.js +930 -0
  109. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1866 -0
  110. package/Source/Core/Cesium3DTilesTerrainProvider.js +1052 -0
  111. package/Source/Core/CesiumTerrainProvider.js +2 -2
  112. package/Source/Core/Color.js +23 -6
  113. package/Source/Core/EllipsoidalOccluder.js +2 -2
  114. package/Source/Core/FeatureDetection.js +0 -2
  115. package/Source/Core/GoogleEarthEnterpriseMetadata.js +1 -1
  116. package/Source/Core/GoogleEarthEnterpriseTerrainData.js +1 -1
  117. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
  118. package/Source/Core/HeightmapTerrainData.js +10 -22
  119. package/Source/Core/HilbertOrder.js +0 -6
  120. package/Source/Core/ITwinPlatform.js +6 -6
  121. package/Source/Core/Ion.js +1 -1
  122. package/Source/Core/IonResource.js +35 -27
  123. package/Source/Core/PixelFormat.js +2 -2
  124. package/Source/Core/QuantizedMeshTerrainData.js +23 -57
  125. package/Source/Core/Resource.js +15 -11
  126. package/Source/Core/S2Cell.js +6 -18
  127. package/Source/Core/TaskProcessor.js +1 -1
  128. package/Source/Core/TerrainData.js +2 -1
  129. package/Source/Core/TerrainEncoding.js +215 -38
  130. package/Source/Core/TerrainMesh.js +8 -8
  131. package/Source/Core/TerrainProvider.js +151 -0
  132. package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
  133. package/Source/Core/binarySearch.js +1 -1
  134. package/Source/Core/createWorldBathymetryAsync.js +2 -2
  135. package/Source/Core/createWorldTerrainAsync.js +3 -3
  136. package/Source/Core/loadImageFromTypedArray.js +9 -3
  137. package/Source/Core/mergeSort.js +1 -1
  138. package/Source/DataSources/PropertyArray.js +2 -2
  139. package/Source/Renderer/AutomaticUniforms.js +61 -0
  140. package/Source/Renderer/Context.js +13 -7
  141. package/Source/Renderer/Pass.js +10 -9
  142. package/Source/Renderer/UniformState.js +12 -0
  143. package/Source/Renderer/VertexArray.js +1 -1
  144. package/Source/Scene/ArcGisMapServerImageryProvider.js +1 -1
  145. package/Source/Scene/ArcGisMapService.js +1 -1
  146. package/Source/Scene/Azure2DImageryProvider.js +7 -5
  147. package/Source/Scene/BatchTable.js +2 -2
  148. package/Source/Scene/BillboardCollection.js +25 -21
  149. package/Source/Scene/BingMapsImageryProvider.js +1 -1
  150. package/Source/Scene/BoundingVolumeSemantics.js +54 -62
  151. package/Source/Scene/Cesium3DTile.js +3 -3
  152. package/Source/Scene/Cesium3DTilesVoxelProvider.js +1 -1
  153. package/Source/Scene/Cesium3DTileset.js +1 -1
  154. package/Source/Scene/EdgeFramebuffer.js +245 -0
  155. package/Source/Scene/FrameState.js +12 -0
  156. package/Source/Scene/GaussianSplat3DTileContent.js +12 -16
  157. package/Source/Scene/GaussianSplatPrimitive.js +12 -8
  158. package/Source/Scene/GaussianSplatSorter.js +2 -2
  159. package/Source/Scene/Globe.js +1 -1
  160. package/Source/Scene/GlobeSurfaceTile.js +10 -4
  161. package/Source/Scene/GltfBufferViewLoader.js +18 -0
  162. package/Source/Scene/GltfLoader.js +46 -8
  163. package/Source/Scene/Google2DImageryProvider.js +39 -27
  164. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
  165. package/Source/Scene/I3SDataProvider.js +1 -1
  166. package/Source/Scene/I3SDecoder.js +3 -3
  167. package/Source/Scene/ITwinData.js +4 -4
  168. package/Source/Scene/ImageryLayer.js +1 -1
  169. package/Source/Scene/Implicit3DTileContent.js +18 -7
  170. package/Source/Scene/ImplicitSubtree.js +3 -3
  171. package/Source/Scene/ImplicitTileset.js +2 -2
  172. package/Source/Scene/IonImageryProvider.js +15 -84
  173. package/Source/Scene/IonImageryProviderFactory.js +194 -0
  174. package/Source/Scene/LabelCollection.js +54 -36
  175. package/Source/Scene/MetadataComponentType.js +5 -5
  176. package/Source/Scene/MetadataTableProperty.js +3 -9
  177. package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
  178. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
  179. package/Source/Scene/Model/MetadataPipelineStage.js +7 -7
  180. package/Source/Scene/Model/ModelDrawCommand.js +69 -0
  181. package/Source/Scene/Model/ModelImagery.js +4 -0
  182. package/Source/Scene/Model/ModelRuntimeNode.js +2 -2
  183. package/Source/Scene/Model/ModelRuntimePrimitive.js +13 -2
  184. package/Source/Scene/Model/ModelSceneGraph.js +15 -3
  185. package/Source/Scene/Model/ModelUtility.js +0 -1
  186. package/Source/Scene/Model/NodeRenderResources.js +1 -1
  187. package/Source/Scene/Model/PrimitiveRenderResources.js +1 -1
  188. package/Source/Scene/OIT.js +11 -1
  189. package/Source/Scene/PickFramebuffer.js +13 -17
  190. package/Source/Scene/Picking.js +104 -80
  191. package/Source/Scene/QuadtreePrimitive.js +34 -26
  192. package/Source/Scene/QuadtreeTile.js +66 -46
  193. package/Source/Scene/ResourceLoaderState.js +1 -1
  194. package/Source/Scene/Scene.js +124 -12
  195. package/Source/Scene/ScreenSpaceCameraController.js +1 -1
  196. package/Source/Scene/SensorVolumePortionToDisplay.js +6 -6
  197. package/Source/Scene/SingleTileImageryProvider.js +3 -3
  198. package/Source/Scene/Terrain.js +5 -5
  199. package/Source/Scene/TileMapServiceImageryProvider.js +2 -2
  200. package/Source/Scene/UrlTemplateImageryProvider.js +1 -1
  201. package/Source/Scene/View.js +3 -0
  202. package/Source/Scene/VoxelPrimitive.js +196 -189
  203. package/Source/Scene/VoxelShape.js +2 -0
  204. package/Source/Scene/createWorldImageryAsync.js +1 -1
  205. package/Source/Shaders/BillboardCollectionFS.glsl +102 -62
  206. package/Source/Shaders/BillboardCollectionFS.js +102 -63
  207. package/Source/Shaders/BillboardCollectionVS.glsl +44 -37
  208. package/Source/Shaders/BillboardCollectionVS.js +45 -38
  209. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
  210. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  211. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
  212. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  213. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
  214. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  215. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
  216. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
  217. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
  218. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
  219. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
  220. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  221. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  222. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  223. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
  224. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  225. package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
  226. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  227. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  228. package/Source/Shaders/GlobeVS.glsl +1 -1
  229. package/Source/Shaders/GlobeVS.js +1 -1
  230. package/Source/Shaders/Model/EdgeDetectionStageFS.glsl +58 -0
  231. package/Source/Shaders/Model/EdgeDetectionStageFS.js +60 -0
  232. package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +83 -0
  233. package/Source/Shaders/Model/EdgeVisibilityStageFS.js +85 -0
  234. package/Source/Shaders/Model/ModelFS.glsl +5 -0
  235. package/Source/Shaders/Model/ModelFS.js +5 -0
  236. package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +0 -1
  237. package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
  238. package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +7 -15
  239. package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
  240. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
  241. package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
  242. package/index.d.ts +281 -27
  243. package/index.js +200 -190
  244. package/package.json +2 -1
@@ -13,7 +13,6 @@ import EncodedCartesian3 from "../Core/EncodedCartesian3.js";
13
13
  import IndexDatatype from "../Core/IndexDatatype.js";
14
14
  import CesiumMath from "../Core/Math.js";
15
15
  import Matrix4 from "../Core/Matrix4.js";
16
- import WebGLConstants from "../Core/WebGLConstants.js";
17
16
  import Buffer from "../Renderer/Buffer.js";
18
17
  import BufferUsage from "../Renderer/BufferUsage.js";
19
18
  import ContextLimits from "../Renderer/ContextLimits.js";
@@ -34,6 +33,7 @@ import SceneMode from "./SceneMode.js";
34
33
  import SDFSettings from "./SDFSettings.js";
35
34
  import TextureAtlas from "../Renderer/TextureAtlas.js";
36
35
  import VerticalOrigin from "./VerticalOrigin.js";
36
+ import Ellipsoid from "../Core/Ellipsoid.js";
37
37
 
38
38
  const SHOW_INDEX = Billboard.SHOW_INDEX;
39
39
  const POSITION_INDEX = Billboard.POSITION_INDEX;
@@ -315,6 +315,8 @@ function BillboardCollection(options) {
315
315
  ];
316
316
 
317
317
  this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints
318
+ this._coarseDepthTestDistance = Ellipsoid.default.minimumRadius / 100;
319
+ this._threePointDepthTestDistance = Ellipsoid.default.minimumRadius / 1000;
318
320
 
319
321
  this._uniforms = {
320
322
  u_atlas: () => {
@@ -323,6 +325,16 @@ function BillboardCollection(options) {
323
325
  u_highlightColor: () => {
324
326
  return this._highlightColor;
325
327
  },
328
+ // An eye-space distance, beyond which, the billboard is simply tested against a camera-facing plane at the ellipsoid's center,
329
+ // rather than against a depth texture. Note: only if the disableDepthTestingDistance property permits.
330
+ u_coarseDepthTestDistance: () => {
331
+ return this._coarseDepthTestDistance;
332
+ },
333
+ // Within this distance, if the billboard is clamped to the ground, we'll depth-test 3 key points.
334
+ // If any key point is visible, the whole billboard will be visible.
335
+ u_threePointDepthTestDistance: () => {
336
+ return this._threePointDepthTestDistance;
337
+ },
326
338
  };
327
339
 
328
340
  const scene = this._scene;
@@ -1372,9 +1384,6 @@ function writeCompressedAttribute3(
1372
1384
  const clampToGround =
1373
1385
  isHeightReferenceClamp(billboard.heightReference) &&
1374
1386
  frameState.context.depthTexture;
1375
- if (!defined(disableDepthTestDistance)) {
1376
- disableDepthTestDistance = clampToGround ? 5000.0 : 0.0;
1377
- }
1378
1387
 
1379
1388
  disableDepthTestDistance *= disableDepthTestDistance;
1380
1389
  if (clampToGround || disableDepthTestDistance > 0.0) {
@@ -2030,8 +2039,7 @@ BillboardCollection.prototype.update = function (frameState) {
2030
2039
  ) {
2031
2040
  this._rsOpaque = RenderState.fromCache({
2032
2041
  depthTest: {
2033
- enabled: true,
2034
- func: WebGLConstants.LESS,
2042
+ enabled: false,
2035
2043
  },
2036
2044
  depthMask: true,
2037
2045
  });
@@ -2042,7 +2050,6 @@ BillboardCollection.prototype.update = function (frameState) {
2042
2050
  // If OPAQUE_AND_TRANSLUCENT is in use, only the opaque pass gets the benefit of the depth buffer,
2043
2051
  // not the translucent pass. Otherwise, if the TRANSLUCENT pass is on its own, it turns on
2044
2052
  // a depthMask in lieu of full depth sorting (because it has opaque-ish fragments that look bad in OIT).
2045
- // When the TRANSLUCENT depth mask is in use, label backgrounds require the depth func to be LEQUAL.
2046
2053
  const useTranslucentDepthMask =
2047
2054
  this._blendOption === BlendOption.TRANSLUCENT;
2048
2055
 
@@ -2052,10 +2059,7 @@ BillboardCollection.prototype.update = function (frameState) {
2052
2059
  ) {
2053
2060
  this._rsTranslucent = RenderState.fromCache({
2054
2061
  depthTest: {
2055
- enabled: true,
2056
- func: useTranslucentDepthMask
2057
- ? WebGLConstants.LEQUAL
2058
- : WebGLConstants.LESS,
2062
+ enabled: false,
2059
2063
  },
2060
2064
  depthMask: useTranslucentDepthMask,
2061
2065
  blending: BlendingState.ALPHA_BLEND,
@@ -2141,9 +2145,9 @@ BillboardCollection.prototype.update = function (frameState) {
2141
2145
  }
2142
2146
  if (this._shaderClampToGround) {
2143
2147
  if (supportVSTextureReads) {
2144
- vs.defines.push("VERTEX_DEPTH_CHECK");
2148
+ vs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
2145
2149
  } else {
2146
- vs.defines.push("FRAGMENT_DEPTH_CHECK");
2150
+ vs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
2147
2151
  }
2148
2152
  }
2149
2153
 
@@ -2162,9 +2166,9 @@ BillboardCollection.prototype.update = function (frameState) {
2162
2166
  });
2163
2167
  if (this._shaderClampToGround) {
2164
2168
  if (supportVSTextureReads) {
2165
- fs.defines.push("VERTEX_DEPTH_CHECK");
2169
+ fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
2166
2170
  } else {
2167
- fs.defines.push("FRAGMENT_DEPTH_CHECK");
2171
+ fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
2168
2172
  }
2169
2173
  }
2170
2174
 
@@ -2187,9 +2191,9 @@ BillboardCollection.prototype.update = function (frameState) {
2187
2191
  });
2188
2192
  if (this._shaderClampToGround) {
2189
2193
  if (supportVSTextureReads) {
2190
- fs.defines.push("VERTEX_DEPTH_CHECK");
2194
+ fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
2191
2195
  } else {
2192
- fs.defines.push("FRAGMENT_DEPTH_CHECK");
2196
+ fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
2193
2197
  }
2194
2198
  }
2195
2199
  if (this._sdf) {
@@ -2212,9 +2216,9 @@ BillboardCollection.prototype.update = function (frameState) {
2212
2216
  });
2213
2217
  if (this._shaderClampToGround) {
2214
2218
  if (supportVSTextureReads) {
2215
- fs.defines.push("VERTEX_DEPTH_CHECK");
2219
+ fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
2216
2220
  } else {
2217
- fs.defines.push("FRAGMENT_DEPTH_CHECK");
2221
+ fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
2218
2222
  }
2219
2223
  }
2220
2224
  if (this._sdf) {
@@ -2237,9 +2241,9 @@ BillboardCollection.prototype.update = function (frameState) {
2237
2241
  });
2238
2242
  if (this._shaderClampToGround) {
2239
2243
  if (supportVSTextureReads) {
2240
- fs.defines.push("VERTEX_DEPTH_CHECK");
2244
+ fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
2241
2245
  } else {
2242
- fs.defines.push("FRAGMENT_DEPTH_CHECK");
2246
+ fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
2243
2247
  }
2244
2248
  }
2245
2249
  if (this._sdf) {
@@ -457,7 +457,7 @@ Object.defineProperties(BingMapsImageryProvider.prototype, {
457
457
  /**
458
458
  * Creates an {@link ImageryProvider} which provides tiled imagery using the Bing Maps Imagery REST API.
459
459
  *
460
- * @param {Resource|String} url The url of the Bing Maps server hosting the imagery.
460
+ * @param {Resource|string} url The url of the Bing Maps server hosting the imagery.
461
461
  * @param {BingMapsImageryProvider.ConstructorOptions} options Object describing initialization options
462
462
  * @returns {Promise<BingMapsImageryProvider>} A promise that resolves to the created BingMapsImageryProvider
463
463
  *
@@ -12,89 +12,85 @@ const BoundingVolumeSemantics = {};
12
12
 
13
13
  /**
14
14
  * Parse the bounding volume-related semantics such as
15
- * <code>TILE_BOUNDING_BOX</code> and <code>CONTENT_BOUNDING_REGION</code> from
16
- * implicit tile metadata. Results are returned as a JSON object for use when
17
- * transcoding tiles (see {@link Implicit3DTileContent}).
15
+ * <code>TILE_BOUNDING_BOX</code> and <code>CONTENT_BOUNDING_BOX</code> from
16
+ * implicit tile or content metadata. Results are returned as a JSON object for
17
+ * use when transcoding tiles (see {@link Implicit3DTileContent}).
18
18
  * <p>
19
19
  * Bounding volumes are checked in the order box, region, then sphere. Only
20
20
  * the first valid bounding volume is returned.
21
21
  * </p>
22
+ * <p>
23
+ * This handles both tile and content bounding volumes, as the only difference
24
+ * is the prefix. e.g. <code>TILE_BOUNDING_BOX</code> and
25
+ * <code>CONTENT_BOUNDING_BOX</code> have the same memory layout.
26
+ * </p>
22
27
  *
23
28
  * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/Semantics|3D Metadata Semantic Reference} for the various bounding volumes and minimum/maximum heights.
24
29
  *
25
- * @param {TileMetadata} tileMetadata The metadata object for looking up values by semantic. In practice, this will typically be a {@link ImplicitMetadataView}
26
- * @return {object} An object containing a <code>tile</code> property and a <code>content</code> property. These contain the bounding volume, and any minimum or maximum height.
30
+ * @param {string} prefix Either "TILE" or "CONTENT"
31
+ * @param {TileMetadata|ContentMetadata} metadata The metadata object for looking up values by semantic. In practice, this will typically be a {@link ImplicitMetadataView}
32
+ * @return {object} An object containing the bounding volume, and any minimum or maximum height.
27
33
  *
28
34
  * @private
29
35
  * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
30
36
  */
31
37
  BoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function (
32
- tileMetadata,
38
+ prefix,
39
+ metadata,
33
40
  ) {
34
41
  //>>includeStart('debug', pragmas.debug);
35
- Check.typeOf.object("tileMetadata", tileMetadata);
42
+ Check.typeOf.string("prefix", prefix);
43
+ if (prefix !== "TILE" && prefix !== "CONTENT") {
44
+ throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
45
+ }
46
+ Check.typeOf.object("metadata", metadata);
36
47
  //>>includeEnd('debug');
37
48
 
38
49
  return {
39
- tile: {
40
- boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
41
- "TILE",
42
- tileMetadata,
43
- ),
44
- minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
45
- "TILE",
46
- tileMetadata,
47
- ),
48
- maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
49
- "TILE",
50
- tileMetadata,
51
- ),
52
- },
53
- content: {
54
- boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
55
- "CONTENT",
56
- tileMetadata,
57
- ),
58
- minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
59
- "CONTENT",
60
- tileMetadata,
61
- ),
62
- maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
63
- "CONTENT",
64
- tileMetadata,
65
- ),
66
- },
50
+ boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
51
+ prefix,
52
+ metadata,
53
+ ),
54
+ minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
55
+ prefix,
56
+ metadata,
57
+ ),
58
+ maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
59
+ prefix,
60
+ metadata,
61
+ ),
67
62
  };
68
63
  };
69
64
 
70
65
  /**
71
- * Parse the bounding volume from a tile metadata. If the metadata specify
72
- * multiple bounding volumes, only the first one is returned. Bounding volumes
73
- * are checked in the order box, region, then sphere.
74
- *
66
+ * Parse the bounding volume from tile or content metadata. If the metadata
67
+ * specify multiple bounding volumes, only the first one is returned. Bounding
68
+ * volumes are checked in the order box, region, then sphere.
69
+ * <p>
75
70
  * This handles both tile and content bounding volumes, as the only difference
76
71
  * is the prefix. e.g. <code>TILE_BOUNDING_BOX</code> and
77
72
  * <code>CONTENT_BOUNDING_BOX</code> have the same memory layout.
73
+ * </p>
78
74
  *
79
75
  * @param {string} prefix Either "TILE" or "CONTENT"
80
- * @param {TileMetadata} tileMetadata The tileMetadata for looking up values
81
- * @return {object} An object representing the JSON description of the tile metadata
76
+ * @param {TileMetadata|ContentMetadata} metadata The metadata for looking up values
77
+ * @return {object} An object representing the JSON description of the tile or content bounding volume
82
78
  * @private
83
79
  */
84
80
  BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
85
81
  prefix,
86
- tileMetadata,
82
+ metadata,
87
83
  ) {
88
84
  //>>includeStart('debug', pragmas.debug);
89
85
  Check.typeOf.string("prefix", prefix);
90
86
  if (prefix !== "TILE" && prefix !== "CONTENT") {
91
87
  throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
92
88
  }
93
- Check.typeOf.object("tileMetadata", tileMetadata);
89
+ Check.typeOf.object("metadata", metadata);
94
90
  //>>includeEnd('debug');
95
91
 
96
92
  const boundingBoxSemantic = `${prefix}_BOUNDING_BOX`;
97
- const boundingBox = tileMetadata.getPropertyBySemantic(boundingBoxSemantic);
93
+ const boundingBox = metadata.getPropertyBySemantic(boundingBoxSemantic);
98
94
 
99
95
  if (defined(boundingBox)) {
100
96
  return {
@@ -103,9 +99,7 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
103
99
  }
104
100
 
105
101
  const boundingRegionSemantic = `${prefix}_BOUNDING_REGION`;
106
- const boundingRegion = tileMetadata.getPropertyBySemantic(
107
- boundingRegionSemantic,
108
- );
102
+ const boundingRegion = metadata.getPropertyBySemantic(boundingRegionSemantic);
109
103
 
110
104
  if (defined(boundingRegion)) {
111
105
  return {
@@ -114,9 +108,7 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
114
108
  }
115
109
 
116
110
  const boundingSphereSemantic = `${prefix}_BOUNDING_SPHERE`;
117
- const boundingSphere = tileMetadata.getPropertyBySemantic(
118
- boundingSphereSemantic,
119
- );
111
+ const boundingSphere = metadata.getPropertyBySemantic(boundingSphereSemantic);
120
112
 
121
113
  if (defined(boundingSphere)) {
122
114
  // ARRAY with 4 elements is automatically converted to a Cartesian4
@@ -129,49 +121,49 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
129
121
  };
130
122
 
131
123
  /**
132
- * Parse the minimum height from tile metadata. This is used for making tighter
133
- * quadtree bounds for implicit tiling. This works for both
124
+ * Parse the minimum height from tile or content metadata. This is used for making
125
+ * tighter quadtree bounds for implicit tiling. This works for both
134
126
  * <code>TILE_MINIMUM_HEIGHT</code> and <code>CONTENT_MINIMUM_HEIGHT</code>
135
127
  *
136
128
  * @param {string} prefix Either "TILE" or "CONTENT"
137
- * @param {TileMetadata} tileMetadata The tileMetadata for looking up values
129
+ * @param {TileMetadata|ContentMetadata} metadata The metadata for looking up values
138
130
  * @return {number} The minimum height
139
131
  * @private
140
132
  */
141
- BoundingVolumeSemantics._parseMinimumHeight = function (prefix, tileMetadata) {
133
+ BoundingVolumeSemantics._parseMinimumHeight = function (prefix, metadata) {
142
134
  //>>includeStart('debug', pragmas.debug);
143
135
  Check.typeOf.string("prefix", prefix);
144
136
  if (prefix !== "TILE" && prefix !== "CONTENT") {
145
137
  throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
146
138
  }
147
- Check.typeOf.object("tileMetadata", tileMetadata);
139
+ Check.typeOf.object("metadata", metadata);
148
140
  //>>includeEnd('debug');
149
141
 
150
142
  const minimumHeightSemantic = `${prefix}_MINIMUM_HEIGHT`;
151
- return tileMetadata.getPropertyBySemantic(minimumHeightSemantic);
143
+ return metadata.getPropertyBySemantic(minimumHeightSemantic);
152
144
  };
153
145
 
154
146
  /**
155
- * Parse the maximum height from tile metadata. This is used for making tighter
156
- * quadtree bounds for implicit tiling. This works for both
147
+ * Parse the maximum height from tile or content metadata. This is used for
148
+ * making tighter quadtree bounds for implicit tiling. This works for both
157
149
  * <code>TILE_MAXIMUM_HEIGHT</code> and <code>CONTENT_MAXIMUM_HEIGHT</code>
158
150
  *
159
151
  * @param {string} prefix Either "TILE" or "CONTENT"
160
- * @param {TileMetadata} tileMetadata The tileMetadata for looking up values
152
+ * @param {TileMetadata|ContentMetadata} metadata The metadata for looking up values
161
153
  * @return {number} The maximum height
162
154
  * @private
163
155
  */
164
- BoundingVolumeSemantics._parseMaximumHeight = function (prefix, tileMetadata) {
156
+ BoundingVolumeSemantics._parseMaximumHeight = function (prefix, metadata) {
165
157
  //>>includeStart('debug', pragmas.debug);
166
158
  Check.typeOf.string("prefix", prefix);
167
159
  if (prefix !== "TILE" && prefix !== "CONTENT") {
168
160
  throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
169
161
  }
170
- Check.typeOf.object("tileMetadata", tileMetadata);
162
+ Check.typeOf.object("metadata", metadata);
171
163
  //>>includeEnd('debug');
172
164
 
173
165
  const maximumHeightSemantic = `${prefix}_MAXIMUM_HEIGHT`;
174
- return tileMetadata.getPropertyBySemantic(maximumHeightSemantic);
166
+ return metadata.getPropertyBySemantic(maximumHeightSemantic);
175
167
  };
176
168
 
177
169
  export default BoundingVolumeSemantics;
@@ -795,7 +795,7 @@ const scratchCartesian = new Cartesian3();
795
795
  * @private
796
796
  * @param {Cesium3DTile} tile
797
797
  * @param {FrameState} frameState
798
- * @returns {Boolean}
798
+ * @returns {boolean}
799
799
  */
800
800
  function isPriorityDeferred(tile, frameState) {
801
801
  const { tileset, boundingSphere } = tile;
@@ -905,7 +905,7 @@ const scratchJulianDate = new JulianDate();
905
905
  *
906
906
  * @private
907
907
  * @param {FrameState} frameState
908
- * @param {Boolean} useParentGeometricError
908
+ * @param {boolean} useParentGeometricError
909
909
  * @param {number} progressiveResolutionHeightFraction
910
910
  */
911
911
  Cesium3DTile.prototype.getScreenSpaceError = function (
@@ -964,7 +964,7 @@ Cesium3DTile.prototype.getScreenSpaceError = function (
964
964
  * @private
965
965
  * @param {Cesium3DTileset} tileset
966
966
  * @param {Cesium3DTile} tile
967
- * @returns {Boolean}
967
+ * @returns {boolean}
968
968
  */
969
969
  function isPriorityProgressiveResolution(tileset, tile) {
970
970
  if (
@@ -25,7 +25,7 @@ import CesiumMath from "../Core/Math.js";
25
25
  import Quaternion from "../Core/Quaternion.js";
26
26
 
27
27
  /**
28
- * @typedef {Object} Cesium3DTilesVoxelProvider.ConstructorOptions
28
+ * @typedef {object} Cesium3DTilesVoxelProvider.ConstructorOptions
29
29
  *
30
30
  * Initialization options for the Cesium3DTilesVoxelProvider constructor
31
31
  *
@@ -65,7 +65,7 @@ import DynamicEnvironmentMapManager from "./DynamicEnvironmentMapManager.js";
65
65
  import ImageryLayerCollection from "./ImageryLayerCollection.js";
66
66
 
67
67
  /**
68
- * @typedef {Object} Cesium3DTileset.ConstructorOptions
68
+ * @typedef {object} Cesium3DTileset.ConstructorOptions
69
69
  *
70
70
  * Initialization options for the Cesium3DTileset constructor
71
71
  *
@@ -0,0 +1,245 @@
1
+ import defined from "../Core/defined.js";
2
+ import destroyObject from "../Core/destroyObject.js";
3
+ import PixelFormat from "../Core/PixelFormat.js";
4
+ import Color from "../Core/Color.js";
5
+ import PixelDatatype from "../Renderer/PixelDatatype.js";
6
+ import FramebufferManager from "../Renderer/FramebufferManager.js";
7
+ import ClearCommand from "../Renderer/ClearCommand.js";
8
+
9
+ /**
10
+ * Creates and manages framebuffers for edge visibility rendering.
11
+ *
12
+ * @param {Object} options Object with the following properties:
13
+ *
14
+ * @alias EdgeFramebuffer
15
+ * @constructor
16
+ *
17
+ * @private
18
+ */
19
+ function EdgeFramebuffer(options) {
20
+ options = options || {};
21
+
22
+ // Create framebuffer manager with multiple render targets (MRT)
23
+ // Color attachment 0: edge color output (visualization / debug)
24
+ // Color attachment 1: R: edge type, G: featureId (metadata / ids)
25
+ // Color attachment 2: packed depth (czm_packDepth) for edge fragments
26
+ this._framebufferManager = new FramebufferManager({
27
+ colorAttachmentsLength: 3, // MRT: Color + ID + Depth (packed RGBA)
28
+ createColorAttachments: true,
29
+ depthStencil: true,
30
+ supportsDepthTexture: true,
31
+ color: true,
32
+ });
33
+
34
+ this._framebuffer = undefined;
35
+ this._colorTexture = undefined;
36
+ this._idTexture = undefined;
37
+ this._depthTexture = undefined; // packed depth color attachment (location = 2)
38
+ this._depthStencilTexture = undefined;
39
+
40
+ this._clearCommand = new ClearCommand({
41
+ color: new Color(0.0, 0.0, 0.0, 0.0),
42
+ depth: 1.0,
43
+ stencil: 0,
44
+ owner: this,
45
+ });
46
+ }
47
+
48
+ Object.defineProperties(EdgeFramebuffer.prototype, {
49
+ /**
50
+ * Gets the framebuffer for edge rendering.
51
+ * @memberof EdgeFramebuffer.prototype
52
+ * @type {Framebuffer}
53
+ * @readonly
54
+ */
55
+ framebuffer: {
56
+ get: function () {
57
+ return this._framebuffer;
58
+ },
59
+ },
60
+
61
+ /**
62
+ * Gets the color texture.
63
+ * @memberof EdgeFramebuffer.prototype
64
+ * @type {Texture}
65
+ * @readonly
66
+ */
67
+ colorTexture: {
68
+ get: function () {
69
+ return this._colorTexture;
70
+ },
71
+ },
72
+
73
+ /**
74
+ * Gets the ID texture.
75
+ * @memberof EdgeFramebuffer.prototype
76
+ * @type {Texture}
77
+ * @readonly
78
+ */
79
+ idTexture: {
80
+ get: function () {
81
+ return this._idTexture;
82
+ },
83
+ },
84
+
85
+ /**
86
+ * Gets the packed depth texture written during the edge pass.
87
+ * @memberof EdgeFramebuffer.prototype
88
+ * @type {Texture}
89
+ * @readonly
90
+ */
91
+ depthTexture: {
92
+ get: function () {
93
+ return this._depthTexture;
94
+ },
95
+ },
96
+
97
+ /**
98
+ * Gets the depth-stencil texture.
99
+ * @memberof EdgeFramebuffer.prototype
100
+ * @type {Texture}
101
+ * @readonly
102
+ */
103
+ depthStencilTexture: {
104
+ get: function () {
105
+ return this._depthStencilTexture;
106
+ },
107
+ },
108
+ });
109
+
110
+ /**
111
+ * Updates the framebuffer.
112
+ *
113
+ * @param {Context} context The context.
114
+ * @param {Viewport} viewport The viewport.
115
+ * @param {boolean} hdr Whether HDR is enabled.
116
+ * @param {Texture} [existingColorTexture] Optional existing color texture to reuse.
117
+ * @param {Texture} [existingDepthTexture] Optional existing depth texture to reuse.
118
+ *
119
+ * @returns {boolean} True if the framebuffer was updated; otherwise, false.
120
+ */
121
+ EdgeFramebuffer.prototype.update = function (
122
+ context,
123
+ viewport,
124
+ hdr,
125
+ existingColorTexture,
126
+ existingDepthTexture,
127
+ ) {
128
+ const width = viewport.width;
129
+ const height = viewport.height;
130
+
131
+ const pixelDatatype = hdr
132
+ ? context.halfFloatingPointTexture
133
+ ? PixelDatatype.HALF_FLOAT
134
+ : PixelDatatype.FLOAT
135
+ : PixelDatatype.UNSIGNED_BYTE;
136
+
137
+ const changed = this._framebufferManager.update(
138
+ context,
139
+ width,
140
+ height,
141
+ 1, // No MSAA
142
+ pixelDatatype,
143
+ PixelFormat.RGBA,
144
+ );
145
+
146
+ // Always assign framebuffer if FramebufferManager has one
147
+ if (this._framebufferManager.framebuffer) {
148
+ this._framebuffer = this._framebufferManager.framebuffer;
149
+
150
+ // Get the textures from the framebuffer manager or use existing ones
151
+ this._colorTexture = defined(existingColorTexture)
152
+ ? existingColorTexture
153
+ : this._framebufferManager.getColorTexture(0); // Color attachment 0
154
+ this._idTexture = this._framebufferManager.getColorTexture(1); // Color attachment 1: ID texture
155
+ this._depthTexture = this._framebufferManager.getColorTexture(2); // Color attachment 2: packed depth
156
+ this._depthStencilTexture = defined(existingDepthTexture)
157
+ ? existingDepthTexture
158
+ : this._framebufferManager.getDepthStencilTexture();
159
+ }
160
+
161
+ return changed;
162
+ };
163
+
164
+ /**
165
+ * Clears the framebuffer using ClearCommand.
166
+ * @deprecated Use getClearCommand() instead for proper MRT clearing.
167
+ *
168
+ * @param {Context} context The context.
169
+ * @param {PassState} passState The pass state.
170
+ * @param {Color} clearColor The clear color.
171
+ */
172
+ EdgeFramebuffer.prototype.clear = function (context, passState, clearColor) {
173
+ const clearCommand = this.getClearCommand(clearColor);
174
+ clearCommand.execute(context, passState);
175
+ };
176
+
177
+ /**
178
+ * Gets the clear command for this framebuffer.
179
+ *
180
+ * @param {Color} [clearColor] The clear color to use. If undefined, uses the default.
181
+ * @returns {ClearCommand} The clear command.
182
+ */
183
+ EdgeFramebuffer.prototype.getClearCommand = function (clearColor) {
184
+ this._clearCommand.framebuffer = this._framebuffer;
185
+
186
+ if (defined(clearColor)) {
187
+ Color.clone(clearColor, this._clearCommand.color);
188
+ }
189
+
190
+ return this._clearCommand;
191
+ };
192
+
193
+ /**
194
+ * Gets the edge framebuffer, creating it if necessary.
195
+ *
196
+ * @param {Context} context The context.
197
+ * @param {Viewport} viewport The viewport.
198
+ * @param {Texture} [existingColorTexture] Optional existing color texture to reuse.
199
+ * @param {Texture} [existingDepthTexture] Optional existing depth texture to reuse.
200
+ *
201
+ * @returns {Framebuffer} The edge framebuffer.
202
+ */
203
+ EdgeFramebuffer.prototype.getFramebuffer = function (
204
+ context,
205
+ viewport,
206
+ existingColorTexture,
207
+ existingDepthTexture,
208
+ ) {
209
+ this.update(
210
+ context,
211
+ viewport,
212
+ false,
213
+ existingColorTexture,
214
+ existingDepthTexture,
215
+ );
216
+ return this._framebuffer;
217
+ };
218
+
219
+ /**
220
+ * Returns true if this object was destroyed; otherwise, false.
221
+ *
222
+ * @returns {boolean} True if this object was destroyed; otherwise, false.
223
+ */
224
+ EdgeFramebuffer.prototype.isDestroyed = function () {
225
+ return false;
226
+ };
227
+
228
+ /**
229
+ * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
230
+ * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
231
+ * <br /><br />
232
+ * Once an object is destroyed, it should not be used; calling any function other than
233
+ * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
234
+ * assign the return value (<code>undefined</code>) to the object as done in the example.
235
+ *
236
+ * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
237
+ */
238
+ EdgeFramebuffer.prototype.destroy = function () {
239
+ this._framebufferManager =
240
+ this._framebufferManager && this._framebufferManager.destroy();
241
+ this._clearCommand = undefined;
242
+ return destroyObject(this);
243
+ };
244
+
245
+ export default EdgeFramebuffer;
@@ -454,6 +454,18 @@ function FrameState(context, creditDisplay, jobScheduler) {
454
454
  * @type {PickedMetadataInfo|undefined}
455
455
  */
456
456
  this.pickedMetadataInfo = undefined;
457
+
458
+ /**
459
+ * Internal toggle indicating that at least one primitive for this frame requested
460
+ * edge visibility rendering (EXT_mesh_primitive_edge_visibility). This allows
461
+ * lazy allocation/activation of the edge MRT without storing a Scene reference
462
+ * on the frame state (avoids passing entire Scene through internal APIs).
463
+ * Set by model pipeline stages when they encounter edge visibility data.
464
+ * Consumed by Scene to flip its _enableEdgeVisibility flag.
465
+ * @type {boolean}
466
+ * @private
467
+ */
468
+ this.edgeVisibilityRequested = false;
457
469
  }
458
470
 
459
471
  /**