@cesium/engine 22.1.0 → 22.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 (216) hide show
  1. package/Build/Workers/{chunk-YZWA5B4R.js → chunk-2MLJ46ZZ.js} +13 -13
  2. package/Build/Workers/{chunk-GKWOUMYA.js → chunk-4BBANFU6.js} +1 -1
  3. package/Build/Workers/{chunk-23T2IPHV.js → chunk-4O2ARYS7.js} +1 -1
  4. package/Build/Workers/{chunk-RXZDTDIY.js → chunk-4R6FGUFP.js} +9 -9
  5. package/Build/Workers/{chunk-UG2DPFOL.js → chunk-5PJB7ASO.js} +6 -6
  6. package/Build/Workers/{chunk-JKXPC5HD.js → chunk-6GBGEUWR.js} +3 -3
  7. package/Build/Workers/{chunk-YF2NVO5B.js → chunk-6WDMPXQ7.js} +12 -12
  8. package/Build/Workers/{chunk-B7JRBTT6.js → chunk-7ATKQRBM.js} +10 -10
  9. package/Build/Workers/{chunk-TDSVSW5A.js → chunk-7SLNBIZS.js} +5 -34
  10. package/Build/Workers/{chunk-2RCIRXNI.js → chunk-7U5YNLF3.js} +1 -1
  11. package/Build/Workers/{chunk-GTY4K4IA.js → chunk-AFGP5BXS.js} +7 -7
  12. package/Build/Workers/{chunk-WTLYD4FE.js → chunk-AWELU5C6.js} +14 -14
  13. package/Build/Workers/{chunk-IL5F6WEE.js → chunk-BO22JHBX.js} +3 -3
  14. package/Build/Workers/{chunk-YX562XOB.js → chunk-D2PEV362.js} +10 -10
  15. package/Build/Workers/{chunk-MKMZHRB3.js → chunk-D63Z7KKL.js} +11 -11
  16. package/Build/Workers/{chunk-P5CGIJUY.js → chunk-D6OKR3BQ.js} +2 -2
  17. package/Build/Workers/{chunk-GDU4RZSZ.js → chunk-E4YDCSQK.js} +9 -9
  18. package/Build/Workers/{chunk-KKGD7HAW.js → chunk-EAAH543Q.js} +11 -11
  19. package/Build/Workers/{chunk-I4REFVXB.js → chunk-EOSX23OS.js} +4 -4
  20. package/Build/Workers/{chunk-V35NQOJC.js → chunk-EUDHHS7K.js} +6 -6
  21. package/Build/Workers/{chunk-OXFU5HNU.js → chunk-EY5HOJFQ.js} +5 -5
  22. package/Build/Workers/{chunk-DMEFNTUV.js → chunk-FDOLXORR.js} +7 -7
  23. package/Build/Workers/{chunk-QEANVUGT.js → chunk-FS42VX2H.js} +2 -2
  24. package/Build/Workers/{chunk-L4JLDVCM.js → chunk-FUDC3KOT.js} +5 -5
  25. package/Build/Workers/{chunk-LIYMRHGR.js → chunk-HWGP4GVC.js} +13 -13
  26. package/Build/Workers/{chunk-KROSQJUA.js → chunk-IHFAFGR2.js} +2 -2
  27. package/Build/Workers/{chunk-SPA2KPH3.js → chunk-IXL46IYV.js} +12 -12
  28. package/Build/Workers/{chunk-A6YFUGJO.js → chunk-K2PLKJJG.js} +5 -5
  29. package/Build/Workers/{chunk-CW7W27IZ.js → chunk-K4PGSAR5.js} +8 -8
  30. package/Build/Workers/{chunk-DICY26ID.js → chunk-KIJR26N3.js} +16 -16
  31. package/Build/Workers/{chunk-YSYSXSHF.js → chunk-L4OFWHNI.js} +1 -1
  32. package/Build/Workers/{chunk-2AM4E2WD.js → chunk-LK7GEFGB.js} +2 -2
  33. package/Build/Workers/{chunk-W4XUEDU5.js → chunk-LWZHJWYK.js} +6 -6
  34. package/Build/Workers/{chunk-3YTMGEXW.js → chunk-LYBNPUEI.js} +4 -4
  35. package/Build/Workers/{chunk-4BHWJWS3.js → chunk-M5DVYXJJ.js} +6 -6
  36. package/Build/Workers/{chunk-COGPE5Z2.js → chunk-MASEF4OV.js} +8 -8
  37. package/Build/Workers/{chunk-QUAH3XOT.js → chunk-N66PIK46.js} +4 -4
  38. package/Build/Workers/{chunk-H6Q7E4BQ.js → chunk-N6XBJBI7.js} +6 -6
  39. package/Build/Workers/{chunk-Y4ALZ4SS.js → chunk-NO3LMU7T.js} +7 -7
  40. package/Build/Workers/{chunk-MO25ZQ2I.js → chunk-NVL7JXAQ.js} +10 -10
  41. package/Build/Workers/{chunk-DQSJEOZY.js → chunk-OOYICVOK.js} +1 -1
  42. package/Build/Workers/{chunk-CJOV55CW.js → chunk-PJLRXIMS.js} +17 -17
  43. package/Build/Workers/{chunk-AOIO5VUS.js → chunk-S2KVL7OJ.js} +8 -8
  44. package/Build/Workers/{chunk-URGEDZBS.js → chunk-T5MJDW43.js} +7 -7
  45. package/Build/Workers/{chunk-OOCGX2OD.js → chunk-TCOUGKXF.js} +4 -4
  46. package/Build/Workers/{chunk-A53R2F2L.js → chunk-TMGLPEZW.js} +4 -4
  47. package/Build/Workers/{chunk-6HKAPCSO.js → chunk-TY5JXMVO.js} +1 -1
  48. package/Build/Workers/{chunk-2MWF4IES.js → chunk-VIQIKMTZ.js} +14 -14
  49. package/Build/Workers/{chunk-5JKH4AMT.js → chunk-VRAAQ3FS.js} +2 -2
  50. package/Build/Workers/{chunk-CHNDJRYA.js → chunk-W5NV72VR.js} +17 -17
  51. package/Build/Workers/{chunk-HXKUEOOD.js → chunk-WHLGBMBC.js} +5 -5
  52. package/Build/Workers/{chunk-QFBCIX7J.js → chunk-WUWPKBOZ.js} +6 -6
  53. package/Build/Workers/{chunk-Z6DFT4D3.js → chunk-XLIJV3YZ.js} +10 -10
  54. package/Build/Workers/{chunk-WB4TSSBQ.js → chunk-Y5MRBKQN.js} +144 -53
  55. package/Build/Workers/{chunk-HHGOFZVQ.js → chunk-YHPBT4I5.js} +5 -5
  56. package/Build/Workers/{chunk-O6RZEKHZ.js → chunk-ZGGVEGTA.js} +12 -12
  57. package/Build/Workers/{chunk-AJYWXC6I.js → chunk-ZWWN2CQH.js} +4 -4
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +24 -24
  100. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  103. package/Build/Workers/decodeI3S.js +10 -10
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
  107. package/Build/Workers/transcodeKTX2.js +6 -6
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Core/BoxGeometry.js +1 -1
  112. package/Source/Core/CornerType.js +1 -1
  113. package/Source/Core/CorridorGeometry.js +1 -1
  114. package/Source/Core/FeatureDetection.js +1 -32
  115. package/Source/Core/Geometry.js +1 -1
  116. package/Source/Core/IntersectionTests.js +2 -2
  117. package/Source/Core/Ion.js +1 -1
  118. package/Source/Core/PinBuilder.js +1 -1
  119. package/Source/Core/PolygonGeometry.js +1 -1
  120. package/Source/Core/PolylineGeometry.js +1 -1
  121. package/Source/Core/PolylineVolumeGeometry.js +1 -1
  122. package/Source/Core/RectangleGeometry.js +1 -1
  123. package/Source/Core/ScreenSpaceEventHandler.js +4 -8
  124. package/Source/Core/TerrainMesh.js +11 -8
  125. package/Source/Core/TerrainPicker.js +24 -7
  126. package/Source/Core/VideoSynchronizer.js +1 -1
  127. package/Source/Core/WallGeometry.js +1 -1
  128. package/Source/Core/writeTextToCanvas.js +40 -86
  129. package/Source/DataSources/BillboardGraphics.js +1 -1
  130. package/Source/DataSources/BoxGraphics.js +1 -1
  131. package/Source/DataSources/CallbackPositionProperty.js +1 -1
  132. package/Source/DataSources/CorridorGraphics.js +1 -1
  133. package/Source/DataSources/CzmlDataSource.js +1 -1
  134. package/Source/DataSources/EllipseGraphics.js +1 -1
  135. package/Source/DataSources/EllipsoidGraphics.js +1 -1
  136. package/Source/DataSources/Entity.js +1 -1
  137. package/Source/DataSources/EntityCluster.js +2 -2
  138. package/Source/DataSources/GeoJsonDataSource.js +2 -2
  139. package/Source/DataSources/GpxDataSource.js +1 -1
  140. package/Source/DataSources/KmlDataSource.js +1 -1
  141. package/Source/DataSources/KmlTour.js +1 -1
  142. package/Source/DataSources/LabelGraphics.js +1 -1
  143. package/Source/DataSources/ModelGraphics.js +1 -1
  144. package/Source/DataSources/PlaneGraphics.js +1 -1
  145. package/Source/DataSources/PolygonGraphics.js +1 -1
  146. package/Source/DataSources/PolylineGraphics.js +1 -1
  147. package/Source/DataSources/PolylineVolumeGraphics.js +1 -1
  148. package/Source/DataSources/RectangleGraphics.js +1 -1
  149. package/Source/DataSources/WallGraphics.js +1 -1
  150. package/Source/DataSources/exportKml.js +1 -1
  151. package/Source/Renderer/Context.js +11 -10
  152. package/Source/Renderer/ContextLimits.js +66 -33
  153. package/Source/Renderer/ShaderSource.js +19 -18
  154. package/Source/Renderer/Texture.js +1 -1
  155. package/Source/Renderer/Texture3D.js +166 -7
  156. package/Source/Renderer/TextureAtlas.js +10 -19
  157. package/Source/Scene/Appearance.js +1 -1
  158. package/Source/Scene/ArcGisMapService.js +1 -1
  159. package/Source/Scene/Azure2DImageryProvider.js +7 -8
  160. package/Source/Scene/Billboard.js +1 -1
  161. package/Source/Scene/BillboardCollection.js +15 -1
  162. package/Source/Scene/BillboardTexture.js +4 -1
  163. package/Source/Scene/Camera.js +13 -2
  164. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  165. package/Source/Scene/CloudCollection.js +2 -2
  166. package/Source/Scene/CumulusCloud.js +1 -1
  167. package/Source/Scene/DynamicEnvironmentMapManager.js +41 -26
  168. package/Source/Scene/Fog.js +1 -1
  169. package/Source/Scene/GaussianSplatPrimitive.js +1 -1
  170. package/Source/Scene/Globe.js +3 -10
  171. package/Source/Scene/GltfLoader.js +10 -0
  172. package/Source/Scene/ImageBasedLighting.js +2 -2
  173. package/Source/Scene/ImageryLayerCollection.js +2 -2
  174. package/Source/Scene/ImageryProvider.js +2 -2
  175. package/Source/Scene/Label.js +1 -1
  176. package/Source/Scene/LabelCollection.js +2 -1
  177. package/Source/Scene/Material.js +1 -1
  178. package/Source/Scene/MaterialAppearance.js +1 -1
  179. package/Source/Scene/Megatexture.js +174 -242
  180. package/Source/Scene/Model/MaterialPipelineStage.js +17 -0
  181. package/Source/Scene/Model/Model.js +1 -1
  182. package/Source/Scene/ModelComponents.js +10 -0
  183. package/Source/Scene/ParticleSystem.js +2 -2
  184. package/Source/Scene/PointPrimitive.js +1 -1
  185. package/Source/Scene/Polyline.js +0 -1
  186. package/Source/Scene/PolylineCollection.js +1 -4
  187. package/Source/Scene/PolylineColorAppearance.js +1 -6
  188. package/Source/Scene/PolylineMaterialAppearance.js +1 -6
  189. package/Source/Scene/PostProcessStageCollection.js +1 -1
  190. package/Source/Scene/QuadtreePrimitive.js +6 -3
  191. package/Source/Scene/ShadowMap.js +1 -2
  192. package/Source/Scene/Vector3DTileClampedPolylines.js +1 -5
  193. package/Source/Scene/Vector3DTilePolylines.js +1 -5
  194. package/Source/Scene/VoxelPrimitive.js +16 -33
  195. package/Source/Scene/VoxelRenderResources.js +1 -8
  196. package/Source/Scene/VoxelTraversal.js +16 -61
  197. package/Source/Scene/WebMapTileServiceImageryProvider.js +1 -1
  198. package/Source/Scene/createElevationBandMaterial.js +1 -1
  199. package/Source/Scene/processVoxelProperties.js +1 -1
  200. package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +8 -1
  201. package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
  202. package/Source/Shaders/Model/ModelFS.glsl +8 -0
  203. package/Source/Shaders/Model/ModelFS.js +8 -0
  204. package/Source/Shaders/Model/ModelVS.glsl +2 -0
  205. package/Source/Shaders/Model/ModelVS.js +2 -0
  206. package/Source/Shaders/Voxels/IntersectionUtils.glsl +1 -1
  207. package/Source/Shaders/Voxels/IntersectionUtils.js +1 -1
  208. package/Source/Shaders/Voxels/Megatexture.glsl +15 -83
  209. package/Source/Shaders/Voxels/Megatexture.js +15 -83
  210. package/Source/Shaders/Voxels/Octree.glsl +6 -9
  211. package/Source/Shaders/Voxels/Octree.js +6 -9
  212. package/Source/Widget/CesiumWidget.js +1 -1
  213. package/Source/Workers/incrementallyBuildTerrainPicker.js +16 -2
  214. package/index.d.ts +32 -21
  215. package/index.js +52 -52
  216. package/package.json +4 -3
