@cesium/engine 13.1.0 → 15.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 (183) hide show
  1. package/Build/Workers/{chunk-APCS5YJI.js → chunk-25TOENEE.js} +7 -7
  2. package/Build/Workers/{chunk-FNCXBBCF.js → chunk-2AVIUB5H.js} +2 -2
  3. package/Build/Workers/{chunk-OZTFRHA2.js → chunk-3JZGPJMZ.js} +6 -6
  4. package/Build/Workers/{chunk-5JY4LYO3.js → chunk-3LHBH4TC.js} +7 -7
  5. package/Build/Workers/{chunk-MGABCOOH.js → chunk-3LZF23RY.js} +6 -6
  6. package/Build/Workers/{chunk-AXYZUG4N.js → chunk-5S2B46UQ.js} +1 -1
  7. package/Build/Workers/{chunk-2SRHVCFD.js → chunk-67ONR44K.js} +6 -6
  8. package/Build/Workers/{chunk-PBJQFLKS.js → chunk-6EDBC234.js} +11 -11
  9. package/Build/Workers/{chunk-GSLKQJM2.js → chunk-6EV4VOET.js} +10 -10
  10. package/Build/Workers/{chunk-OGRXNUR2.js → chunk-7ITUZTFH.js} +1 -1
  11. package/Build/Workers/{chunk-IP7F2MVW.js → chunk-ARVZCY6X.js} +7 -7
  12. package/Build/Workers/{chunk-EYZFEJX3.js → chunk-B2UQN3DH.js} +6 -6
  13. package/Build/Workers/{chunk-WE4KF4AM.js → chunk-B2Y4ZS6X.js} +9 -9
  14. package/Build/Workers/{chunk-DWIKWWEE.js → chunk-BD2TPFGC.js} +5 -5
  15. package/Build/Workers/{chunk-5ICYLS6B.js → chunk-CHX2K5AC.js} +10 -10
  16. package/Build/Workers/{chunk-NQDKNE7V.js → chunk-CJGVEABL.js} +13 -13
  17. package/Build/Workers/{chunk-B34JXFHF.js → chunk-DYJHEP3B.js} +5 -5
  18. package/Build/Workers/{chunk-J7BMSSY7.js → chunk-E3H7AVMK.js} +13 -13
  19. package/Build/Workers/{chunk-TOHDFUJM.js → chunk-EZNAJPP5.js} +4 -4
  20. package/Build/Workers/{chunk-K62EHZFT.js → chunk-F7ZI463G.js} +15 -15
  21. package/Build/Workers/{chunk-EJ5DT5BP.js → chunk-FMZ5CX6V.js} +1 -1
  22. package/Build/Workers/{chunk-OARMSJUU.js → chunk-FRAWHNSR.js} +2 -2
  23. package/Build/Workers/{chunk-S3UM4OKP.js → chunk-GGV2XJHE.js} +7 -7
  24. package/Build/Workers/{chunk-SAKQO5NX.js → chunk-GK4QU6QI.js} +2 -2
  25. package/Build/Workers/{chunk-LFUFGHL3.js → chunk-HYPB7FAV.js} +10 -10
  26. package/Build/Workers/{chunk-3SCCWLZS.js → chunk-I4HO2ED2.js} +9 -9
  27. package/Build/Workers/{chunk-K6SQV4IS.js → chunk-IGINOLDX.js} +6 -6
  28. package/Build/Workers/{chunk-IXNXKVOB.js → chunk-ISQSYLZY.js} +4 -4
  29. package/Build/Workers/{chunk-PM76TX2X.js → chunk-JZAMRL5I.js} +6 -6
  30. package/Build/Workers/{chunk-CBE4HRBH.js → chunk-K5G2WELR.js} +7 -7
  31. package/Build/Workers/{chunk-EHGQQA7C.js → chunk-L5SO4Y5V.js} +1 -1
  32. package/Build/Workers/{chunk-M2AA2ARJ.js → chunk-LCMJQVIF.js} +11 -11
  33. package/Build/Workers/{chunk-HI73PIPQ.js → chunk-MWJW37I7.js} +2 -2
  34. package/Build/Workers/{chunk-WAJNX74N.js → chunk-NAGMYRDW.js} +27 -20
  35. package/Build/Workers/{chunk-WUIDEXAN.js → chunk-OYO6TKMU.js} +7 -7
  36. package/Build/Workers/{chunk-YVGU235V.js → chunk-PUTA3AE2.js} +4 -4
  37. package/Build/Workers/{chunk-ZWSWJYJP.js → chunk-Q5BHMNKU.js} +13 -13
  38. package/Build/Workers/{chunk-LQT2ZK7D.js → chunk-QTEX3Y4V.js} +17 -17
  39. package/Build/Workers/{chunk-UBAHTE4Q.js → chunk-QZKN2RXM.js} +1 -1
  40. package/Build/Workers/{chunk-T34EOLFR.js → chunk-RO2Z3LCR.js} +14 -14
  41. package/Build/Workers/{chunk-PTFIVVLX.js → chunk-RRN6LRDX.js} +12 -12
  42. package/Build/Workers/{chunk-B6IJY6AN.js → chunk-SLIA3GQP.js} +7 -7
  43. package/Build/Workers/{chunk-GIOZHX7U.js → chunk-TFCOEX3W.js} +2 -2
  44. package/Build/Workers/{chunk-KRVALCCI.js → chunk-TU6ZXHVU.js} +5 -5
  45. package/Build/Workers/{chunk-54I6VSRP.js → chunk-VJ2PDF64.js} +6 -6
  46. package/Build/Workers/{chunk-BMFWWTD7.js → chunk-VMVPONIV.js} +5 -5
  47. package/Build/Workers/{chunk-CNPP6TQ2.js → chunk-WPXU45PH.js} +4 -4
  48. package/Build/Workers/{chunk-2ONAV62A.js → chunk-XDHM4G3P.js} +7 -7
  49. package/Build/Workers/{chunk-KO232FLP.js → chunk-XED3RXKO.js} +2 -2
  50. package/Build/Workers/{chunk-5I3LPAS7.js → chunk-YNYCGTQH.js} +5 -5
  51. package/Build/Workers/{chunk-THDHWSEJ.js → chunk-Z4SI54EB.js} +4 -4
  52. package/Build/Workers/{chunk-R2KGFZBA.js → chunk-ZVDLC3T4.js} +13 -13
  53. package/Build/Workers/combineGeometry.js +22 -22
  54. package/Build/Workers/createBoxGeometry.js +16 -16
  55. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  56. package/Build/Workers/createCircleGeometry.js +24 -24
  57. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  58. package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
  59. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  60. package/Build/Workers/createCorridorGeometry.js +27 -27
  61. package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
  62. package/Build/Workers/createCylinderGeometry.js +18 -18
  63. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  64. package/Build/Workers/createEllipseGeometry.js +24 -24
  65. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  66. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  67. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  68. package/Build/Workers/createFrustumGeometry.js +16 -16
  69. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  70. package/Build/Workers/createGeometry.js +22 -22
  71. package/Build/Workers/createGroundPolylineGeometry.js +20 -20
  72. package/Build/Workers/createPlaneGeometry.js +14 -14
  73. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  74. package/Build/Workers/createPolygonGeometry.js +30 -30
  75. package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
  76. package/Build/Workers/createPolylineGeometry.js +23 -23
  77. package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
  78. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
  79. package/Build/Workers/createRectangleGeometry.js +25 -25
  80. package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
  81. package/Build/Workers/createSimplePolylineGeometry.js +21 -21
  82. package/Build/Workers/createSphereGeometry.js +17 -17
  83. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  84. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  85. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  86. package/Build/Workers/createVectorTileGeometries.js +22 -22
  87. package/Build/Workers/createVectorTilePoints.js +12 -12
  88. package/Build/Workers/createVectorTilePolygons.js +20 -20
  89. package/Build/Workers/createVectorTilePolylines.js +13 -13
  90. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  91. package/Build/Workers/createVerticesFromHeightmap.js +20 -20
  92. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  93. package/Build/Workers/createWallGeometry.js +22 -22
  94. package/Build/Workers/createWallOutlineGeometry.js +21 -21
  95. package/Build/Workers/decodeDraco.js +15 -14
  96. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  97. package/Build/Workers/decodeI3S.js +10 -10
  98. package/Build/Workers/transcodeKTX2.js +50 -43
  99. package/Build/Workers/transferTypedArrayTest.js +1 -1
  100. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  101. package/Source/Core/Color.js +3 -3
  102. package/Source/Core/Credit.js +3 -3
  103. package/Source/Core/DistanceDisplayCondition.js +3 -3
  104. package/Source/Core/EllipsoidRhumbLine.js +1 -1
  105. package/Source/Core/Ion.js +1 -1
  106. package/Source/Core/OrientedBoundingBox.js +2 -2
  107. package/Source/Core/PolygonGeometryLibrary.js +26 -4
  108. package/Source/Core/Spherical.js +3 -3
  109. package/Source/Core/TexturePacker.js +166 -0
  110. package/Source/Core/writeTextToCanvas.js +0 -1
  111. package/Source/DataSources/BillboardVisualizer.js +3 -3
  112. package/Source/DataSources/BoundingSphereState.js +3 -3
  113. package/Source/DataSources/DataSourceClock.js +1 -1
  114. package/Source/DataSources/DataSourceDisplay.js +5 -2
  115. package/Source/DataSources/EntityCluster.js +44 -19
  116. package/Source/Renderer/AutomaticUniforms.js +2 -2
  117. package/Source/Renderer/Context.js +0 -4
  118. package/Source/Renderer/Texture.js +6 -5
  119. package/Source/Renderer/TextureAtlas.js +802 -0
  120. package/Source/Scene/ArcGisMapService.js +1 -1
  121. package/Source/Scene/Billboard.js +87 -142
  122. package/Source/Scene/BillboardCollection.js +132 -202
  123. package/Source/Scene/BillboardLoadState.js +44 -0
  124. package/Source/Scene/BillboardTexture.js +348 -0
  125. package/Source/Scene/Camera.js +2 -2
  126. package/Source/Scene/Cesium3DTile.js +56 -28
  127. package/Source/Scene/Cesium3DTilesVoxelProvider.js +403 -132
  128. package/Source/Scene/Cesium3DTilesetStatistics.js +0 -1
  129. package/Source/Scene/ClippingPolygon.js +2 -2
  130. package/Source/Scene/Expression.js +1 -0
  131. package/Source/Scene/GltfDracoLoader.js +45 -0
  132. package/Source/Scene/GltfIndexBufferLoader.js +5 -0
  133. package/Source/Scene/GltfLoader.js +22 -9
  134. package/Source/Scene/GltfVertexBufferLoader.js +13 -0
  135. package/Source/Scene/ITwinData.js +47 -1
  136. package/Source/Scene/ImageryLayer.js +1 -1
  137. package/Source/Scene/ImplicitSubtree.js +2 -0
  138. package/Source/Scene/KeyframeNode.js +16 -2
  139. package/Source/Scene/Label.js +1 -1
  140. package/Source/Scene/LabelCollection.js +212 -193
  141. package/Source/Scene/Megatexture.js +145 -81
  142. package/Source/Scene/Model/CustomShader.js +0 -2
  143. package/Source/Scene/Model/Model.js +1 -1
  144. package/Source/Scene/Model/ModelUtility.js +5 -1
  145. package/Source/Scene/Multiple3DTileContent.js +21 -8
  146. package/Source/Scene/PointPrimitive.js +1 -1
  147. package/Source/Scene/ResourceCache.js +17 -1
  148. package/Source/Scene/Scene.js +39 -15
  149. package/Source/Scene/ScreenSpaceCameraController.js +0 -8
  150. package/Source/Scene/SpatialNode.js +4 -11
  151. package/Source/Scene/Vector3DTilePoints.js +2 -5
  152. package/Source/Scene/VoxelBoxShape.js +12 -5
  153. package/Source/Scene/VoxelCell.js +6 -5
  154. package/Source/Scene/VoxelContent.js +171 -107
  155. package/Source/Scene/VoxelCylinderShape.js +65 -58
  156. package/Source/Scene/VoxelEllipsoidShape.js +15 -5
  157. package/Source/Scene/VoxelMetadataOrder.js +12 -0
  158. package/Source/Scene/VoxelPrimitive.js +245 -53
  159. package/Source/Scene/VoxelProvider.js +44 -29
  160. package/Source/Scene/VoxelRenderResources.js +30 -7
  161. package/Source/Scene/VoxelShape.js +10 -3
  162. package/Source/Scene/VoxelTraversal.js +326 -166
  163. package/Source/Scene/WebMapTileServiceImageryProvider.js +2 -2
  164. package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -8
  165. package/Source/Scene/processVoxelProperties.js +3 -0
  166. package/Source/Shaders/GlobeFS.glsl +10 -1
  167. package/Source/Shaders/GlobeFS.js +10 -1
  168. package/Source/Shaders/PolylineCommon.glsl +1 -1
  169. package/Source/Shaders/PolylineCommon.js +1 -1
  170. package/Source/Shaders/Voxels/Megatexture.glsl +4 -16
  171. package/Source/Shaders/Voxels/Megatexture.js +4 -16
  172. package/Source/Shaders/Voxels/Octree.glsl +44 -7
  173. package/Source/Shaders/Voxels/Octree.js +44 -7
  174. package/Source/Shaders/Voxels/VoxelFS.glsl +9 -15
  175. package/Source/Shaders/Voxels/VoxelFS.js +9 -15
  176. package/Source/Shaders/Voxels/convertUvToCylinder.glsl +15 -15
  177. package/Source/Shaders/Voxels/convertUvToCylinder.js +15 -15
  178. package/Source/Widget/CesiumWidget.js +16 -10
  179. package/Source/Workers/decodeDraco.js +4 -4
  180. package/index.d.ts +321 -110
  181. package/index.js +209 -205
  182. package/package.json +2 -2
  183. package/Source/Scene/TextureAtlas.js +0 -558
