@cesium/engine 11.1.0 → 12.0.1
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-U72QNFOJ.js → chunk-22FZ334F.js} +10 -10
- package/Build/Workers/{chunk-GNBFYG7F.js → chunk-2F42VIW6.js} +13 -13
- package/Build/Workers/{chunk-K4GQUNB5.js → chunk-2IJZVFHY.js} +5 -5
- package/Build/Workers/{chunk-7KTQP4VB.js → chunk-2XOUWNPN.js} +5 -5
- package/Build/Workers/{chunk-IBLIYJZR.js → chunk-3Y4UGAYI.js} +6 -6
- package/Build/Workers/{chunk-VJZB3WAV.js → chunk-54NYY4U4.js} +7 -7
- package/Build/Workers/{chunk-DHYHSFFJ.js → chunk-647NL6VU.js} +2 -2
- package/Build/Workers/{chunk-CKY7HOHV.js → chunk-76KRKKEF.js} +9 -9
- package/Build/Workers/{chunk-BHQJ2NT7.js → chunk-7CKQ7PVJ.js} +6 -6
- package/Build/Workers/{chunk-5PTXS2GO.js → chunk-7D6T2WYT.js} +7 -7
- package/Build/Workers/{chunk-PRGYLLJT.js → chunk-7EBHNJTG.js} +1 -1
- package/Build/Workers/{chunk-YFXQECWV.js → chunk-AER5CLXD.js} +5 -5
- package/Build/Workers/{chunk-N5KJGGCM.js → chunk-AGYO4ZSF.js} +17 -17
- package/Build/Workers/{chunk-VU2MNO7L.js → chunk-BH5M522L.js} +7 -7
- package/Build/Workers/{chunk-MXIZJAPH.js → chunk-COHL4R3G.js} +1 -1
- package/Build/Workers/{chunk-FIGIZHAQ.js → chunk-DJ7K7EYK.js} +11 -11
- package/Build/Workers/{chunk-3Q2L65QU.js → chunk-DR56WFYZ.js} +7 -7
- package/Build/Workers/{chunk-AD63PIY6.js → chunk-EMCXAVSG.js} +2 -2
- package/Build/Workers/{chunk-YSGTGQQO.js → chunk-ENARO52I.js} +14 -14
- package/Build/Workers/{chunk-5OOFQLKF.js → chunk-ETXXXGMP.js} +7 -7
- package/Build/Workers/{chunk-E27BLMDD.js → chunk-GBPW65E3.js} +6 -6
- package/Build/Workers/{chunk-NGPPMXRM.js → chunk-GRQQHWMD.js} +7 -7
- package/Build/Workers/{chunk-SMDOP47J.js → chunk-GSJ6LWIS.js} +10 -10
- package/Build/Workers/{chunk-26GA3JAM.js → chunk-H3RMGG7L.js} +5 -5
- package/Build/Workers/{chunk-PGRPDNHG.js → chunk-IAX6MIST.js} +17 -17
- package/Build/Workers/{chunk-5ODQSF26.js → chunk-IJWXYSFC.js} +2 -2
- package/Build/Workers/{chunk-C6YYBQXW.js → chunk-IVCFTVYW.js} +4 -4
- package/Build/Workers/{chunk-JW4FOI6M.js → chunk-JAKTB6CE.js} +11 -11
- package/Build/Workers/{chunk-TKVT5GQM.js → chunk-JPNFQRN7.js} +13 -13
- package/Build/Workers/{chunk-E63IIM5T.js → chunk-K7QC3WDT.js} +1 -1
- package/Build/Workers/{chunk-TGONEMZO.js → chunk-KJ65M35B.js} +11 -11
- package/Build/Workers/{chunk-2ZGOQXYU.js → chunk-KKMH4BKN.js} +6 -6
- package/Build/Workers/{chunk-76BYBWHP.js → chunk-LBNGHEJY.js} +4 -4
- package/Build/Workers/{chunk-XY4BATBS.js → chunk-LVHHB5T6.js} +4 -4
- package/Build/Workers/{chunk-S6MRMMQU.js → chunk-MV7YO647.js} +6 -6
- package/Build/Workers/{chunk-6CHGCNMW.js → chunk-NELAPOO6.js} +2 -2
- package/Build/Workers/{chunk-GESF4OXQ.js → chunk-NL73INJS.js} +2 -2
- package/Build/Workers/{chunk-GGZJN2TI.js → chunk-PH3T7LNP.js} +15 -15
- package/Build/Workers/{chunk-YZ733KKS.js → chunk-PISTPJXS.js} +12 -12
- package/Build/Workers/{chunk-GWCFU2SA.js → chunk-PJHRB4YJ.js} +7 -7
- package/Build/Workers/{chunk-I2ITFFPX.js → chunk-PNA47CR7.js} +1 -1
- package/Build/Workers/{chunk-7JO7GPJN.js → chunk-Q7IIOKAT.js} +1 -1
- package/Build/Workers/{chunk-27HUZ7SA.js → chunk-U7SH6OK7.js} +4 -4
- package/Build/Workers/{chunk-M3GMB5OP.js → chunk-VHGI7D3P.js} +10 -10
- package/Build/Workers/{chunk-FDOV2LBJ.js → chunk-VO4SXJXT.js} +7 -7
- package/Build/Workers/{chunk-7BMOHCPM.js → chunk-VXVQITFC.js} +13 -13
- package/Build/Workers/{chunk-DI5NGJUP.js → chunk-WMHJAREU.js} +2 -2
- package/Build/Workers/{chunk-EJZTDTUH.js → chunk-X6YBZOOA.js} +4 -4
- package/Build/Workers/{chunk-472HQ3EH.js → chunk-XDJ7V4NZ.js} +5 -5
- package/Build/Workers/{chunk-E6V6SQZW.js → chunk-YT5PQMSP.js} +6 -6
- package/Build/Workers/{chunk-O3E4OAOE.js → chunk-ZCCI55EY.js} +13 -13
- package/Build/Workers/{chunk-7O373FFS.js → chunk-ZPTNVB3S.js} +8 -8
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +20 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/BoundingSphere.js +1 -1
- package/Source/Core/Color.js +1 -1
- package/Source/Core/CorridorGeometryLibrary.js +4 -4
- package/Source/Core/EllipseGeometry.js +1 -1
- package/Source/Core/EllipsoidGeodesic.js +1 -1
- package/Source/Core/FrustumGeometry.js +1 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/Math.js +2 -0
- package/Source/Core/PolylineVolumeGeometryLibrary.js +2 -2
- package/Source/Core/decodeGoogleEarthEnterpriseData.js +1 -1
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/ModelGraphics.js +1 -0
- package/Source/Renderer/AutomaticUniforms.js +13 -0
- package/Source/Renderer/CubeMap.js +89 -12
- package/Source/Renderer/CubeMapFace.js +90 -13
- package/Source/Renderer/UniformState.js +13 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Atmosphere.js +22 -0
- package/Source/Scene/BingMapsImageryProvider.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +39 -0
- package/Source/Scene/DynamicEnvironmentMapManager.js +894 -0
- package/Source/Scene/Fog.js +75 -82
- package/Source/Scene/FrameState.js +5 -3
- package/Source/Scene/ImageBasedLighting.js +7 -64
- package/Source/Scene/Model/AtmospherePipelineStage.js +10 -5
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +43 -21
- package/Source/Scene/Model/Model.js +98 -25
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelSceneGraph.js +1 -0
- package/Source/Scene/ScreenSpaceCameraController.js +20 -1
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +44 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +44 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.glsl +0 -1
- package/Source/Shaders/Builtin/Functions/computeScattering.js +0 -1
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl +3 -1
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.js +3 -1
- package/Source/Shaders/ComputeIrradianceFS.glsl +103 -0
- package/Source/Shaders/ComputeIrradianceFS.js +105 -0
- package/Source/Shaders/ComputeRadianceMapFS.glsl +107 -0
- package/Source/Shaders/ComputeRadianceMapFS.js +109 -0
- package/Source/Shaders/ConvolveSpecularMapFS.glsl +70 -0
- package/Source/Shaders/ConvolveSpecularMapFS.js +72 -0
- package/Source/Shaders/ConvolveSpecularMapVS.glsl +24 -0
- package/Source/Shaders/ConvolveSpecularMapVS.js +26 -0
- package/Source/Shaders/GlobeFS.glsl +1 -2
- package/Source/Shaders/GlobeFS.js +1 -2
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +1 -4
- package/Source/Shaders/Model/AtmosphereStageFS.js +1 -4
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +2 -155
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +3 -156
- package/Source/Shaders/Model/LightingStageFS.glsl +3 -22
- package/Source/Shaders/Model/LightingStageFS.js +3 -22
- package/Source/Shaders/SkyBoxVS.glsl +0 -1
- package/Source/Shaders/SkyBoxVS.js +0 -1
- package/Source/Widget/CesiumWidget.js +776 -1
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +1 -1
- package/index.d.ts +281 -12
- package/index.js +62 -57
- package/package.json +2 -2
|
@@ -245,25 +245,22 @@ CubeMapFace.prototype.copyFrom = function (options) {
|
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
247
|
* Copies texels from the framebuffer to the cubemap's face.
|
|
248
|
-
*
|
|
249
248
|
* @param {number} [xOffset=0] An offset in the x direction in the cubemap where copying begins.
|
|
250
249
|
* @param {number} [yOffset=0] An offset in the y direction in the cubemap where copying begins.
|
|
251
250
|
* @param {number} [framebufferXOffset=0] An offset in the x direction in the framebuffer where copying begins from.
|
|
252
251
|
* @param {number} [framebufferYOffset=0] An offset in the y direction in the framebuffer where copying begins from.
|
|
253
252
|
* @param {number} [width=CubeMap's width] The width of the subimage to copy.
|
|
254
253
|
* @param {number} [height=CubeMap's height] The height of the subimage to copy.
|
|
255
|
-
*
|
|
256
|
-
* @
|
|
257
|
-
* @
|
|
258
|
-
* @
|
|
259
|
-
* @
|
|
260
|
-
* @
|
|
261
|
-
* @
|
|
262
|
-
* @
|
|
263
|
-
* @
|
|
264
|
-
* @
|
|
265
|
-
* @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.
|
|
266
|
-
*
|
|
254
|
+
* @throws {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.
|
|
255
|
+
* @throws {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.
|
|
256
|
+
* @throws {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.
|
|
257
|
+
* @throws {DeveloperError} xOffset must be greater than or equal to zero.
|
|
258
|
+
* @throws {DeveloperError} yOffset must be greater than or equal to zero.
|
|
259
|
+
* @throws {DeveloperError} framebufferXOffset must be greater than or equal to zero.
|
|
260
|
+
* @throws {DeveloperError} framebufferYOffset must be greater than or equal to zero.
|
|
261
|
+
* @throws {DeveloperError} xOffset + source.width must be less than or equal to width.
|
|
262
|
+
* @throws {DeveloperError} yOffset + source.height must be less than or equal to height.
|
|
263
|
+
* @throws {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.
|
|
267
264
|
* @example
|
|
268
265
|
* // Copy the framebuffer contents to the +x cube map face.
|
|
269
266
|
* cubeMap.positiveX.copyFromFramebuffer();
|
|
@@ -336,4 +333,84 @@ CubeMapFace.prototype.copyFromFramebuffer = function (
|
|
|
336
333
|
gl.bindTexture(target, null);
|
|
337
334
|
this._initialized = true;
|
|
338
335
|
};
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Copies texels from the framebuffer to the cubemap's face mipmap.
|
|
339
|
+
* @param {number} [xOffset=0] An offset in the x direction in the framebuffer where copying begins from.
|
|
340
|
+
* @param {number} [yOffset=0] An offset in the y direction in the framebuffer where copying begins from.
|
|
341
|
+
* @param {number} [width=CubeMap's width] The width of the subimage to copy.
|
|
342
|
+
* @param {number} [height=CubeMap's height] The height of the subimage to copy.
|
|
343
|
+
* @param {number} [level=0] The level of detail. Level 0 is the base image level and level n is the n-th mipmap reduction level.
|
|
344
|
+
* @throws {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.
|
|
345
|
+
* @throws {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.
|
|
346
|
+
* @throws {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.
|
|
347
|
+
* @throws {DeveloperError} xOffset must be greater than or equal to zero.
|
|
348
|
+
* @throws {DeveloperError} yOffset must be greater than or equal to zero.
|
|
349
|
+
* @throws {DeveloperError} framebufferXOffset must be greater than or equal to zero.
|
|
350
|
+
* @throws {DeveloperError} framebufferYOffset must be greater than or equal to zero.
|
|
351
|
+
* @throws {DeveloperError} xOffset + source.width must be less than or equal to width.
|
|
352
|
+
* @throws {DeveloperError} yOffset + source.height must be less than or equal to height.
|
|
353
|
+
* @throws {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* // Copy the framebuffer contents to the +x cube map face.
|
|
357
|
+
* cubeMap.positiveX.copyFromFramebuffer();
|
|
358
|
+
*/
|
|
359
|
+
CubeMapFace.prototype.copyMipmapFromFramebuffer = function (
|
|
360
|
+
xOffset,
|
|
361
|
+
yOffset,
|
|
362
|
+
width,
|
|
363
|
+
height,
|
|
364
|
+
level,
|
|
365
|
+
) {
|
|
366
|
+
xOffset = defaultValue(xOffset, 0);
|
|
367
|
+
yOffset = defaultValue(yOffset, 0);
|
|
368
|
+
width = defaultValue(width, this._size);
|
|
369
|
+
height = defaultValue(height, this._size);
|
|
370
|
+
level = defaultValue(level, 0);
|
|
371
|
+
|
|
372
|
+
//>>includeStart('debug', pragmas.debug);
|
|
373
|
+
Check.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
|
|
374
|
+
Check.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
|
|
375
|
+
|
|
376
|
+
if (xOffset + width > this._size) {
|
|
377
|
+
throw new DeveloperError(
|
|
378
|
+
"xOffset + source.width must be less than or equal to width.",
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
if (yOffset + height > this._size) {
|
|
382
|
+
throw new DeveloperError(
|
|
383
|
+
"yOffset + source.height must be less than or equal to height.",
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
if (this._pixelDatatype === PixelDatatype.FLOAT) {
|
|
387
|
+
throw new DeveloperError(
|
|
388
|
+
"Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.",
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
if (this._pixelDatatype === PixelDatatype.HALF_FLOAT) {
|
|
392
|
+
throw new DeveloperError(
|
|
393
|
+
"Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.",
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
//>>includeEnd('debug');
|
|
397
|
+
|
|
398
|
+
const gl = this._context._gl;
|
|
399
|
+
const target = this._textureTarget;
|
|
400
|
+
|
|
401
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
402
|
+
gl.bindTexture(target, this._texture);
|
|
403
|
+
gl.copyTexImage2D(
|
|
404
|
+
this._targetFace,
|
|
405
|
+
level,
|
|
406
|
+
this._internalFormat,
|
|
407
|
+
xOffset,
|
|
408
|
+
yOffset,
|
|
409
|
+
width,
|
|
410
|
+
height,
|
|
411
|
+
0,
|
|
412
|
+
);
|
|
413
|
+
gl.bindTexture(target, null);
|
|
414
|
+
this._initialized = true;
|
|
415
|
+
};
|
|
339
416
|
export default CubeMapFace;
|
|
@@ -160,6 +160,7 @@ function UniformState() {
|
|
|
160
160
|
this._specularEnvironmentMapsMaximumLOD = undefined;
|
|
161
161
|
|
|
162
162
|
this._fogDensity = undefined;
|
|
163
|
+
this._fogVisualDensityScalar = undefined;
|
|
163
164
|
this._fogMinimumBrightness = undefined;
|
|
164
165
|
|
|
165
166
|
this._atmosphereHsbShift = undefined;
|
|
@@ -924,6 +925,17 @@ Object.defineProperties(UniformState.prototype, {
|
|
|
924
925
|
},
|
|
925
926
|
},
|
|
926
927
|
|
|
928
|
+
/**
|
|
929
|
+
* A scalar used to mix a color with the fog color based on the distance to the camera.
|
|
930
|
+
* @memberof UniformState.prototype
|
|
931
|
+
* @type {number}
|
|
932
|
+
*/
|
|
933
|
+
fogVisualDensityScalar: {
|
|
934
|
+
get: function () {
|
|
935
|
+
return this._fogVisualDensityScalar;
|
|
936
|
+
},
|
|
937
|
+
},
|
|
938
|
+
|
|
927
939
|
/**
|
|
928
940
|
* A scalar used as a minimum value when brightening fog
|
|
929
941
|
* @memberof UniformState.prototype
|
|
@@ -1495,6 +1507,7 @@ UniformState.prototype.update = function (frameState) {
|
|
|
1495
1507
|
frameState.specularEnvironmentMapsMaximumLOD;
|
|
1496
1508
|
|
|
1497
1509
|
this._fogDensity = frameState.fog.density;
|
|
1510
|
+
this._fogVisualDensityScalar = frameState.fog.visualDensityScalar;
|
|
1498
1511
|
this._fogMinimumBrightness = frameState.fog.minimumBrightness;
|
|
1499
1512
|
|
|
1500
1513
|
const atmosphere = frameState.atmosphere;
|
|
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"
|
|
7
|
+
"AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQpcUfxe1Yndhf82d5oKkQJ4_7VPaBQGYSISOMaRew7Sy-eTX1JQ4XwaC8v5aCvV72O6LCPs5Ss1pXXH-0uEw6bSRhTeQYHOmikutC2OMyZt6lu0VfT7FA-jVMO_UsunWNTf2cycP2O4IeDN_UV9G-VNmUu2jRvCHioi8o72ua4238s2219cYLEmcoGRJGVJTA.AT1_PjLvyih0";
|
|
8
8
|
/**
|
|
9
9
|
* Default options for accessing the ArcGIS image tile service.
|
|
10
10
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
2
|
+
import CesiumMath from "../Core/Math.js";
|
|
2
3
|
import DynamicAtmosphereLightingType from "./DynamicAtmosphereLightingType.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -124,4 +125,25 @@ function Atmosphere() {
|
|
|
124
125
|
this.dynamicLighting = DynamicAtmosphereLightingType.NONE;
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Returns <code>true</code> if the atmosphere shader requires a color correct step.
|
|
130
|
+
* @param {Atmosphere} atmosphere The atmosphere instance to check
|
|
131
|
+
* @returns {boolean} true if the atmosphere shader requires a color correct step
|
|
132
|
+
*/
|
|
133
|
+
Atmosphere.requiresColorCorrect = function (atmosphere) {
|
|
134
|
+
return !(
|
|
135
|
+
CesiumMath.equalsEpsilon(atmosphere.hueShift, 0.0, CesiumMath.EPSILON7) &&
|
|
136
|
+
CesiumMath.equalsEpsilon(
|
|
137
|
+
atmosphere.saturationShift,
|
|
138
|
+
0.0,
|
|
139
|
+
CesiumMath.EPSILON7,
|
|
140
|
+
) &&
|
|
141
|
+
CesiumMath.equalsEpsilon(
|
|
142
|
+
atmosphere.brightnessShift,
|
|
143
|
+
0.0,
|
|
144
|
+
CesiumMath.EPSILON7,
|
|
145
|
+
)
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
|
|
127
149
|
export default Atmosphere;
|
|
@@ -230,7 +230,7 @@ function BingMapsImageryProvider(options) {
|
|
|
230
230
|
|
|
231
231
|
this._proxy = options.proxy;
|
|
232
232
|
this._credit = new Credit(
|
|
233
|
-
`<a href="https://www.microsoft.com/en-us/maps/product
|
|
233
|
+
`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${BingMapsImageryProvider.logoUrl}" title="Bing Imagery"/></a>`,
|
|
234
234
|
);
|
|
235
235
|
|
|
236
236
|
this._tilingScheme = new WebMercatorTilingScheme({
|
|
@@ -61,6 +61,7 @@ import Cesium3DTilesetMostDetailedTraversal from "./Cesium3DTilesetMostDetailedT
|
|
|
61
61
|
import Cesium3DTilesetBaseTraversal from "./Cesium3DTilesetBaseTraversal.js";
|
|
62
62
|
import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
63
63
|
import Ray from "../Core/Ray.js";
|
|
64
|
+
import DynamicEnvironmentMapManager from "./DynamicEnvironmentMapManager.js";
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
67
|
* @typedef {Object} Cesium3DTileset.ConstructorOptions
|
|
@@ -104,6 +105,7 @@ import Ray from "../Core/Ray.js";
|
|
|
104
105
|
* @property {object} [pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
|
|
105
106
|
* @property {Cartesian3} [lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
|
|
106
107
|
* @property {ImageBasedLighting} [imageBasedLighting] The properties for managing image-based lighting for this tileset.
|
|
108
|
+
* @param {DynamicEnvironmentMapManager.ConstructorOptions} [options.environmentMapOptions] The properties for managing dynamic environment maps on this model.
|
|
107
109
|
* @property {boolean} [backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
|
|
108
110
|
* @property {boolean} [enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.
|
|
109
111
|
* @property {boolean} [showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
|
|
@@ -827,6 +829,10 @@ function Cesium3DTileset(options) {
|
|
|
827
829
|
this._shouldDestroyImageBasedLighting = true;
|
|
828
830
|
}
|
|
829
831
|
|
|
832
|
+
this._environmentMapManager = new DynamicEnvironmentMapManager(
|
|
833
|
+
options.environmentMapOptions,
|
|
834
|
+
);
|
|
835
|
+
|
|
830
836
|
/**
|
|
831
837
|
* The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
|
|
832
838
|
* <p>
|
|
@@ -1859,6 +1865,25 @@ Object.defineProperties(Cesium3DTileset.prototype, {
|
|
|
1859
1865
|
},
|
|
1860
1866
|
},
|
|
1861
1867
|
|
|
1868
|
+
/**
|
|
1869
|
+
* The properties for managing dynamic environment maps on this model. Affects lighting.
|
|
1870
|
+
*
|
|
1871
|
+
* @memberof Cesium3DTileset.prototype
|
|
1872
|
+
* @readonly
|
|
1873
|
+
*
|
|
1874
|
+
* @example
|
|
1875
|
+
* // Change the ground color used for a tileset's environment map to a forest green
|
|
1876
|
+
* const environmentMapManager = tileset.environmentMapManager;
|
|
1877
|
+
* environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34");
|
|
1878
|
+
*
|
|
1879
|
+
* @type {DynamicEnvironmentMapManager}
|
|
1880
|
+
*/
|
|
1881
|
+
environmentMapManager: {
|
|
1882
|
+
get: function () {
|
|
1883
|
+
return this._environmentMapManager;
|
|
1884
|
+
},
|
|
1885
|
+
},
|
|
1886
|
+
|
|
1862
1887
|
/**
|
|
1863
1888
|
* Indicates that only the tileset's vector tiles should be used for classification.
|
|
1864
1889
|
*
|
|
@@ -2644,6 +2669,7 @@ function handleTileFailure(error, tileset, tile) {
|
|
|
2644
2669
|
} else {
|
|
2645
2670
|
console.log(`A 3D tile failed to load: ${url}`);
|
|
2646
2671
|
console.log(`Error: ${message}`);
|
|
2672
|
+
console.log(error.stack);
|
|
2647
2673
|
}
|
|
2648
2674
|
}
|
|
2649
2675
|
|
|
@@ -3409,6 +3435,14 @@ Cesium3DTileset.prototype.updateForPass = function (
|
|
|
3409
3435
|
originalCullingVolume,
|
|
3410
3436
|
);
|
|
3411
3437
|
|
|
3438
|
+
if (passOptions.isRender) {
|
|
3439
|
+
const environmentMapManager = this._environmentMapManager;
|
|
3440
|
+
if (defined(this._root)) {
|
|
3441
|
+
environmentMapManager.position = this.boundingSphere.center;
|
|
3442
|
+
}
|
|
3443
|
+
environmentMapManager.update(frameState);
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3412
3446
|
// Update clipping polygons
|
|
3413
3447
|
const clippingPolygons = this._clippingPolygons;
|
|
3414
3448
|
if (defined(clippingPolygons) && clippingPolygons.enabled) {
|
|
@@ -3511,6 +3545,11 @@ Cesium3DTileset.prototype.destroy = function () {
|
|
|
3511
3545
|
}
|
|
3512
3546
|
this._imageBasedLighting = undefined;
|
|
3513
3547
|
|
|
3548
|
+
if (!this._environmentMapManager.isDestroyed()) {
|
|
3549
|
+
this._environmentMapManager.destroy();
|
|
3550
|
+
}
|
|
3551
|
+
this._environmentMapManager = undefined;
|
|
3552
|
+
|
|
3514
3553
|
return destroyObject(this);
|
|
3515
3554
|
};
|
|
3516
3555
|
|