@@ -52,8 +52,8 @@ const defaultImageSize = new Cartesian2(1.0, 1.0);
52
52
  * @param {number} [options.minimumMass] Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value.
53
53
  * @param {number} [options.maximumMass] Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value.
54
54
  * @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-particle-systems/|Particle Systems Tutorial}
55
- * @demo {@link https://sandcastle.cesium.com/?src=Particle%20System.html&label=Showcases|Particle Systems Tutorial Demo}
56
- * @demo {@link https://sandcastle.cesium.com/?src=Particle%20System%20Fireworks.html&label=Showcases|Particle Systems Fireworks Demo}
55
+ * @demo {@link https://sandcastle.cesium.com/?id=particle-system|Particle Systems Tutorial Demo}
56
+ * @demo {@link https://sandcastle.cesium.com/?id=particle-system-fireworks|Particle Systems Fireworks Demo}
57
57
  */
58
58
  function ParticleSystem(options) {
59
59
  options = options ?? Frozen.EMPTY_OBJECT;
@@ -39,7 +39,7 @@ import SplitDirection from "./SplitDirection.js";
39
39
  * @internalConstructor
40
40
  * @class
41
41
  *
42
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Points.html|Cesium Sandcastle Points Demo}
42
+ * @demo {@link https://sandcastle.cesium.com/index.html?id=points|Cesium Sandcastle Points Demo}
43
43
  */
44
44
  function PointPrimitive(options, pointPrimitiveCollection) {
45
45
  options = options ?? Frozen.EMPTY_OBJECT;
@@ -83,7 +83,6 @@ function Polyline(options, polylineCollection) {
83
83
 
84
84
  this._actualLength = undefined;
85
85
 
86
- // eslint-disable-next-line no-use-before-define
87
86
  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);
88
87
  this._polylineCollection = polylineCollection;
89
88
  this._dirty = false;
@@ -11,7 +11,6 @@ import defined from "../Core/defined.js";
11
11
  import destroyObject from "../Core/destroyObject.js";
12
12
  import DeveloperError from "../Core/DeveloperError.js";
13
13
  import EncodedCartesian3 from "../Core/EncodedCartesian3.js";
14
- import FeatureDetection from "../Core/FeatureDetection.js";
15
14
  import IndexDatatype from "../Core/IndexDatatype.js";
16
15
  import Intersect from "../Core/Intersect.js";
17
16
  import CesiumMath from "../Core/Math.js";
@@ -1294,9 +1293,7 @@ PolylineBucket.prototype.updateShader = function (
1294
1293
  defines.push("POLYLINE_DASH");
1295
1294
  }
1296
1295
 
1297
- if (!FeatureDetection.isInternetExplorer()) {
1298
- defines.push("CLIP_POLYLINE");
1299
- }
1296
+ defines.push("CLIP_POLYLINE");
1300
1297
 
1301
1298
  const fs = new ShaderSource({
1302
1299
  defines: defines,
@@ -1,18 +1,13 @@
1
1
  import Frozen from "../Core/Frozen.js";
2
- import FeatureDetection from "../Core/FeatureDetection.js";
3
2
  import VertexFormat from "../Core/VertexFormat.js";
4
3
  import PerInstanceFlatColorAppearanceFS from "../Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js";
5
4
  import PolylineColorAppearanceVS from "../Shaders/Appearances/PolylineColorAppearanceVS.js";
6
5
  import PolylineCommon from "../Shaders/PolylineCommon.js";
7
6
  import Appearance from "./Appearance.js";
8
7
 
9
- let defaultVertexShaderSource = `${PolylineCommon}\n${PolylineColorAppearanceVS}`;
8
+ const defaultVertexShaderSource = `#define CLIP_POLYLINE \n${PolylineCommon}\n${PolylineColorAppearanceVS}`;
10
9
  const defaultFragmentShaderSource = PerInstanceFlatColorAppearanceFS;
11
10
 
12
- if (!FeatureDetection.isInternetExplorer()) {
13
- defaultVertexShaderSource = `#define CLIP_POLYLINE \n${defaultVertexShaderSource}`;
14
- }
15
-
16
11
  /**
17
12
  * An appearance for {@link GeometryInstance} instances with color attributes and
18
13
  * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
@@ -1,6 +1,5 @@
1
1
  import Frozen from "../Core/Frozen.js";
2
2
  import defined from "../Core/defined.js";
3
- import FeatureDetection from "../Core/FeatureDetection.js";
4
3
  import VertexFormat from "../Core/VertexFormat.js";
5
4
  import PolylineMaterialAppearanceVS from "../Shaders/Appearances/PolylineMaterialAppearanceVS.js";
6
5
  import PolylineCommon from "../Shaders/PolylineCommon.js";
@@ -8,13 +7,9 @@ import PolylineFS from "../Shaders/PolylineFS.js";
8
7
  import Appearance from "./Appearance.js";
9
8
  import Material from "./Material.js";
10
9
 
11
- let defaultVertexShaderSource = `${PolylineCommon}\n${PolylineMaterialAppearanceVS}`;
10
+ const defaultVertexShaderSource = `#define CLIP_POLYLINE \n${PolylineCommon}\n${PolylineMaterialAppearanceVS}`;
12
11
  const defaultFragmentShaderSource = PolylineFS;
13
12
 
14
- if (!FeatureDetection.isInternetExplorer()) {
15
- defaultVertexShaderSource = `#define CLIP_POLYLINE \n${defaultVertexShaderSource}`;
16
- }
17
-
18
13
  /**
19
14
  * An appearance for {@link PolylineGeometry} that supports shading with materials.
20
15
  *
@@ -303,7 +303,7 @@ Object.defineProperties(PostProcessStageCollection.prototype, {
303
303
 
304
304
  /**
305
305
  * Specifies the tonemapping algorithm used when rendering with high dynamic range.
306
- * {@link https://sandcastle.cesium.com/?src=High%20Dynamic%20Range.html|Sandcastle Demo}
306
+ * {@link https://sandcastle.cesium.com/?id=high-dynamic-range|Sandcastle Demo}
307
307
  *
308
308
  * @example viewer.scene.postProcessStages.tonemapper = Cesium.Tonemapper.ACES;
309
309
  *
@@ -77,6 +77,7 @@ function QuadtreePrimitive(options) {
77
77
  const tilingScheme = this._tileProvider.tilingScheme;
78
78
  const ellipsoid = tilingScheme.ellipsoid;
79
79
 
80
+ this._tilesRenderedThisFrame = new Set(); // collect all tiles selected to render (useful when multiple render calls are made in a single frame (as in 2D mode))
80
81
  this._tilesToRender = [];
81
82
  this._tileLoadQueueHigh = []; // high priority tiles are preventing refinement
82
83
  this._tileLoadQueueMedium = []; // medium priority tiles are being rendered
@@ -256,9 +257,9 @@ QuadtreePrimitive.prototype.forEachLoadedTile = function (tileFunction) {
256
257
  * function is passed a reference to the tile as its only parameter.
257
258
  */
258
259
  QuadtreePrimitive.prototype.forEachRenderedTile = function (tileFunction) {
259
- const tilesRendered = this._tilesToRender;
260
- for (let i = 0, len = tilesRendered.length; i < len; ++i) {
261
- tileFunction(tilesRendered[i]);
260
+ const tilesRendered = this._tilesRenderedThisFrame;
261
+ for (const tile of tilesRendered) {
262
+ tileFunction(tile);
262
263
  }
263
264
  };
264
265
 
@@ -347,6 +348,7 @@ QuadtreePrimitive.prototype.beginFrame = function (frameState) {
347
348
  }
348
349
 
349
350
  this._tileReplacementQueue.markStartOfRenderFrame();
351
+ this._tilesRenderedThisFrame.clear();
350
352
  };
351
353
 
352
354
  /**
@@ -1303,6 +1305,7 @@ function screenSpaceError2D(primitive, frameState, tile) {
1303
1305
 
1304
1306
  function addTileToRenderList(primitive, tile) {
1305
1307
  primitive._tilesToRender.push(tile);
1308
+ primitive._tilesRenderedThisFrame.add(tile);
1306
1309
  }
1307
1310
 
1308
1311
  function processTileLoadQueue(primitive, frameState) {
@@ -76,7 +76,7 @@ import ShadowMapShader from "./ShadowMapShader.js";
76
76
  *
77
77
  * @exception {DeveloperError} Only one or four cascades are supported.
78
78
  *
79
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Shadows.html|Cesium Sandcastle Shadows Demo}
79
+ * @demo {@link https://sandcastle.cesium.com/index.html?id=shadows|Cesium Sandcastle Shadows Demo}
80
80
  */
81
81
  function ShadowMap(options) {
82
82
  options = options ?? Frozen.EMPTY_OBJECT;
@@ -145,7 +145,6 @@ function ShadowMap(options) {
145
145
  // Re-enable once https://github.com/CesiumGS/cesium/issues/4560 is resolved.
146
146
  let polygonOffsetSupported = true;
147
147
  if (
148
- FeatureDetection.isInternetExplorer() ||
149
148
  FeatureDetection.isEdge() ||
150
149
  ((FeatureDetection.isChrome() || FeatureDetection.isFirefox()) &&
151
150
  FeatureDetection.isWindows() &&
@@ -6,7 +6,6 @@ import ComponentDatatype from "../Core/ComponentDatatype.js";
6
6
  import defined from "../Core/defined.js";
7
7
  import destroyObject from "../Core/destroyObject.js";
8
8
  import Ellipsoid from "../Core/Ellipsoid.js";
9
- import FeatureDetection from "../Core/FeatureDetection.js";
10
9
  import IndexDatatype from "../Core/IndexDatatype.js";
11
10
  import OrientedBoundingBox from "../Core/OrientedBoundingBox.js";
12
11
  import Matrix4 from "../Core/Matrix4.js";
@@ -557,10 +556,7 @@ function createShaders(primitive, context) {
557
556
  )(Vector3DTileClampedPolylinesFS);
558
557
 
559
558
  const vs = new ShaderSource({
560
- defines: [
561
- "VECTOR_TILE",
562
- !FeatureDetection.isInternetExplorer() ? "CLIP_POLYLINE" : "",
563
- ],
559
+ defines: ["VECTOR_TILE", "CLIP_POLYLINE"],
564
560
  sources: [PolylineCommon, vsSource],
565
561
  });
566
562
  const fs = new ShaderSource({
@@ -4,7 +4,6 @@ import ComponentDatatype from "../Core/ComponentDatatype.js";
4
4
  import defined from "../Core/defined.js";
5
5
  import destroyObject from "../Core/destroyObject.js";
6
6
  import Ellipsoid from "../Core/Ellipsoid.js";
7
- import FeatureDetection from "../Core/FeatureDetection.js";
8
7
  import IndexDatatype from "../Core/IndexDatatype.js";
9
8
  import Matrix4 from "../Core/Matrix4.js";
10
9
  import Rectangle from "../Core/Rectangle.js";
@@ -456,10 +455,7 @@ function createShaders(primitive, context) {
456
455
  )(PolylineFS);
457
456
 
458
457
  const vs = new ShaderSource({
459
- defines: [
460
- "VECTOR_TILE",
461
- !FeatureDetection.isInternetExplorer() ? "CLIP_POLYLINE" : "",
462
- ],
458
+ defines: ["VECTOR_TILE", "CLIP_POLYLINE"],
463
459
  sources: [PolylineCommon, vsSource],
464
460
  });
465
461
  const fs = new ShaderSource({
@@ -405,11 +405,7 @@ function VoxelPrimitive(options) {
405
405
  octreeLeafNodeTilesPerRow: 0,
406
406
  octreeLeafNodeTexelSizeUv: new Cartesian2(),
407
407
  megatextureTextures: [],
408
- megatextureSliceDimensions: new Cartesian2(),
409
- megatextureTileDimensions: new Cartesian2(),
410
- megatextureVoxelSizeUv: new Cartesian2(),
411
- megatextureSliceSizeUv: new Cartesian2(),
412
- megatextureTileSizeUv: new Cartesian2(),
408
+ megatextureTileCounts: new Cartesian3(),
413
409
  dimensions: new Cartesian3(),
414
410
  inputDimensions: new Cartesian3(),
415
411
  paddingBefore: new Cartesian3(),
@@ -855,10 +851,7 @@ Object.defineProperties(VoxelPrimitive.prototype, {
855
851
  Check.typeOf.bool("nearestSampling", nearestSampling);
856
852
  //>>includeEnd('debug');
857
853
 
858
- if (this._nearestSampling !== nearestSampling) {
859
- this._nearestSampling = nearestSampling;
860
- this._shaderDirty = true;
861
- }
854
+ this._nearestSampling = nearestSampling;
862
855
  },
863
856
  },
864
857
 
@@ -1282,6 +1275,7 @@ VoxelPrimitive.prototype.update = function (frameState) {
1282
1275
  );
1283
1276
  uniforms.stepSize = this._stepSizeMultiplier;
1284
1277
 
1278
+ updateNearestSampling(this);
1285
1279
  updateRenderBoundPlanes(this, frameState);
1286
1280
 
1287
1281
  // Render the primitive
@@ -1294,6 +1288,13 @@ VoxelPrimitive.prototype.update = function (frameState) {
1294
1288
  frameState.commandList.push(command);
1295
1289
  };
1296
1290
 
1291
+ function updateNearestSampling(primitive) {
1292
+ const { megatextures } = primitive._traversal;
1293
+ for (let i = 0; i < megatextures.length; ++i) {
1294
+ megatextures[i].nearestSampling = primitive._nearestSampling;
1295
+ }
1296
+ }
1297
+
1297
1298
  function updateRenderBoundPlanes(primitive, frameState) {
1298
1299
  const uniforms = primitive._uniforms;
1299
1300
  const { renderBoundPlanes } = primitive._shape;
@@ -1689,33 +1690,15 @@ function setTraversalUniforms(traversal, uniforms) {
1689
1690
  );
1690
1691
  uniforms.octreeInternalNodeTilesPerRow = traversal.internalNodeTilesPerRow;
1691
1692
 
1692
- const megatextures = traversal.megatextures;
1693
+ const { megatextures } = traversal;
1693
1694
  const megatexture = megatextures[0];
1694
- const megatextureLength = megatextures.length;
1695
- uniforms.megatextureTextures = new Array(megatextureLength);
1696
- for (let i = 0; i < megatextureLength; i++) {
1695
+ uniforms.megatextureTextures = new Array(megatextures.length);
1696
+ for (let i = 0; i < megatextures.length; i++) {
1697
1697
  uniforms.megatextureTextures[i] = megatextures[i].texture;
1698
1698
  }
1699
-
1700
- uniforms.megatextureSliceDimensions = Cartesian2.clone(
1701
- megatexture.sliceCountPerRegion,
1702
- uniforms.megatextureSliceDimensions,
1703
- );
1704
- uniforms.megatextureTileDimensions = Cartesian2.clone(
1705
- megatexture.regionCountPerMegatexture,
1706
- uniforms.megatextureTileDimensions,
1707
- );
1708
- uniforms.megatextureVoxelSizeUv = Cartesian2.clone(
1709
- megatexture.voxelSizeUv,
1710
- uniforms.megatextureVoxelSizeUv,
1711
- );
1712
- uniforms.megatextureSliceSizeUv = Cartesian2.clone(
1713
- megatexture.sliceSizeUv,
1714
- uniforms.megatextureSliceSizeUv,
1715
- );
1716
- uniforms.megatextureTileSizeUv = Cartesian2.clone(
1717
- megatexture.regionSizeUv,
1718
- uniforms.megatextureTileSizeUv,
1699
+ uniforms.megatextureTileCounts = Cartesian3.clone(
1700
+ megatexture.tileCounts,
1701
+ uniforms.megatextureTileCounts,
1719
1702
  );
1720
1703
  }
1721
1704
 
@@ -62,7 +62,7 @@ function VoxelRenderResources(primitive) {
62
62
  // The reason this uniform is added by shader builder is because some of the
63
63
  // dynamically generated shader code reads from it.
64
64
  shaderBuilder.addUniform(
65
- "sampler2D",
65
+ "sampler3D",
66
66
  "u_megatextureTextures[METADATA_COUNT]",
67
67
  ShaderDestination.FRAGMENT,
68
68
  );
@@ -241,13 +241,6 @@ function VoxelRenderResources(primitive) {
241
241
  ShaderDestination.FRAGMENT,
242
242
  );
243
243
  }
244
- if (primitive._nearestSampling) {
245
- shaderBuilder.addDefine(
246
- "NEAREST_SAMPLING",
247
- undefined,
248
- ShaderDestination.FRAGMENT,
249
- );
250
- }
251
244
  const traversal = primitive._traversal;
252
245
  shaderBuilder.addDefine(
253
246
  "SAMPLE_COUNT",
@@ -1,5 +1,4 @@
1
1
  import Cartesian2 from "../Core/Cartesian2.js";
2
- import Cartesian3 from "../Core/Cartesian3.js";
3
2
  import CesiumMath from "../Core/Math.js";
4
3
  import CullingVolume from "../Core/CullingVolume.js";
5
4
  import defined from "../Core/defined.js";
@@ -16,7 +15,6 @@ import SpatialNode from "./SpatialNode.js";
16
15
  import Texture from "../Renderer/Texture.js";
17
16
  import TextureMagnificationFilter from "../Renderer/TextureMagnificationFilter.js";
18
17
  import TextureMinificationFilter from "../Renderer/TextureMinificationFilter.js";
19
- import VoxelMetadataOrder from "./VoxelMetadataOrder.js";
20
18
 
21
19
  /**
22
20
  * Handles tileset traversal, tile requests, and GPU resources. Intended to be
@@ -28,7 +26,7 @@ import VoxelMetadataOrder from "./VoxelMetadataOrder.js";
28
26
  * @param {VoxelPrimitive} primitive The voxel primitive for which this traversal will be used.
29
27
  * @param {Context} context The context in which to create GPU resources.
30
28
  * @param {number} keyframeCount The number of keyframes in the tileset.
31
- * @param {number} [maximumTextureMemoryByteLength] The maximum amount of memory to use for textures.
29
+ * @param {number} [maximumTextureMemoryByteLength=536870912] The maximum amount of memory to use for textures.
32
30
  *
33
31
  * @private
34
32
  */
@@ -38,32 +36,16 @@ function VoxelTraversal(
38
36
  keyframeCount,
39
37
  maximumTextureMemoryByteLength,
40
38
  ) {
41
- const { provider, dimensions, paddingBefore, paddingAfter } = primitive;
42
- const { types, componentTypes, metadataOrder } = provider;
39
+ const { provider, dimensions, inputDimensions } = primitive;
40
+ const { types, componentTypes } = provider;
43
41
 
44
- const inputDimensions = Cartesian3.add(
45
- dimensions,
46
- paddingBefore,
47
- new Cartesian3(),
48
- );
49
- Cartesian3.add(inputDimensions, paddingAfter, inputDimensions);
50
-
51
- if (metadataOrder === VoxelMetadataOrder.Y_UP) {
52
- const inputDimensionsY = inputDimensions.y;
53
- inputDimensions.y = inputDimensions.z;
54
- inputDimensions.z = inputDimensionsY;
55
- }
56
-
57
- if (
58
- !defined(maximumTextureMemoryByteLength) &&
59
- defined(provider.maximumTileCount)
60
- ) {
61
- maximumTextureMemoryByteLength = getApproximateTextureMemoryByteLength(
62
- provider.maximumTileCount,
63
- inputDimensions,
64
- types,
65
- componentTypes,
42
+ if (defined(maximumTextureMemoryByteLength)) {
43
+ maximumTextureMemoryByteLength = Math.min(
44
+ Math.max(0, maximumTextureMemoryByteLength),
45
+ 512 * 1024 * 1024,
66
46
  );
47
+ } else {
48
+ maximumTextureMemoryByteLength = 128 * 1024 * 1024;
67
49
  }
68
50
 
69
51
  /**
@@ -84,7 +66,12 @@ function VoxelTraversal(
84
66
  */
85
67
  this.megatextures = new Array(types.length);
86
68
 
87
- // TODO make sure to split the maximumTextureMemoryByteLength across all the megatextures
69
+ const providerTileCount = defined(provider.maximumTileCount)
70
+ ? provider.maximumTileCount
71
+ : defined(provider.availableLevels)
72
+ ? (8 ** provider.availableLevels - 1) / 7
73
+ : undefined;
74
+
88
75
  for (let i = 0; i < types.length; i++) {
89
76
  const type = types[i];
90
77
  const componentCount = MetadataType.getComponentCount(type);
@@ -96,6 +83,7 @@ function VoxelTraversal(
96
83
  componentCount,
97
84
  componentType,
98
85
  maximumTextureMemoryByteLength,
86
+ providerTileCount,
99
87
  );
100
88
 
101
89
  this.textureMemoryByteLength +=
@@ -1228,37 +1216,4 @@ function copyToLeafNodeTexture(data, texelsPerTile, tilesPerRow, texture) {
1228
1216
  texture.copyFrom(copyOptions);
1229
1217
  }
1230
1218
 
1231
- /**
1232
- * @param {number} tileCount
1233
- * @param {Cartesian3} dimensions
1234
- * @param {MetadataType[]} types
1235
- * @param {MetadataComponentType[]} componentTypes
1236
- * @private
1237
- */
1238
- function getApproximateTextureMemoryByteLength(
1239
- tileCount,
1240
- dimensions,
1241
- types,
1242
- componentTypes,
1243
- ) {
1244
- let textureMemoryByteLength = 0;
1245
-
1246
- const length = types.length;
1247
- for (let i = 0; i < length; i++) {
1248
- const type = types[i];
1249
- const componentType = componentTypes[i];
1250
- const componentCount = MetadataType.getComponentCount(type);
1251
-
1252
- textureMemoryByteLength +=
1253
- Megatexture.getApproximateTextureMemoryByteLength(
1254
- tileCount,
1255
- dimensions,
1256
- componentCount,
1257
- componentType,
1258
- );
1259
- }
1260
-
1261
- return textureMemoryByteLength;
1262
- }
1263
-
1264
1219
  export default VoxelTraversal;
@@ -51,7 +51,7 @@ const defaultParameters = Object.freeze({
51
51
  *
52
52
  * @param {WebMapTileServiceImageryProvider.ConstructorOptions} options Object describing initialization options
53
53
  *
54
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Web%20Map%20Tile%20Service%20with%20Time.html|Cesium Sandcastle Web Map Tile Service with Time Demo}
54
+ * @demo {@link https://sandcastle.cesium.com/index.html?id=web-map-tile-service-with-time|Cesium Sandcastle Web Map Tile Service with Time Demo}
55
55
  *
56
56
  * @example
57
57
  * // Example 1. USGS shaded relief tiles (KVP)
@@ -435,7 +435,7 @@ function createLayeredEntries(layers) {
435
435
  * @param {createElevationBandMaterialBand[]} options.layers A list of bands ordered from lowest to highest precedence.
436
436
  * @returns {Material} A new {@link Material} instance.
437
437
  *
438
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Elevation%20Band%20Material.html|Cesium Sandcastle Elevation Band Demo}
438
+ * @demo {@link https://sandcastle.cesium.com/index.html?id=elevation-band-material|Cesium Sandcastle Elevation Band Demo}
439
439
  *
440
440
  * @example
441
441
  * scene.globe.material = Cesium.createElevationBandMaterial({
@@ -294,7 +294,7 @@ function processVoxelProperties(renderResources, primitive) {
294
294
  const functionId = "getPropertiesFromMegatextureAtUv";
295
295
  shaderBuilder.addFunction(
296
296
  functionId,
297
- `${propertiesStructName} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,
297
+ `${propertiesStructName} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,
298
298
  ShaderDestination.FRAGMENT,
299
299
  );
300
300
  shaderBuilder.addFunctionLines(functionId, [
@@ -7,6 +7,13 @@
7
7
  vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
8
8
  {
9
9
  // Just linear for now.
10
- vec3 p = mix(position2D.xyz, position3D.xyz, time);
10
+ // We're manually doing the equivalent of a `mix` here because, some GPUs
11
+ // (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), `mix` seems to
12
+ // use an alternate formulation that introduces jitter even when `time` is
13
+ // 0.0 or 1.0. That is, the value of `p` won't be exactly `position2D.xyz`
14
+ // when `time` is 0.0 and it won't be exactly `position3D.xyz` when `time` is
15
+ // 1.0. The "textbook" formulation here, while probably a bit slower,
16
+ // does not have this problem.
17
+ vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;
11
18
  return vec4(p, 1.0);
12
19
  }
@@ -8,7 +8,14 @@ export default "/**\n\
8
8
  vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n\
9
9
  {\n\
10
10
  // Just linear for now.\n\
11
- vec3 p = mix(position2D.xyz, position3D.xyz, time);\n\
11
+ // We're manually doing the equivalent of a `mix` here because, some GPUs\n\
12
+ // (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), `mix` seems to\n\
13
+ // use an alternate formulation that introduces jitter even when `time` is\n\
14
+ // 0.0 or 1.0. That is, the value of `p` won't be exactly `position2D.xyz`\n\
15
+ // when `time` is 0.0 and it won't be exactly `position3D.xyz` when `time` is\n\
16
+ // 1.0. The \"textbook\" formulation here, while probably a bit slower,\n\
17
+ // does not have this problem.\n\
18
+ vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;\n\
12
19
  return vec4(p, 1.0);\n\
13
20
  }\n\
14
21
  ";
@@ -29,6 +29,14 @@ SelectedFeature selectedFeature;
29
29
 
30
30
  void main()
31
31
  {
32
+ #ifdef PRIMITIVE_TYPE_POINTS
33
+ // Render points as circles
34
+ float distanceToCenter = length(gl_PointCoord - vec2(0.5));
35
+ if (distanceToCenter > 0.5) {
36
+ discard;
37
+ }
38
+ #endif
39
+
32
40
  #ifdef HAS_POINT_CLOUD_SHOW_STYLE
33
41
  if (v_pointCloudShow == 0.0)
34
42
  {
@@ -30,6 +30,14 @@ SelectedFeature selectedFeature;\n\
30
30
  \n\
31
31
  void main()\n\
32
32
  {\n\
33
+ #ifdef PRIMITIVE_TYPE_POINTS\n\
34
+ // Render points as circles\n\
35
+ float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n\
36
+ if (distanceToCenter > 0.5) {\n\
37
+ discard;\n\
38
+ }\n\
39
+ #endif\n\
40
+ \n\
33
41
  #ifdef HAS_POINT_CLOUD_SHOW_STYLE\n\
34
42
  if (v_pointCloudShow == 0.0)\n\
35
43
  {\n\
@@ -142,6 +142,8 @@ void main()
142
142
  gl_PointSize = vsOutput.pointSize;
143
143
  #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
144
144
  gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
145
+ #elif defined(HAS_POINT_DIAMETER)
146
+ gl_PointSize = u_pointDiameter;
145
147
  #else
146
148
  gl_PointSize = 1.0;
147
149
  #endif
@@ -143,6 +143,8 @@ void main()\n\
143
143
  gl_PointSize = vsOutput.pointSize;\n\
144
144
  #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)\n\
145
145
  gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);\n\
146
+ #elif defined(HAS_POINT_DIAMETER)\n\
147
+ gl_PointSize = u_pointDiameter;\n\
146
148
  #else\n\
147
149
  gl_PointSize = 1.0;\n\
148
150
  #endif\n\
@@ -135,7 +135,7 @@ RayShapeIntersection nextIntersection(inout Intersections ix) {
135
135
  surfaceIntersection = ix.intersections[i];
136
136
  int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
137
137
  bool currShapeIsPositive = intersectionType < 2;
138
- bool enter = intMod(intersectionType, 2) == 0;
138
+ bool enter = intersectionType % 2 == 0;
139
139
 
140
140
  ix.surroundCount += enter ? +1 : -1;
141
141
  ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
@@ -136,7 +136,7 @@ RayShapeIntersection nextIntersection(inout Intersections ix) {\n\
136
136
  surfaceIntersection = ix.intersections[i];\n\
137
137
  int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);\n\
138
138
  bool currShapeIsPositive = intersectionType < 2;\n\
139
- bool enter = intMod(intersectionType, 2) == 0;\n\
139
+ bool enter = intersectionType % 2 == 0;\n\
140
140
  \n\
141
141
  ix.surroundCount += enter ? +1 : -1;\n\
142
142
  ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;\n\