@@ -0,0 +1,166 @@
1
+ import BoundingRectangle from "./BoundingRectangle.js";
2
+ import Check from "./Check.js";
3
+ import defined from "./defined.js";
4
+
5
+ /**
6
+ * @typedef {object} TexturePacker.PackableObject
7
+ * Any object, such as an <code>Image</code> with the following properties:
8
+ * @private
9
+ * @property {number} width The width of the image, or other object, usually in pixels
10
+ * @property {number} height The height of the image, or other object, usually in pixels
11
+ */
12
+
13
+ /**
14
+ * A texture atlas is recursively broken down into regions of space called nodes.
15
+ * Nodes contain either an image reference or child nodes.
16
+ * @private
17
+ * @constructor
18
+ * @param {object} options An options object with the following properties:
19
+ * @param {number} options.x The x-offset of the texture node
20
+ * @param {number} options.y The y-offset of the texture node
21
+ * @param {number} options.width The width of the texture node
22
+ * @param {number} options.height The width of the texture node
23
+ */
24
+ function TextureNode({ x, y, width, height }) {
25
+ /**
26
+ * @type {BoundingRectangle}
27
+ */
28
+ this.rectangle = new BoundingRectangle(x, y, width, height);
29
+
30
+ /**
31
+ * @type {TextureNode|undefined}
32
+ */
33
+ this.childNode1 = undefined;
34
+ /**
35
+ * @type {TextureNode|undefined}
36
+ */
37
+ this.childNode2 = undefined;
38
+
39
+ /**
40
+ * Identifier referencing an image or packed data
41
+ * @type {number|undefined}
42
+ */
43
+ this.index = undefined;
44
+ }
45
+
46
+ /**
47
+ * Typically used with {@link TextureAtlas} to calculate efficient regions of the larger areas to store images or other data. Typically, all units are specified in pixels.
48
+ * @alias TexturePacker
49
+ * @constructor
50
+ * @private
51
+ * @param {options} options Object with the following properties:
52
+ * @param {number} options.width Width of the atlas, in pixels
53
+ * @param {number} options.height Height of atlas, in pixels
54
+ * @param {number} options.borderPadding Amount of border padding, in pixels
55
+ */
56
+ function TexturePacker({ width, height, borderPadding }) {
57
+ this._width = width;
58
+ this._height = height;
59
+
60
+ this._borderPadding = borderPadding;
61
+
62
+ this._root = new TextureNode({
63
+ x: borderPadding,
64
+ y: borderPadding,
65
+ width: width - 2 * borderPadding,
66
+ height: height - 2 * borderPadding,
67
+ });
68
+ }
69
+
70
+ /**
71
+ * Inserts the given object into the next available region based on it's dimensions. Where convenient, it's most efficient to pack items largest to smallest.
72
+ * @private
73
+ * @param {number} index An identifier referencing the image or other stored data
74
+ * @param {TexturePacker.PackableObject} packableObject An object, such as an <code>Image</code>, with <code>width</code> and <code>height</code> properties in pixels.
75
+ * @returns {TextureNode|undefined} The created region, or <code>undefined</code> if there is no region large enough to accommodate the object's dimensions.
76
+ */
77
+ TexturePacker.prototype.pack = function (index, { width, height }) {
78
+ //>>includeStart('debug', pragmas.debug);
79
+ Check.typeOf.number.greaterThanOrEquals("index", index, 0);
80
+ Check.typeOf.number.greaterThanOrEquals("image.width", width, 1);
81
+ Check.typeOf.number.greaterThanOrEquals("image.height", height, 1);
82
+ //>>includeEnd('debug');
83
+
84
+ const node = this._findNode(this._root, { width, height });
85
+ if (!defined(node)) {
86
+ return;
87
+ }
88
+
89
+ node.index = index;
90
+ return node;
91
+ };
92
+
93
+ // A recursive function that finds the best place to insert
94
+ // a new image based on existing image 'nodes'.
95
+ // Inspired by: http://blackpawn.com/texts/lightmaps/default.html
96
+ TexturePacker.prototype._findNode = function (node, { width, height }) {
97
+ if (!defined(node)) {
98
+ return undefined;
99
+ }
100
+
101
+ // Leaf node
102
+ if (!defined(node.childNode1) && !defined(node.childNode2)) {
103
+ if (defined(node.index)) {
104
+ // Node already contains an image: Skip it.
105
+ return undefined;
106
+ }
107
+
108
+ const { rectangle } = node;
109
+
110
+ const nodeWidth = rectangle.width;
111
+ const nodeHeight = rectangle.height;
112
+ const widthDifference = nodeWidth - width;
113
+ const heightDifference = nodeHeight - height;
114
+
115
+ // Node is smaller than the image.
116
+ if (widthDifference < 0 || heightDifference < 0) {
117
+ return undefined;
118
+ }
119
+
120
+ // If the node is the same size as the image, return the node
121
+ if (widthDifference === 0 && heightDifference === 0) {
122
+ return node;
123
+ }
124
+
125
+ // Vertical split (childNode1 = left half, childNode2 = right half).
126
+ if (widthDifference > heightDifference) {
127
+ node.childNode1 = new TextureNode({
128
+ x: rectangle.x,
129
+ y: rectangle.y,
130
+ width,
131
+ height: nodeHeight,
132
+ });
133
+ node.childNode2 = new TextureNode({
134
+ x: rectangle.x + width,
135
+ y: rectangle.y,
136
+ width: widthDifference,
137
+ height: nodeHeight,
138
+ });
139
+
140
+ return this._findNode(node.childNode1, { width, height });
141
+ }
142
+
143
+ // Horizontal split (childNode1 = bottom half, childNode2 = top half).
144
+ node.childNode1 = new TextureNode({
145
+ x: rectangle.x,
146
+ y: rectangle.y,
147
+ width: nodeWidth,
148
+ height,
149
+ });
150
+ node.childNode2 = new TextureNode({
151
+ x: rectangle.x,
152
+ y: rectangle.y + height,
153
+ width: nodeWidth,
154
+ height: heightDifference,
155
+ });
156
+ return this._findNode(node.childNode1, { width, height });
157
+ }
158
+
159
+ // If not a leaf node
160
+ return (
161
+ this._findNode(node.childNode1, { width, height }) ||
162
+ this._findNode(node.childNode2, { width, height })
163
+ );
164
+ };
165
+
166
+ export default TexturePacker;
@@ -104,7 +104,6 @@ let imageSmoothingEnabledName;
104
104
  * @param {string} text The text to write.
