@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.
- package/Build/Workers/{chunk-YZWA5B4R.js → chunk-2MLJ46ZZ.js} +13 -13
- package/Build/Workers/{chunk-GKWOUMYA.js → chunk-4BBANFU6.js} +1 -1
- package/Build/Workers/{chunk-23T2IPHV.js → chunk-4O2ARYS7.js} +1 -1
- package/Build/Workers/{chunk-RXZDTDIY.js → chunk-4R6FGUFP.js} +9 -9
- package/Build/Workers/{chunk-UG2DPFOL.js → chunk-5PJB7ASO.js} +6 -6
- package/Build/Workers/{chunk-JKXPC5HD.js → chunk-6GBGEUWR.js} +3 -3
- package/Build/Workers/{chunk-YF2NVO5B.js → chunk-6WDMPXQ7.js} +12 -12
- package/Build/Workers/{chunk-B7JRBTT6.js → chunk-7ATKQRBM.js} +10 -10
- package/Build/Workers/{chunk-TDSVSW5A.js → chunk-7SLNBIZS.js} +5 -34
- package/Build/Workers/{chunk-2RCIRXNI.js → chunk-7U5YNLF3.js} +1 -1
- package/Build/Workers/{chunk-GTY4K4IA.js → chunk-AFGP5BXS.js} +7 -7
- package/Build/Workers/{chunk-WTLYD4FE.js → chunk-AWELU5C6.js} +14 -14
- package/Build/Workers/{chunk-IL5F6WEE.js → chunk-BO22JHBX.js} +3 -3
- package/Build/Workers/{chunk-YX562XOB.js → chunk-D2PEV362.js} +10 -10
- package/Build/Workers/{chunk-MKMZHRB3.js → chunk-D63Z7KKL.js} +11 -11
- package/Build/Workers/{chunk-P5CGIJUY.js → chunk-D6OKR3BQ.js} +2 -2
- package/Build/Workers/{chunk-GDU4RZSZ.js → chunk-E4YDCSQK.js} +9 -9
- package/Build/Workers/{chunk-KKGD7HAW.js → chunk-EAAH543Q.js} +11 -11
- package/Build/Workers/{chunk-I4REFVXB.js → chunk-EOSX23OS.js} +4 -4
- package/Build/Workers/{chunk-V35NQOJC.js → chunk-EUDHHS7K.js} +6 -6
- package/Build/Workers/{chunk-OXFU5HNU.js → chunk-EY5HOJFQ.js} +5 -5
- package/Build/Workers/{chunk-DMEFNTUV.js → chunk-FDOLXORR.js} +7 -7
- package/Build/Workers/{chunk-QEANVUGT.js → chunk-FS42VX2H.js} +2 -2
- package/Build/Workers/{chunk-L4JLDVCM.js → chunk-FUDC3KOT.js} +5 -5
- package/Build/Workers/{chunk-LIYMRHGR.js → chunk-HWGP4GVC.js} +13 -13
- package/Build/Workers/{chunk-KROSQJUA.js → chunk-IHFAFGR2.js} +2 -2
- package/Build/Workers/{chunk-SPA2KPH3.js → chunk-IXL46IYV.js} +12 -12
- package/Build/Workers/{chunk-A6YFUGJO.js → chunk-K2PLKJJG.js} +5 -5
- package/Build/Workers/{chunk-CW7W27IZ.js → chunk-K4PGSAR5.js} +8 -8
- package/Build/Workers/{chunk-DICY26ID.js → chunk-KIJR26N3.js} +16 -16
- package/Build/Workers/{chunk-YSYSXSHF.js → chunk-L4OFWHNI.js} +1 -1
- package/Build/Workers/{chunk-2AM4E2WD.js → chunk-LK7GEFGB.js} +2 -2
- package/Build/Workers/{chunk-W4XUEDU5.js → chunk-LWZHJWYK.js} +6 -6
- package/Build/Workers/{chunk-3YTMGEXW.js → chunk-LYBNPUEI.js} +4 -4
- package/Build/Workers/{chunk-4BHWJWS3.js → chunk-M5DVYXJJ.js} +6 -6
- package/Build/Workers/{chunk-COGPE5Z2.js → chunk-MASEF4OV.js} +8 -8
- package/Build/Workers/{chunk-QUAH3XOT.js → chunk-N66PIK46.js} +4 -4
- package/Build/Workers/{chunk-H6Q7E4BQ.js → chunk-N6XBJBI7.js} +6 -6
- package/Build/Workers/{chunk-Y4ALZ4SS.js → chunk-NO3LMU7T.js} +7 -7
- package/Build/Workers/{chunk-MO25ZQ2I.js → chunk-NVL7JXAQ.js} +10 -10
- package/Build/Workers/{chunk-DQSJEOZY.js → chunk-OOYICVOK.js} +1 -1
- package/Build/Workers/{chunk-CJOV55CW.js → chunk-PJLRXIMS.js} +17 -17
- package/Build/Workers/{chunk-AOIO5VUS.js → chunk-S2KVL7OJ.js} +8 -8
- package/Build/Workers/{chunk-URGEDZBS.js → chunk-T5MJDW43.js} +7 -7
- package/Build/Workers/{chunk-OOCGX2OD.js → chunk-TCOUGKXF.js} +4 -4
- package/Build/Workers/{chunk-A53R2F2L.js → chunk-TMGLPEZW.js} +4 -4
- package/Build/Workers/{chunk-6HKAPCSO.js → chunk-TY5JXMVO.js} +1 -1
- package/Build/Workers/{chunk-2MWF4IES.js → chunk-VIQIKMTZ.js} +14 -14
- package/Build/Workers/{chunk-5JKH4AMT.js → chunk-VRAAQ3FS.js} +2 -2
- package/Build/Workers/{chunk-CHNDJRYA.js → chunk-W5NV72VR.js} +17 -17
- package/Build/Workers/{chunk-HXKUEOOD.js → chunk-WHLGBMBC.js} +5 -5
- package/Build/Workers/{chunk-QFBCIX7J.js → chunk-WUWPKBOZ.js} +6 -6
- package/Build/Workers/{chunk-Z6DFT4D3.js → chunk-XLIJV3YZ.js} +10 -10
- package/Build/Workers/{chunk-WB4TSSBQ.js → chunk-Y5MRBKQN.js} +144 -53
- package/Build/Workers/{chunk-HHGOFZVQ.js → chunk-YHPBT4I5.js} +5 -5
- package/Build/Workers/{chunk-O6RZEKHZ.js → chunk-ZGGVEGTA.js} +12 -12
- package/Build/Workers/{chunk-AJYWXC6I.js → chunk-ZWWN2CQH.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/BoxGeometry.js +1 -1
- package/Source/Core/CornerType.js +1 -1
- package/Source/Core/CorridorGeometry.js +1 -1
- package/Source/Core/FeatureDetection.js +1 -32
- package/Source/Core/Geometry.js +1 -1
- package/Source/Core/IntersectionTests.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PinBuilder.js +1 -1
- package/Source/Core/PolygonGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometry.js +1 -1
- package/Source/Core/RectangleGeometry.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +4 -8
- package/Source/Core/TerrainMesh.js +11 -8
- package/Source/Core/TerrainPicker.js +24 -7
- package/Source/Core/VideoSynchronizer.js +1 -1
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/writeTextToCanvas.js +40 -86
- package/Source/DataSources/BillboardGraphics.js +1 -1
- package/Source/DataSources/BoxGraphics.js +1 -1
- package/Source/DataSources/CallbackPositionProperty.js +1 -1
- package/Source/DataSources/CorridorGraphics.js +1 -1
- package/Source/DataSources/CzmlDataSource.js +1 -1
- package/Source/DataSources/EllipseGraphics.js +1 -1
- package/Source/DataSources/EllipsoidGraphics.js +1 -1
- package/Source/DataSources/Entity.js +1 -1
- package/Source/DataSources/EntityCluster.js +2 -2
- package/Source/DataSources/GeoJsonDataSource.js +2 -2
- package/Source/DataSources/GpxDataSource.js +1 -1
- package/Source/DataSources/KmlDataSource.js +1 -1
- package/Source/DataSources/KmlTour.js +1 -1
- package/Source/DataSources/LabelGraphics.js +1 -1
- package/Source/DataSources/ModelGraphics.js +1 -1
- package/Source/DataSources/PlaneGraphics.js +1 -1
- package/Source/DataSources/PolygonGraphics.js +1 -1
- package/Source/DataSources/PolylineGraphics.js +1 -1
- package/Source/DataSources/PolylineVolumeGraphics.js +1 -1
- package/Source/DataSources/RectangleGraphics.js +1 -1
- package/Source/DataSources/WallGraphics.js +1 -1
- package/Source/DataSources/exportKml.js +1 -1
- package/Source/Renderer/Context.js +11 -10
- package/Source/Renderer/ContextLimits.js +66 -33
- package/Source/Renderer/ShaderSource.js +19 -18
- package/Source/Renderer/Texture.js +1 -1
- package/Source/Renderer/Texture3D.js +166 -7
- package/Source/Renderer/TextureAtlas.js +10 -19
- package/Source/Scene/Appearance.js +1 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Azure2DImageryProvider.js +7 -8
- package/Source/Scene/Billboard.js +1 -1
- package/Source/Scene/BillboardCollection.js +15 -1
- package/Source/Scene/BillboardTexture.js +4 -1
- package/Source/Scene/Camera.js +13 -2
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/CloudCollection.js +2 -2
- package/Source/Scene/CumulusCloud.js +1 -1
- package/Source/Scene/DynamicEnvironmentMapManager.js +41 -26
- package/Source/Scene/Fog.js +1 -1
- package/Source/Scene/GaussianSplatPrimitive.js +1 -1
- package/Source/Scene/Globe.js +3 -10
- package/Source/Scene/GltfLoader.js +10 -0
- package/Source/Scene/ImageBasedLighting.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/ImageryProvider.js +2 -2
- package/Source/Scene/Label.js +1 -1
- package/Source/Scene/LabelCollection.js +2 -1
- package/Source/Scene/Material.js +1 -1
- package/Source/Scene/MaterialAppearance.js +1 -1
- package/Source/Scene/Megatexture.js +174 -242
- package/Source/Scene/Model/MaterialPipelineStage.js +17 -0
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/ModelComponents.js +10 -0
- package/Source/Scene/ParticleSystem.js +2 -2
- package/Source/Scene/PointPrimitive.js +1 -1
- package/Source/Scene/Polyline.js +0 -1
- package/Source/Scene/PolylineCollection.js +1 -4
- package/Source/Scene/PolylineColorAppearance.js +1 -6
- package/Source/Scene/PolylineMaterialAppearance.js +1 -6
- package/Source/Scene/PostProcessStageCollection.js +1 -1
- package/Source/Scene/QuadtreePrimitive.js +6 -3
- package/Source/Scene/ShadowMap.js +1 -2
- package/Source/Scene/Vector3DTileClampedPolylines.js +1 -5
- package/Source/Scene/Vector3DTilePolylines.js +1 -5
- package/Source/Scene/VoxelPrimitive.js +16 -33
- package/Source/Scene/VoxelRenderResources.js +1 -8
- package/Source/Scene/VoxelTraversal.js +16 -61
- package/Source/Scene/WebMapTileServiceImageryProvider.js +1 -1
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/processVoxelProperties.js +1 -1
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +8 -1
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
- package/Source/Shaders/Model/ModelFS.glsl +8 -0
- package/Source/Shaders/Model/ModelFS.js +8 -0
- package/Source/Shaders/Model/ModelVS.glsl +2 -0
- package/Source/Shaders/Model/ModelVS.js +2 -0
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +1 -1
- package/Source/Shaders/Voxels/IntersectionUtils.js +1 -1
- package/Source/Shaders/Voxels/Megatexture.glsl +15 -83
- package/Source/Shaders/Voxels/Megatexture.js +15 -83
- package/Source/Shaders/Voxels/Octree.glsl +6 -9
- package/Source/Shaders/Voxels/Octree.js +6 -9
- package/Source/Widget/CesiumWidget.js +1 -1
- package/Source/Workers/incrementallyBuildTerrainPicker.js +16 -2
- package/index.d.ts +32 -21
- package/index.js +52 -52
- package/package.json +4 -3
|
@@ -68,7 +68,8 @@ function Texture3D(options) {
|
|
|
68
68
|
sampler = new Sampler(),
|
|
69
69
|
} = options;
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
// 3D textures are not supported in a WebGL1 context. But we allow a stub context for testing.
|
|
72
|
+
if (!context.webgl2 && !defined(context.options.getWebGLStub)) {
|
|
72
73
|
throw new DeveloperError(
|
|
73
74
|
"WebGL1 does not support texture3D. Please use a WebGL2 context.",
|
|
74
75
|
);
|
|
@@ -113,25 +114,25 @@ function Texture3D(options) {
|
|
|
113
114
|
|
|
114
115
|
Check.typeOf.number.greaterThan("width", width, 0);
|
|
115
116
|
|
|
116
|
-
if (width > ContextLimits.
|
|
117
|
+
if (width > ContextLimits.maximum3DTextureSize) {
|
|
117
118
|
throw new DeveloperError(
|
|
118
|
-
`Width must be less than or equal to the maximum texture3D size (${ContextLimits.
|
|
119
|
+
`Width must be less than or equal to the maximum texture3D size (${ContextLimits.maximum3DTextureSize}). Check maximum3DTextureSize.`,
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
Check.typeOf.number.greaterThan("height", height, 0);
|
|
123
124
|
|
|
124
|
-
if (height > ContextLimits.
|
|
125
|
+
if (height > ContextLimits.maximum3DTextureSize) {
|
|
125
126
|
throw new DeveloperError(
|
|
126
|
-
`Height must be less than or equal to the maximum texture3D size (${ContextLimits.
|
|
127
|
+
`Height must be less than or equal to the maximum texture3D size (${ContextLimits.maximum3DTextureSize}). Check maximum3DTextureSize.`,
|
|
127
128
|
);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
Check.typeOf.number.greaterThan("depth", depth, 0);
|
|
131
132
|
|
|
132
|
-
if (depth > ContextLimits.
|
|
133
|
+
if (depth > ContextLimits.maximum3DTextureSize) {
|
|
133
134
|
throw new DeveloperError(
|
|
134
|
-
`Depth must be less than or equal to the maximum texture3D size (${ContextLimits.
|
|
135
|
+
`Depth must be less than or equal to the maximum texture3D size (${ContextLimits.maximum3DTextureSize}). Check maximum3DTextureSize.`,
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -333,6 +334,164 @@ function loadBufferSource(texture3D, source) {
|
|
|
333
334
|
}
|
|
334
335
|
}
|
|
335
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Copy new image data into this texture, from a source object with width, height, depth, and arrayBufferView properties.
|
|
339
|
+
* @param {object} options Object with the following properties:
|
|
340
|
+
* @param {object} options.source The source object with width, height, depth, and arrayBufferView properties.
|
|
341
|
+
* @param {number} [options.xOffset=0] The offset in the x direction within the texture to copy into.
|
|
342
|
+
* @param {number} [options.yOffset=0] The offset in the y direction within the texture to copy into.
|
|
343
|
+
* @param {number} [options.zOffset=0] The offset in the z direction within the texture to copy into.
|
|
344
|
+
* @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the texture will be ignored.
|
|
345
|
+
*
|
|
346
|
+
* @exception {DeveloperError} Unsupported copyFrom with a compressed texture pixel format.
|
|
347
|
+
* @exception {DeveloperError} xOffset must be greater than or equal to zero.
|
|
348
|
+
* @exception {DeveloperError} yOffset must be greater than or equal to zero.
|
|
349
|
+
* @exception {DeveloperError} zOffset must be greater than or equal to zero.
|
|
350
|
+
* @exception {DeveloperError} xOffset + source.width must be less than or equal to width.
|
|
351
|
+
* @exception {DeveloperError} yOffset + source.height must be less than or equal to height.
|
|
352
|
+
* @exception {DeveloperError} zOffset + source.depth must be less than or equal to depth.
|
|
353
|
+
* @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.
|
|
354
|
+
* @private
|
|
355
|
+
* @example
|
|
356
|
+
* texture.copyFrom({
|
|
357
|
+
* source: {
|
|
358
|
+
* width : 1,
|
|
359
|
+
* height : 1,
|
|
360
|
+
* depth : 1,
|
|
361
|
+
* arrayBufferView : new Uint8Array([255, 0, 0, 255])
|
|
362
|
+
* }
|
|
363
|
+
* });
|
|
364
|
+
*/
|
|
365
|
+
Texture3D.prototype.copyFrom = function (options) {
|
|
366
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
367
|
+
|
|
368
|
+
const { source, xOffset = 0, yOffset = 0, zOffset = 0 } = options;
|
|
369
|
+
|
|
370
|
+
//>>includeStart('debug', pragmas.debug);
|
|
371
|
+
Check.defined("options.source", source);
|
|
372
|
+
Check.defined("options.source.arrayBufferView", source.arrayBufferView);
|
|
373
|
+
if (PixelFormat.isCompressedFormat(this._pixelFormat)) {
|
|
374
|
+
throw new DeveloperError(
|
|
375
|
+
"Unsupported copyFrom with a compressed texture pixel format.",
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
Check.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
|
|
379
|
+
Check.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
|
|
380
|
+
Check.typeOf.number.greaterThanOrEquals("zOffset", zOffset, 0);
|
|
381
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
382
|
+
"xOffset + options.source.width",
|
|
383
|
+
xOffset + source.width,
|
|
384
|
+
this._width,
|
|
385
|
+
);
|
|
386
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
387
|
+
"yOffset + options.source.height",
|
|
388
|
+
yOffset + source.height,
|
|
389
|
+
this._height,
|
|
390
|
+
);
|
|
391
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
392
|
+
"zOffset + options.source.depth",
|
|
393
|
+
zOffset + source.depth,
|
|
394
|
+
this._depth,
|
|
395
|
+
);
|
|
396
|
+
//>>includeEnd('debug');
|
|
397
|
+
|
|
398
|
+
const context = this._context;
|
|
399
|
+
const gl = context._gl;
|
|
400
|
+
const target = this._textureTarget;
|
|
401
|
+
|
|
402
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
403
|
+
gl.bindTexture(target, this._texture);
|
|
404
|
+
|
|
405
|
+
const { width, height, depth } = source;
|
|
406
|
+
let uploaded = false;
|
|
407
|
+
if (!this._initialized) {
|
|
408
|
+
if (
|
|
409
|
+
xOffset === 0 &&
|
|
410
|
+
yOffset === 0 &&
|
|
411
|
+
zOffset === 0 &&
|
|
412
|
+
width === this._width &&
|
|
413
|
+
height === this._height &&
|
|
414
|
+
depth === this._depth
|
|
415
|
+
) {
|
|
416
|
+
loadBufferSource(this, source);
|
|
417
|
+
uploaded = true;
|
|
418
|
+
} else {
|
|
419
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
|
420
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
421
|
+
loadNull(this);
|
|
422
|
+
}
|
|
423
|
+
this._initialized = true;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (!uploaded) {
|
|
427
|
+
loadPartialBufferSource(
|
|
428
|
+
this,
|
|
429
|
+
source.arrayBufferView,
|
|
430
|
+
xOffset,
|
|
431
|
+
yOffset,
|
|
432
|
+
zOffset,
|
|
433
|
+
width,
|
|
434
|
+
height,
|
|
435
|
+
depth,
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
gl.bindTexture(target, null);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Load texel data from a buffer into part of a 3D texture
|
|
444
|
+
*
|
|
445
|
+
* @param {Texture3D} texture3D The texture3D to which texel values will be loaded.
|
|
446
|
+
* @param {TypedArray} arrayBufferView The texel values to be loaded into the texture3D.
|
|
447
|
+
* @param {number} xOffset The texel x coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
448
|
+
* @param {number} yOffset The texel y coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
449
|
+
* @param {number} zOffset The texel z coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
450
|
+
* @param {number} width The width of the source data, in pixels.
|
|
451
|
+
* @param {number} height The height of the source data, in pixels.
|
|
452
|
+
* @param {number} depth The depth of the source data, in pixels.
|
|
453
|
+
*
|
|
454
|
+
* @private
|
|
455
|
+
*/
|
|
456
|
+
function loadPartialBufferSource(
|
|
457
|
+
texture3D,
|
|
458
|
+
arrayBufferView,
|
|
459
|
+
xOffset,
|
|
460
|
+
yOffset,
|
|
461
|
+
zOffset,
|
|
462
|
+
width,
|
|
463
|
+
height,
|
|
464
|
+
depth,
|
|
465
|
+
) {
|
|
466
|
+
const context = texture3D._context;
|
|
467
|
+
const gl = context._gl;
|
|
468
|
+
|
|
469
|
+
const { pixelFormat, pixelDatatype } = texture3D;
|
|
470
|
+
|
|
471
|
+
const unpackAlignment = PixelFormat.alignmentInBytes(
|
|
472
|
+
pixelFormat,
|
|
473
|
+
pixelDatatype,
|
|
474
|
+
width,
|
|
475
|
+
);
|
|
476
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
|
|
477
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
|
478
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
479
|
+
|
|
480
|
+
gl.texSubImage3D(
|
|
481
|
+
texture3D._textureTarget,
|
|
482
|
+
0,
|
|
483
|
+
xOffset,
|
|
484
|
+
yOffset,
|
|
485
|
+
zOffset,
|
|
486
|
+
width,
|
|
487
|
+
height,
|
|
488
|
+
depth,
|
|
489
|
+
pixelFormat,
|
|
490
|
+
PixelDatatype.toWebGLConstant(pixelDatatype, context),
|
|
491
|
+
arrayBufferView,
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
336
495
|
/**
|
|
337
496
|
* Compute a dimension of the image for the next mip level.
|
|
338
497
|
*
|
|
@@ -364,26 +364,17 @@ TextureAtlas.prototype._resize = function (context, queueOffset = 0) {
|
|
|
364
364
|
toPack.push(queue[i]);
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
// At minimum,
|
|
368
|
-
|
|
369
|
-
|
|
367
|
+
// At minimum, atlas must fit its largest input images. Texture coordinates are
|
|
368
|
+
// compressed to 0–1 with 12-bit precision, so use power-of-two size to align pixels.
|
|
369
|
+
width = CesiumMath.nextPowerOfTwo(Math.max(maxWidth, width));
|
|
370
|
+
height = CesiumMath.nextPowerOfTwo(Math.max(maxHeight, height));
|
|
370
371
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
height = CesiumMath.nextPowerOfTwo(height);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
// Determine by what factor the texture need to be scaled by at minimum
|
|
377
|
-
const areaDifference = areaQueued;
|
|
378
|
-
let scalingFactor = 1.0;
|
|
379
|
-
while (areaDifference / width / height >= 1.0) {
|
|
380
|
-
scalingFactor *= 2.0;
|
|
381
|
-
|
|
382
|
-
// Resize by one dimension
|
|
372
|
+
// Iteratively double the smallest dimension until atlas area is (approximately) sufficient.
|
|
373
|
+
while (areaQueued >= width * height) {
|
|
383
374
|
if (width > height) {
|
|
384
|
-
height *=
|
|
375
|
+
height *= 2;
|
|
385
376
|
} else {
|
|
386
|
-
width *=
|
|
377
|
+
width *= 2;
|
|
387
378
|
}
|
|
388
379
|
}
|
|
389
380
|
|
|
@@ -650,7 +641,7 @@ async function resolveImage(image, id) {
|
|
|
650
641
|
* or a URL to an Image, or a Promise for an image, or a function that creates an image.
|
|
651
642
|
* @param {number} width A number specifying the width of the texture. If undefined, the image width will be used.
|
|
652
643
|
* @param {number} height A number specifying the height of the texture. If undefined, the image height will be used.
|
|
653
|
-
* @returns {Promise<number>
|
|
644
|
+
* @returns {Promise<number> | number} The image region index or a promise that resolves to it. -1 is returned if resources are in the process of being destroyed.
|
|
654
645
|
*/
|
|
655
646
|
TextureAtlas.prototype.addImage = function (id, image, width, height) {
|
|
656
647
|
//>>includeStart('debug', pragmas.debug);
|
|
@@ -666,7 +657,7 @@ TextureAtlas.prototype.addImage = function (id, image, width, height) {
|
|
|
666
657
|
}
|
|
667
658
|
if (defined(index)) {
|
|
668
659
|
// This image has already been added and resolved
|
|
669
|
-
return
|
|
660
|
+
return index;
|
|
670
661
|
}
|
|
671
662
|
|
|
672
663
|
index = this._nextIndex++;
|
|
@@ -28,7 +28,7 @@ import CullFace from "./CullFace.js";
|
|
|
28
28
|
* @see PolylineColorAppearance
|
|
29
29
|
* @see PolylineMaterialAppearance
|
|
30
30
|
*
|
|
31
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
31
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=geometry-and-appearances|Geometry and Appearances Demo}
|
|
32
32
|
*/
|
|
33
33
|
function Appearance(options) {
|
|
34
34
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"
|
|
7
|
+
"AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQBN5OwMQnvqcM3GTdzwDusCXj4eE5jKKONHLoPEAvNXnML4d2_ObFMHiYtbS6gOWoNlH6cNDium9FLGy4eRBK7mcDQKdokYzlY27y-WPo25dgjAfx6C0rbvGsk0yn7FHPv8yDcsW5frQhhXIJ48lW5UcbIlpxY_j-Im5MJfxgIQuUA_m0tvy4rxbkTMNS26yA.AT1_DJvNEaWq";
|
|
8
8
|
/**
|
|
9
9
|
* Default options for accessing the ArcGIS image tile service.
|
|
10
10
|
*
|
|
@@ -13,16 +13,15 @@ const trailingSlashRegex = /\/$/;
|
|
|
13
13
|
*
|
|
14
14
|
* Initialization options for the Azure2DImageryProvider constructor
|
|
15
15
|
*
|
|
16
|
-
* @property {
|
|
17
|
-
* @property {string} [
|
|
18
|
-
* @property {string}
|
|
19
|
-
* @property {
|
|
20
|
-
* @property {
|
|
21
|
-
* @property {number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
16
|
+
* @property {string} subscriptionKey The public subscription key for the imagery.
|
|
17
|
+
* @property {string} [url="https://atlas.microsoft.com/"] The Azure server url.
|
|
18
|
+
* @property {string} [tilesetId="microsoft.imagery"] The Azure tileset ID. Valid options are {@link microsoft.imagery}, {@link microsoft.base.road}, and {@link microsoft.base.labels.road}
|
|
19
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
20
|
+
* @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
22
21
|
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
|
|
23
22
|
* to result in rendering problems.
|
|
24
|
-
* @property {number} [
|
|
25
|
-
* @property {Rectangle} [
|
|
23
|
+
* @property {number} [maximumLevel=22] The maximum level-of-detail supported by the imagery provider.
|
|
24
|
+
* @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.
|
|
26
25
|
*/
|
|
27
26
|
|
|
28
27
|
/**
|
|
@@ -93,7 +93,7 @@ import isDataUri from "../Core/isDataUri.js";
|
|
|
93
93
|
* @param {Billboard.ConstructorOptions} options Object describing initialization options
|
|
94
94
|
* @param {BillboardCollection} billboardCollection Instance of BillboardCollection
|
|
95
95
|
*
|
|
96
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
96
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=billboards|Cesium Sandcastle Billboard Demo}
|
|
97
97
|
*/
|
|
98
98
|
function Billboard(options, billboardCollection) {
|
|
99
99
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -35,6 +35,7 @@ import TextureAtlas from "../Renderer/TextureAtlas.js";
|
|
|
35
35
|
import VerticalOrigin from "./VerticalOrigin.js";
|
|
36
36
|
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
37
37
|
import WebGLConstants from "../Core/WebGLConstants.js";
|
|
38
|
+
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
38
39
|
|
|
39
40
|
const SHOW_INDEX = Billboard.SHOW_INDEX;
|
|
40
41
|
const POSITION_INDEX = Billboard.POSITION_INDEX;
|
|
@@ -129,7 +130,7 @@ const attributeLocationsInstanced = {
|
|
|
129
130
|
* @see Billboard
|
|
130
131
|
* @see LabelCollection
|
|
131
132
|
*
|
|
132
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
133
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=billboards|Cesium Sandcastle Billboard Demo}
|
|
133
134
|
*
|
|
134
135
|
* @example
|
|
135
136
|
* // Create a billboard collection with two billboards
|
|
@@ -1784,6 +1785,19 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
1784
1785
|
}
|
|
1785
1786
|
|
|
1786
1787
|
const context = frameState.context;
|
|
1788
|
+
|
|
1789
|
+
if (
|
|
1790
|
+
!context.instancedArrays ||
|
|
1791
|
+
!(ContextLimits.maximumVertexTextureImageUnits > 0)
|
|
1792
|
+
) {
|
|
1793
|
+
deprecationWarning(
|
|
1794
|
+
"Billboard-unsupported-ANGLE_instanced_arrays",
|
|
1795
|
+
"Beginning in CesiumJS 1.140, billboards and labels will require device support for WebGL 2, " +
|
|
1796
|
+
"or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more " +
|
|
1797
|
+
"information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053",
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1787
1801
|
this._instanced = context.instancedArrays;
|
|
1788
1802
|
attributeLocations = this._instanced
|
|
1789
1803
|
? attributeLocationsInstanced
|
|
@@ -199,7 +199,10 @@ BillboardTexture.prototype.loadImage = async function (
|
|
|
199
199
|
let index;
|
|
200
200
|
const atlas = this._billboardCollection.textureAtlas;
|
|
201
201
|
try {
|
|
202
|
-
index =
|
|
202
|
+
index = atlas.addImage(id, image, width, height);
|
|
203
|
+
if (index instanceof Promise) {
|
|
204
|
+
index = await index;
|
|
205
|
+
}
|
|
203
206
|
} catch (error) {
|
|
204
207
|
// There was an error loading the image
|
|
205
208
|
billboardTexture._loadState = BillboardLoadState.ERROR;
|
package/Source/Scene/Camera.js
CHANGED
|
@@ -63,8 +63,8 @@ import SceneMode from "./SceneMode.js";
|
|
|
63
63
|
*
|
|
64
64
|
* @param {Scene} scene The scene.
|
|
65
65
|
*
|
|
66
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
67
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
66
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=camera|Cesium Sandcastle Camera Demo}
|
|
67
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=camera-tutorial|Cesium Sandcastle Camera Tutorial Example}
|
|
68
68
|
* @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
@@ -3005,6 +3005,17 @@ function getPickRayOrthographic(camera, windowPosition, result) {
|
|
|
3005
3005
|
|
|
3006
3006
|
Cartesian3.clone(camera.directionWC, result.direction);
|
|
3007
3007
|
|
|
3008
|
+
// Account for wrap-around in 2D infinite scroll mode
|
|
3009
|
+
if (
|
|
3010
|
+
camera._mode === SceneMode.SCENE2D &&
|
|
3011
|
+
camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL
|
|
3012
|
+
) {
|
|
3013
|
+
const maxHorizontal = camera._maxCoord.x;
|
|
3014
|
+
origin.y =
|
|
3015
|
+
CesiumMath.mod(origin.y + maxHorizontal, 2.0 * maxHorizontal) -
|
|
3016
|
+
maxHorizontal;
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3008
3019
|
return result;
|
|
3009
3020
|
}
|
|
3010
3021
|
|
|
@@ -41,8 +41,8 @@ import ClippingPlane from "./ClippingPlane.js";
|
|
|
41
41
|
* @param {Color} [options.edgeColor=Color.WHITE] The color applied to highlight the edge along which an object is clipped.
|
|
42
42
|
* @param {number} [options.edgeWidth=0.0] The width, in pixels, of the highlight applied to the edge along which an object is clipped.
|
|
43
43
|
*
|
|
44
|
-
* @demo {@link https://sandcastle.cesium.com/?
|
|
45
|
-
* @demo {@link https://sandcastle.cesium.com/?
|
|
44
|
+
* @demo {@link https://sandcastle.cesium.com/?id=3d-tiles-clipping-planes|Clipping 3D Tiles and glTF models.}
|
|
45
|
+
* @demo {@link https://sandcastle.cesium.com/?id=terrain-clipping-planes|Clipping the Globe.}
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* // This clipping plane's distance is positive, which means its normal
|
|
@@ -86,8 +86,8 @@ const COLOR_INDEX = CumulusCloud.COLOR_INDEX;
|
|
|
86
86
|
* @see CloudCollection#remove
|
|
87
87
|
* @see CumulusCloud
|
|
88
88
|
*
|
|
89
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
90
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
89
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=clouds|Cesium Sandcastle Clouds Demo}
|
|
90
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=cloud-parameters|Cesium Sandcastle Cloud Parameters Demo}
|
|
91
91
|
*
|
|
92
92
|
* @example
|
|
93
93
|
* // Create a cloud collection with two cumulus clouds
|
|
@@ -31,7 +31,7 @@ import defined from "../Core/defined.js";
|
|
|
31
31
|
* @internalConstructor
|
|
32
32
|
* @class
|
|
33
33
|
*
|
|
34
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
34
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=cloud-parameters|Cesium Sandcastle Cloud Parameters Demo}
|
|
35
35
|
*/
|
|
36
36
|
function CumulusCloud(options, cloudCollection) {
|
|
37
37
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -33,7 +33,7 @@ import ConvolveSpecularMapVS from "../Shaders/ConvolveSpecularMapVS.js";
|
|
|
33
33
|
* @typedef {object} DynamicEnvironmentMapManager.ConstructorOptions
|
|
34
34
|
* Options for the DynamicEnvironmentMapManager constructor
|
|
35
35
|
* @property {boolean} [enabled=true] If true, the environment map and related properties will continue to update.
|
|
36
|
-
* @property {number} [mipmapLevels=7] The number of mipmap levels to generate for specular maps. More mipmap levels will produce a higher resolution specular reflection.
|
|
36
|
+
* @property {number} [mipmapLevels=7] The maximum desired number of mipmap levels to generate for specular maps. More mipmap levels will produce a higher resolution specular reflection. The actual number of mipmaps used will be bounded by the cubemap texture size supported on the client machine. The number of mipmaps must be at least one for the environment map to be generated.
|
|
37
37
|
* @property {number} [maximumSecondsDifference=3600] The maximum amount of elapsed seconds before a new environment map is created.
|
|
38
38
|
* @property {number} [maximumPositionEpsilon=1000] The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results.
|
|
39
39
|
* @property {number} [atmosphereScatteringIntensity=2.0] The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of {@link Scene.light} intensity.
|
|
@@ -81,14 +81,21 @@ function DynamicEnvironmentMapManager(options) {
|
|
|
81
81
|
|
|
82
82
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
83
83
|
|
|
84
|
-
const mipmapLevels = Math.
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
const mipmapLevels = Math.max(
|
|
85
|
+
Math.floor(
|
|
86
|
+
Math.min(
|
|
87
|
+
options.mipmapLevels ?? 7,
|
|
88
|
+
Math.log2(ContextLimits.maximumCubeMapSize),
|
|
89
|
+
),
|
|
90
|
+
),
|
|
91
|
+
0,
|
|
87
92
|
);
|
|
88
93
|
|
|
89
94
|
this._mipmapLevels = mipmapLevels;
|
|
95
|
+
|
|
96
|
+
const arrayLength = Math.max(mipmapLevels - 1, 0) * 6;
|
|
90
97
|
this._radianceMapComputeCommands = new Array(6);
|
|
91
|
-
this._convolutionComputeCommands = new Array(
|
|
98
|
+
this._convolutionComputeCommands = new Array(arrayLength);
|
|
92
99
|
this._irradianceComputeCommand = undefined;
|
|
93
100
|
|
|
94
101
|
this._radianceMapFS = undefined;
|
|
@@ -97,7 +104,7 @@ function DynamicEnvironmentMapManager(options) {
|
|
|
97
104
|
this._va = undefined;
|
|
98
105
|
|
|
99
106
|
this._radianceMapTextures = new Array(6);
|
|
100
|
-
this._specularMapTextures = new Array(
|
|
107
|
+
this._specularMapTextures = new Array(arrayLength);
|
|
101
108
|
this._radianceCubeMap = undefined;
|
|
102
109
|
this._irradianceMapTexture = undefined;
|
|
103
110
|
|
|
@@ -105,7 +112,7 @@ function DynamicEnvironmentMapManager(options) {
|
|
|
105
112
|
DynamicEnvironmentMapManager.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice();
|
|
106
113
|
|
|
107
114
|
this._lastTime = new JulianDate();
|
|
108
|
-
const width = Math.pow(2, mipmapLevels - 1);
|
|
115
|
+
const width = Math.max(Math.pow(2, mipmapLevels - 1), 1);
|
|
109
116
|
this._textureDimensions = new Cartesian2(width, width);
|
|
110
117
|
|
|
111
118
|
this._radiiAndDynamicAtmosphereColor = new Cartesian3();
|
|
@@ -621,6 +628,28 @@ function updateSpecularMaps(manager, frameState) {
|
|
|
621
628
|
const context = frameState.context;
|
|
622
629
|
|
|
623
630
|
let facesCopied = 0;
|
|
631
|
+
const checkComplete = () => {
|
|
632
|
+
// All faces for each mipmap level have been copied
|
|
633
|
+
const length = manager._specularMapTextures.length;
|
|
634
|
+
if (facesCopied >= length) {
|
|
635
|
+
manager._irradianceCommandDirty = true;
|
|
636
|
+
|
|
637
|
+
if (mipmapLevels > 1) {
|
|
638
|
+
radianceCubeMap.sampler = new Sampler({
|
|
639
|
+
minificationFilter: TextureMinificationFilter.LINEAR_MIPMAP_LINEAR,
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
manager._shouldRegenerateShaders = true;
|
|
643
|
+
|
|
644
|
+
// Cleanup shared resources
|
|
645
|
+
manager._va.destroy();
|
|
646
|
+
manager._va = undefined;
|
|
647
|
+
manager._convolveSP.destroy();
|
|
648
|
+
manager._convolveSP = undefined;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
|
|
624
653
|
const getPostExecute = (command, index, texture, face, level) => () => {
|
|
625
654
|
if (manager.isDestroyed() || command.canceled) {
|
|
626
655
|
DynamicEnvironmentMapManager._activeComputeCommandCount--;
|
|
@@ -638,22 +667,7 @@ function updateSpecularMaps(manager, frameState) {
|
|
|
638
667
|
texture.destroy();
|
|
639
668
|
manager._specularMapTextures[index] = undefined;
|
|
640
669
|
|
|
641
|
-
|
|
642
|
-
const length = manager._specularMapTextures.length;
|
|
643
|
-
if (facesCopied >= length) {
|
|
644
|
-
manager._irradianceCommandDirty = true;
|
|
645
|
-
radianceCubeMap.sampler = new Sampler({
|
|
646
|
-
minificationFilter: TextureMinificationFilter.LINEAR_MIPMAP_LINEAR,
|
|
647
|
-
});
|
|
648
|
-
|
|
649
|
-
manager._shouldRegenerateShaders = true;
|
|
650
|
-
|
|
651
|
-
// Cleanup shared resources
|
|
652
|
-
manager._va.destroy();
|
|
653
|
-
manager._va = undefined;
|
|
654
|
-
manager._convolveSP.destroy();
|
|
655
|
-
manager._convolveSP = undefined;
|
|
656
|
-
}
|
|
670
|
+
checkComplete();
|
|
657
671
|
};
|
|
658
672
|
|
|
659
673
|
let index = 0;
|
|
@@ -721,6 +735,7 @@ function updateSpecularMaps(manager, frameState) {
|
|
|
721
735
|
width /= 2;
|
|
722
736
|
height /= 2;
|
|
723
737
|
}
|
|
738
|
+
checkComplete();
|
|
724
739
|
}
|
|
725
740
|
|
|
726
741
|
const irradianceTextureDimensions = new Cartesian2(3, 3); // 9 coefficients
|
|
@@ -839,9 +854,9 @@ function updateSphericalHarmonicCoefficients(manager, frameState) {
|
|
|
839
854
|
DynamicEnvironmentMapManager.prototype.update = function (frameState) {
|
|
840
855
|
const mode = frameState.mode;
|
|
841
856
|
const isSupported =
|
|
842
|
-
// A FrameState type works here because the function only references the context parameter.
|
|
843
|
-
|
|
844
|
-
|
|
857
|
+
// @ts-expect-error A FrameState type works here because the function only references the context parameter.
|
|
858
|
+
DynamicEnvironmentMapManager.isDynamicUpdateSupported(frameState) &&
|
|
859
|
+
this._mipmapLevels >= 1;
|
|
845
860
|
|
|
846
861
|
if (
|
|
847
862
|
!isSupported ||
|
package/Source/Scene/Fog.js
CHANGED
|
@@ -8,7 +8,7 @@ import SceneMode from "./SceneMode.js";
|
|
|
8
8
|
* Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
|
|
9
9
|
* performance improvements by rendering less geometry and dispatching less terrain requests.
|
|
10
10
|
*
|
|
11
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
11
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=fog|Cesium Sandcastle Fog Demo}
|
|
12
12
|
*
|
|
13
13
|
* @alias Fog
|
|
14
14
|
* @constructor
|
|
@@ -788,7 +788,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
|
|
|
788
788
|
cull: renderStateOptions.cull.enabled,
|
|
789
789
|
pass: Pass.GAUSSIAN_SPLATS,
|
|
790
790
|
count: renderResources.count,
|
|
791
|
-
owner:
|
|
791
|
+
owner: primitive,
|
|
792
792
|
instanceCount: renderResources.instanceCount,
|
|
793
793
|
primitiveType: PrimitiveType.TRIANGLE_STRIP,
|
|
794
794
|
debugShowBoundingVolume: tileset.debugShowBoundingVolume,
|
package/Source/Scene/Globe.js
CHANGED
|
@@ -723,14 +723,7 @@ Globe.prototype.pickWorldCoordinates = function (
|
|
|
723
723
|
const sphereIntersections = scratchArray;
|
|
724
724
|
sphereIntersections.length = 0;
|
|
725
725
|
|
|
726
|
-
const
|
|
727
|
-
let length = tilesToRender.length;
|
|
728
|
-
|
|
729
|
-
let tile;
|
|
730
|
-
let i;
|
|
731
|
-
|
|
732
|
-
for (i = 0; i < length; ++i) {
|
|
733
|
-
tile = tilesToRender[i];
|
|
726
|
+
for (const tile of this._surface._tilesRenderedThisFrame) {
|
|
734
727
|
const surfaceTile = tile.data;
|
|
735
728
|
|
|
736
729
|
if (!defined(surfaceTile)) {
|
|
@@ -776,8 +769,8 @@ Globe.prototype.pickWorldCoordinates = function (
|
|
|
776
769
|
sphereIntersections.sort(createComparePickTileFunction(ray.origin));
|
|
777
770
|
|
|
778
771
|
let intersection;
|
|
779
|
-
length = sphereIntersections.length;
|
|
780
|
-
for (i = 0; i < length; ++i) {
|
|
772
|
+
const length = sphereIntersections.length;
|
|
773
|
+
for (let i = 0; i < length; ++i) {
|
|
781
774
|
intersection = sphereIntersections[i].pick(
|
|
782
775
|
ray,
|
|
783
776
|
scene.mode,
|
|
@@ -1811,6 +1811,16 @@ function loadMaterial(loader, gltfMaterial, frameState) {
|
|
|
1811
1811
|
material.alphaCutoff = gltfMaterial.alphaCutoff;
|
|
1812
1812
|
material.doubleSided = gltfMaterial.doubleSided;
|
|
1813
1813
|
|
|
1814
|
+
// BENTLEY_materials_point_style extension
|
|
1815
|
+
const pointStyleExtension = extensions.BENTLEY_materials_point_style;
|
|
1816
|
+
if (defined(pointStyleExtension) && defined(pointStyleExtension.diameter)) {
|
|
1817
|
+
const diameter = pointStyleExtension.diameter;
|
|
1818
|
+
// The spec requires a positive integer, but we floor non-integers as a best effort.
|
|
1819
|
+
if (diameter >= 1) {
|
|
1820
|
+
material.pointDiameter = Math.floor(diameter);
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1814
1824
|
return material;
|
|
1815
1825
|
}
|
|
1816
1826
|
|
|
@@ -162,7 +162,7 @@ Object.defineProperties(ImageBasedLighting.prototype, {
|
|
|
162
162
|
* @memberof ImageBasedLighting.prototype
|
|
163
163
|
*
|
|
164
164
|
* @type {Cartesian3[]}
|
|
165
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
165
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=image-based-lighting|Sandcastle Image Based Lighting Demo}
|
|
166
166
|
* @see {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf|An Efficient Representation for Irradiance Environment Maps}
|
|
167
167
|
*/
|
|
168
168
|
sphericalHarmonicCoefficients: {
|
|
@@ -187,7 +187,7 @@ Object.defineProperties(ImageBasedLighting.prototype, {
|
|
|
187
187
|
* A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
|
|
188
188
|
*
|
|
189
189
|
* @memberof ImageBasedLighting.prototype
|
|
190
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
190
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=image-based-lighting|Sandcastle Image Based Lighting Demo}
|
|
191
191
|
* @type {string}
|
|
192
192
|
* @see ImageBasedLighting#sphericalHarmonicCoefficients
|
|
193
193
|
*/
|
|
@@ -13,8 +13,8 @@ import ImageryLayer from "./ImageryLayer.js";
|
|
|
13
13
|
* @constructor
|
|
14
14
|
* @see {@link Scene#imageryLayers} for manipulating imagery layers on the globe.
|
|
15
15
|
* @see {@link Cesium3DTileset#imageryLayers} for manipulating imagery layers on a 3D tileset.
|
|
16
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
17
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
16
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=imagery-adjustment|Cesium Sandcastle Imagery Adjustment Demo}
|
|
17
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=imagery-layers-manipulation|Cesium Sandcastle Imagery Manipulation Demo}
|
|
18
18
|
*/
|
|
19
19
|
function ImageryLayerCollection() {
|
|
20
20
|
this._layers = [];
|