105
105
  * @param {object} [options] Object with the following properties:
106
106
  * @param {string} [options.font='10px sans-serif'] The CSS font to use.
107
- * @param {string} [options.textBaseline='bottom'] The baseline of the text.
108
107
  * @param {boolean} [options.fill=true] Whether to fill the text.
109
108
  * @param {boolean} [options.stroke=false] Whether to stroke the text.
110
109
  * @param {Color} [options.fillColor=Color.WHITE] The fill color.
@@ -126,12 +126,12 @@ BillboardVisualizer.prototype.update = function (time) {
126
126
  if (!defined(billboard)) {
127
127
  billboard = cluster.getBillboard(entity);
128
128
  billboard.id = entity;
129
- billboard.image = undefined;
130
129
  item.billboard = billboard;
130
+ item.textureValue = undefined;
131
131
  }
132
132
 
133
133
  billboard.show = show;
134
- if (!defined(billboard.image) || item.textureValue !== textureValue) {
134
+ if (item.textureValue !== textureValue) {
135
135
  billboard.image = textureValue;
136
136
  item.textureValue = textureValue;
137
137
  }
@@ -233,7 +233,7 @@ BillboardVisualizer.prototype.update = function (time) {
233
233
  boundingRectangleScratch,
234
234
  );
235
235
  if (defined(subRegion)) {
236
- billboard.setImageSubRegion(billboard._imageId, subRegion);
236
+ billboard.setImageSubRegion(billboard.image, subRegion);
237
237
  }
238
238
  }
239
239
  return true;
@@ -3,7 +3,7 @@
3
3
  * @enum {number}
4
4
  * @private
5
5
  */
6
- const BoundingSphereState = {
6
+ const BoundingSphereState = Object.freeze({
7
7
  /**
8
8
  * The BoundingSphere has been computed.
9
9
  * @type BoundingSphereState
@@ -22,5 +22,5 @@ const BoundingSphereState = {
22
22
  * @constant
23
23
  */
24
24
  FAILED: 2,
25
- };
26
- export default Object.freeze(BoundingSphereState);
25
+ });
26
+ export default BoundingSphereState;
@@ -108,7 +108,7 @@ DataSourceClock.prototype.clone = function (result) {
108
108
  /**
109
109
  * Returns true if this DataSourceClock is equivalent to the other
110
110
  *
111
- * @param {DataSourceClock} other The other DataSourceClock to compare to.
111
+ * @param {DataSourceClock} [other] The other DataSourceClock to compare to.
112
112
  * @returns {boolean} <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
113
113
  */
114
114
  DataSourceClock.prototype.equals = function (other) {
@@ -330,7 +330,10 @@ DataSourceDisplay.prototype.update = function (time) {
330
330
  if (!this._ready && result) {
331
331
  this._scene.requestRender();
332
332
  }
333
- this._ready = result;
333
+
334
+ // once the DataSourceDisplay is ready it should stay ready to prevent
335
+ // entities from breaking updates when they become "un-ready"
336
+ this._ready = this._ready || result;
334
337
 
335
338
  return result;
336
339
  };
@@ -386,7 +389,7 @@ DataSourceDisplay.prototype.getBoundingSphere = function (
386
389
  Check.defined("result", result);
387
390
  //>>includeEnd('debug');
388
391
 
389
- if (!this._ready && !allowPartial) {
392
+ if (!this._ready) {
390
393
  return BoundingSphereState.PENDING;
391
394
  }
392
395
 
@@ -610,6 +610,25 @@ Object.defineProperties(EntityCluster.prototype, {
610
610
  this._clusterPoints = value;
611
611
  },
612
612
  },
613
+
614
+ /**
615
+ * Returns true when all clustered data has been rendered.
616
+ * @memberof EntityCluster.prototype
617
+ * @type {boolean}
618
+ * @readonly
619
+ * @private
620
+ */
621
+ ready: {
622
+ get: function () {
623
+ return (
624
+ !this._enabledDirty &&
625
+ !this._clusterDirty &&
626
+ (!defined(this._billboardCollection) ||
627
+ this._billboardCollection.ready) &&
628
+ (!defined(this._labelCollection) || this._labelCollection.ready)
629
+ );
630
+ },
631
+ },
613
632
  });
614
633
 
615
634
  function createGetEntity(
@@ -866,28 +885,30 @@ EntityCluster.prototype.update = function (frameState) {
866
885
  // the glyphs haven't been created so the screen space bounding boxes
867
886
  // are incorrect.
868
887
  let commandList;
888
+ const labelCollection = this._labelCollection;
869
889
  if (
870
- defined(this._labelCollection) &&
871
- this._labelCollection.length > 0 &&
872
- this._labelCollection.get(0)._glyphs.length === 0
890
+ defined(labelCollection) &&
891
+ labelCollection.length > 0 &&
892
+ !labelCollection.ready
873
893
  ) {
874
894
  commandList = frameState.commandList;
875
895
  frameState.commandList = [];
876
- this._labelCollection.update(frameState);
896
+ labelCollection.update(frameState);
877
897
  frameState.commandList = commandList;
878
898
  }
879
899
 
880
- // If clustering is enabled before the billboard collection is updated,
900
+ // If clustering is enabled before the billboard collections are updated,
881
901
  // the images haven't been added to the image atlas so the screen space bounding boxes
882
902
  // are incorrect.
903
+ const billboardCollection = this._billboardCollection;
883
904
  if (
884
- defined(this._billboardCollection) &&
885
- this._billboardCollection.length > 0 &&
886
- !defined(this._billboardCollection.get(0).width)
905
+ defined(billboardCollection) &&
906
+ billboardCollection.length > 0 &&
907
+ !billboardCollection.ready
887
908
  ) {
888
909
  commandList = frameState.commandList;
889
910
  frameState.commandList = [];
890
- this._billboardCollection.update(frameState);
911
+ billboardCollection.update(frameState);
891
912
  frameState.commandList = commandList;
892
913
  }
893
914
 
@@ -898,8 +919,12 @@ EntityCluster.prototype.update = function (frameState) {
898
919
  }
899
920
 
900
921
  if (this._clusterDirty) {
901
- this._clusterDirty = false;
902
922
  this._cluster();
923
+
924
+ // Unless all existing billboards and labels were clustered, clustering will need to execute again next frame
925
+ this._clusterDirty =
926
+ (defined(labelCollection) && !labelCollection.ready) ||
927
+ (defined(billboardCollection) && !billboardCollection.ready);
903
928
  }
904
929
 
905
930
  if (defined(this._clusterLabelCollection)) {
@@ -912,11 +937,11 @@ EntityCluster.prototype.update = function (frameState) {
912
937
  this._clusterPointCollection.update(frameState);
913
938
  }
914
939
 
915
- if (defined(this._labelCollection)) {
916
- this._labelCollection.update(frameState);
940
+ if (defined(labelCollection)) {
941
+ labelCollection.update(frameState);
917
942
  }
918
- if (defined(this._billboardCollection)) {
919
- this._billboardCollection.update(frameState);
943
+ if (defined(billboardCollection)) {
944
+ billboardCollection.update(frameState);
920
945
  }
921
946
  if (defined(this._pointCollection)) {
922
947
  this._pointCollection.update(frameState);
@@ -932,6 +957,11 @@ EntityCluster.prototype.update = function (frameState) {
932
957
  * </p>
933
958
  */
934
959
  EntityCluster.prototype.destroy = function () {
960
+ if (defined(this._removeEventListener)) {
961
+ this._removeEventListener();
962
+ this._removeEventListener = undefined;
963
+ }
964
+
935
965
  this._labelCollection =
936
966
  this._labelCollection && this._labelCollection.destroy();
937
967
  this._billboardCollection =
@@ -947,11 +977,6 @@ EntityCluster.prototype.destroy = function () {
947
977
  this._clusterPointCollection =
948
978
  this._clusterPointCollection && this._clusterPointCollection.destroy();
949
979
 
950
- if (defined(this._removeEventListener)) {
951
- this._removeEventListener();
952
- this._removeEventListener = undefined;
953
- }
954
-
955
980
  this._labelCollection = undefined;
956
981
  this._billboardCollection = undefined;
957
982
  this._pointCollection = undefined;
@@ -1488,11 +1488,11 @@ const AutomaticUniforms = {
1488
1488
  *
1489
1489
  * @example
1490
1490
  * // GLSL declaration
1491
- * uniform sampler2D czm_specularEnvironmentMaps;
1491
+ * uniform samplerCube czm_specularEnvironmentMaps;
1492
1492
  */
1493
1493
  czm_specularEnvironmentMaps: new AutomaticUniform({
1494
1494
  size: 1,
1495
- datatype: WebGLConstants.SAMPLER_2D,
1495
+ datatype: WebGLConstants.SAMPLER_CUBE,
1496
1496
  getValue: function (uniformState) {
1497
1497
  return uniformState.specularEnvironmentMaps;
1498
1498
  },
@@ -4,7 +4,6 @@ import ComponentDatatype from "../Core/ComponentDatatype.js";
4
4
  import createGuid from "../Core/createGuid.js";
5
5
  import defaultValue from "../Core/defaultValue.js";
6
6
  import defined from "../Core/defined.js";
7
- import deprecationWarning from "../Core/deprecationWarning.js";
8
7
  import destroyObject from "../Core/destroyObject.js";
9
8
  import DeveloperError from "../Core/DeveloperError.js";
10
9
  import Geometry from "../Core/Geometry.js";
@@ -1671,7 +1670,4 @@ Context.prototype.destroy = function () {
1671
1670
  return destroyObject(this);
1672
1671
  };
1673
1672
 
1674
- // Used for specs.
1675
- Context._deprecationWarning = deprecationWarning;
1676
-
1677
1673
  export default Context;
@@ -23,7 +23,7 @@ import TextureMinificationFilter from "./TextureMinificationFilter.js";
23
23
  * @property {PixelDatatype} [pixelDatatype=PixelDatatype.UNSIGNED_BYTE] The data type of each pixel.
24
24
  * @property {boolean} [flipY=true] If true, the source values will be read as if the y-axis is inverted (y=0 at the top).
25
25
  * @property {boolean} [skipColorSpaceConversion=false] If true, color space conversions will be skipped when reading the texel values.
26
- * @property {Sampler} [sampler] Information about how to sample the cubemap texture.
26
+ * @property {Sampler} [sampler] Information about how to sample the texture.
27
27
  * @property {number} [width] The pixel width of the texture. If not supplied, must be available from the source.
28
28
  * @property {number} [height] The pixel height of the texture. If not supplied, must be available from the source.
29
29
  * @property {boolean} [preMultiplyAlpha] If true, the alpha channel will be multiplied into the other channels.
@@ -704,7 +704,8 @@ Object.defineProperties(Texture.prototype, {
704
704
  * coordinates in both directions, uses linear filtering for both magnification and minification,
705
705
  * and uses a maximum anisotropy of 1.0.
706
706
  * @memberof Texture.prototype
707
- * @type {object}
707
+ * @type {Sampler}
708
+ * @private
708
709
  */
709
710
  sampler: {
710
711
  get: function () {
@@ -842,7 +843,7 @@ function setupSampler(texture, sampler) {
842
843
  * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.
843
844
  * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.
844
845
  * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.
845
- *
846
+ * @private
846
847
  * @example
847
848
  * texture.copyFrom({
848
849
  * source: {
@@ -965,7 +966,7 @@ Texture.prototype.copyFrom = function (options) {
965
966
  * @param {number} [framebufferYOffset=0] optional
966
967
  * @param {number} [width=width] optional
967
968
  * @param {number} [height=height] optional
968
- *
969
+ * @private
969
970
  * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.
970
971
  * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.
971
972
  * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.
@@ -1060,7 +1061,7 @@ Texture.prototype.copyFromFramebuffer = function (
1060
1061
 
1061
1062
  /**
1062
1063
  * @param {MipmapHint} [hint=MipmapHint.DONT_CARE] optional.
1063
- *
1064
+ * @private
1064
1065
  * @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.
1065
1066
  * @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is a compressed format.
1066
1067
  * @exception {DeveloperError} hint is invalid.