@cesium/engine 6.2.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/z-worker-pako.js +568 -407
- package/Build/Workers/{chunk-RH4N2ONY.js → chunk-23UFSGND.js} +7 -7
- package/Build/Workers/{chunk-HPP4JLNH.js → chunk-2A75IWRS.js} +7 -7
- package/Build/Workers/{chunk-5IRLXUTA.js → chunk-2FRVPMCS.js} +10 -10
- package/Build/Workers/{chunk-ZQRZBHYI.js → chunk-2FWRMUTY.js} +4 -4
- package/Build/Workers/{chunk-Z2SIPUKB.js → chunk-2UPKWTMJ.js} +6 -6
- package/Build/Workers/{chunk-434ZTTFX.js → chunk-34FXV7D7.js} +2 -2
- package/Build/Workers/{chunk-MW3CJYLX.js → chunk-3VAZEH7M.js} +2 -2
- package/Build/Workers/{chunk-HUPNRBWW.js → chunk-4DO5W5XZ.js} +6 -6
- package/Build/Workers/{chunk-PIXK6KHB.js → chunk-4H7PY4U5.js} +2 -2
- package/Build/Workers/{chunk-BP467WX3.js → chunk-5QULIR53.js} +4 -4
- package/Build/Workers/{chunk-R3HUGXBH.js → chunk-7TC63SJW.js} +8 -8
- package/Build/Workers/{chunk-SQVTYRZY.js → chunk-7ZFGPDJA.js} +4 -4
- package/Build/Workers/{chunk-TIXXVKUY.js → chunk-A5DWLWCY.js} +10 -10
- package/Build/Workers/{chunk-CWJQGBWT.js → chunk-BBWDMCVU.js} +1 -1
- package/Build/Workers/{chunk-4KP73B43.js → chunk-BG4UCVXN.js} +3 -3
- package/Build/Workers/{chunk-Y4OJ4B23.js → chunk-BIKA3NRA.js} +5 -5
- package/Build/Workers/{chunk-DR5XZ6K5.js → chunk-BROJAZRZ.js} +13 -13
- package/Build/Workers/{chunk-FWGNCYP6.js → chunk-DDUQAJ4P.js} +7 -7
- package/Build/Workers/{chunk-QRBRVGZC.js → chunk-EERJKOAF.js} +4 -4
- package/Build/Workers/{chunk-52VSIKEA.js → chunk-EG6PTBY2.js} +15 -15
- package/Build/Workers/{chunk-O43GWBSF.js → chunk-EHWHNOEX.js} +1 -1
- package/Build/Workers/{chunk-MN34FIF5.js → chunk-F3YA3Y2Z.js} +1 -1
- package/Build/Workers/{chunk-GF5TNNKP.js → chunk-F4HFJMGM.js} +6 -6
- package/Build/Workers/{chunk-HOT2SNXP.js → chunk-FJKNFAKQ.js} +133 -553
- package/Build/Workers/{chunk-TMPVBFJQ.js → chunk-FNIRWHJB.js} +10 -10
- package/Build/Workers/{chunk-DMCSY5BU.js → chunk-FZRIVR7Y.js} +5 -5
- package/Build/Workers/{chunk-Z4JUBRHP.js → chunk-G43QFN4Q.js} +6 -6
- package/Build/Workers/{chunk-HPH5HSFE.js → chunk-GATZHF3K.js} +2 -2
- package/Build/Workers/{chunk-CSIZ3BGT.js → chunk-GRC2ZTAF.js} +14 -14
- package/Build/Workers/{chunk-NE4JNU6H.js → chunk-HU6N6EXB.js} +10 -10
- package/Build/Workers/{chunk-GVL5I7TC.js → chunk-I46ZRR5W.js} +17 -17
- package/Build/Workers/{chunk-5GDBZTHX.js → chunk-JURN7NPV.js} +17 -17
- package/Build/Workers/{chunk-H5DUXHCV.js → chunk-KKCR2YOP.js} +11 -11
- package/Build/Workers/{chunk-LX6XV4DK.js → chunk-LPR3YNP2.js} +5 -5
- package/Build/Workers/{chunk-HFKSAB5K.js → chunk-M7ERACJJ.js} +13 -13
- package/Build/Workers/{chunk-BUZDZBUH.js → chunk-MDWEGWPA.js} +10 -10
- package/Build/Workers/{chunk-LGJUI2CE.js → chunk-OGXZVPPM.js} +9 -5
- package/Build/Workers/{chunk-PZ2WJWUG.js → chunk-PGSJK77E.js} +6 -6
- package/Build/Workers/{chunk-ARPTYYKS.js → chunk-PPH7OFP3.js} +5 -5
- package/Build/Workers/{chunk-R4OZKBXH.js → chunk-SH5USDPI.js} +6 -6
- package/Build/Workers/{chunk-SV7DDPAC.js → chunk-SOWMRMWA.js} +1 -1
- package/Build/Workers/{chunk-RIDPF7PO.js → chunk-STW2DGFI.js} +2 -2
- package/Build/Workers/{chunk-CDGHUKQ4.js → chunk-T3XIFPYR.js} +13 -13
- package/Build/Workers/chunk-TTUZP4BO.js +501 -0
- package/Build/Workers/{chunk-QTZQZY2C.js → chunk-UEXTBDBE.js} +34 -10
- package/Build/Workers/{chunk-XUTVA4K5.js → chunk-VOXYEYJT.js} +11 -11
- package/Build/Workers/{chunk-AXFRNOVC.js → chunk-X4356LRH.js} +12 -12
- package/Build/Workers/{chunk-5HLGKKG3.js → chunk-XGI5BXZY.js} +2 -2
- package/Build/Workers/{chunk-SNN7WOC2.js → chunk-Y2ME2IJV.js} +13 -13
- package/Build/Workers/{chunk-LGL4P5KL.js → chunk-Y5UQJLYE.js} +6 -6
- package/Build/Workers/{chunk-3PW6ZBN4.js → chunk-YJEBABKH.js} +7 -7
- package/Build/Workers/{chunk-YBKFS53K.js → chunk-YWTJ2B4B.js} +1 -1
- package/Build/Workers/{chunk-5SK36PU4.js → chunk-Z3TIFFGF.js} +7 -7
- package/Build/Workers/{chunk-JGG36SQV.js → chunk-ZT7KWISZ.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -23
- package/Build/Workers/createBoxGeometry.js +18 -17
- package/Build/Workers/createBoxOutlineGeometry.js +16 -15
- package/Build/Workers/createCircleGeometry.js +26 -25
- package/Build/Workers/createCircleOutlineGeometry.js +19 -18
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -32
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -30
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -19
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -17
- package/Build/Workers/createEllipseGeometry.js +26 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -18
- package/Build/Workers/createEllipsoidGeometry.js +19 -18
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -17
- package/Build/Workers/createFrustumGeometry.js +18 -17
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -17
- package/Build/Workers/createGeometry.js +54 -33
- package/Build/Workers/createGroundPolylineGeometry.js +22 -21
- package/Build/Workers/createPlaneGeometry.js +16 -15
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -14
- package/Build/Workers/createPolygonGeometry.js +32 -166
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -29
- package/Build/Workers/createPolylineGeometry.js +25 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +32 -33
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -19
- package/Build/Workers/createSimplePolylineGeometry.js +23 -22
- package/Build/Workers/createSphereGeometry.js +19 -18
- package/Build/Workers/createSphereOutlineGeometry.js +18 -17
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -23
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +22 -21
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -21
- package/Build/Workers/createVerticesFromHeightmap.js +22 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -18
- package/Build/Workers/createWallGeometry.js +24 -23
- package/Build/Workers/createWallOutlineGeometry.js +23 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +601 -92
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -21
- package/LICENSE.md +1 -1
- package/Source/Assets/approximateTerrainHeights.json +1 -1
- package/Source/Core/Ellipsoid.js +6 -0
- package/Source/Core/GregorianDate.js +85 -0
- package/Source/Core/HeadingPitchRange.js +2 -2
- package/Source/Core/IntersectionTests.js +6 -3
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PixelFormat.js +5 -0
- package/Source/Core/PolygonGeometry.js +0 -169
- package/Source/Core/Resource.js +30 -69
- package/Source/Core/Transforms.js +30 -18
- package/Source/Core/createWorldBathymetryAsync.js +45 -0
- package/Source/Core/srgbToLinear.js +32 -0
- package/Source/DataSources/CzmlDataSource.js +51 -23
- package/Source/DataSources/DataSourceDisplay.js +27 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -4
- package/Source/DataSources/Entity.js +28 -7
- package/Source/DataSources/EntityCollection.js +1 -2
- package/Source/DataSources/GeometryUpdater.js +1 -2
- package/Source/DataSources/GeometryUpdaterSet.js +114 -0
- package/Source/DataSources/GeometryVisualizer.js +19 -83
- package/Source/DataSources/GroundGeometryUpdater.js +6 -3
- package/Source/DataSources/ModelVisualizer.js +19 -98
- package/Source/DataSources/PolygonGeometryUpdater.js +14 -2
- package/Source/DataSources/PolylineGeometryUpdater.js +9 -8
- package/Source/DataSources/TerrainOffsetProperty.js +15 -23
- package/Source/Renderer/AutomaticUniforms.js +121 -1
- package/Source/Renderer/Context.js +10 -0
- package/Source/Renderer/ContextLimits.js +2 -0
- package/Source/Renderer/UniformState.js +127 -0
- package/Source/Renderer/demodernizeShader.js +4 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Atmosphere.js +127 -0
- package/Source/Scene/Axis.js +12 -7
- package/Source/Scene/Billboard.js +29 -26
- package/Source/Scene/BillboardCollection.js +3 -3
- package/Source/Scene/Camera.js +47 -5
- package/Source/Scene/Cesium3DTile.js +1 -0
- package/Source/Scene/Cesium3DTileContent.js +14 -0
- package/Source/Scene/Cesium3DTileset.js +364 -45
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +2 -4
- package/Source/Scene/Cesium3DTilesetTraversal.js +4 -0
- package/Source/Scene/Composite3DTileContent.js +42 -0
- package/Source/Scene/DynamicAtmosphereLightingType.js +56 -0
- package/Source/Scene/Empty3DTileContent.js +4 -0
- package/Source/Scene/Fog.js +1 -0
- package/Source/Scene/FrameState.js +14 -1
- package/Source/Scene/Geometry3DTileContent.js +4 -0
- package/Source/Scene/Globe.js +3 -2
- package/Source/Scene/GlobeSurfaceTileProvider.js +3 -1
- package/Source/Scene/GlobeTranslucencyState.js +1 -1
- package/Source/Scene/GltfLoader.js +15 -5
- package/Source/Scene/GltfPipeline/updateVersion.js +69 -68
- package/Source/Scene/HeightReference.js +59 -2
- package/Source/Scene/I3SDataProvider.js +270 -53
- package/Source/Scene/I3SDecoder.js +8 -1
- package/Source/Scene/I3SFeature.js +2 -5
- package/Source/Scene/I3SField.js +136 -31
- package/Source/Scene/I3SGeometry.js +70 -2
- package/Source/Scene/I3SLayer.js +55 -10
- package/Source/Scene/I3SNode.js +175 -18
- package/Source/Scene/I3SStatistics.js +94 -0
- package/Source/Scene/I3SSublayer.js +176 -0
- package/Source/Scene/I3SSymbology.js +337 -0
- package/Source/Scene/Implicit3DTileContent.js +4 -0
- package/Source/Scene/KeyframeNode.js +1 -1
- package/Source/Scene/LabelCollection.js +2 -2
- package/Source/Scene/Model/AtmospherePipelineStage.js +59 -0
- package/Source/Scene/Model/B3dmLoader.js +4 -0
- package/Source/Scene/Model/FeatureIdPipelineStage.js +25 -2
- package/Source/Scene/Model/I3dmLoader.js +4 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +24 -6
- package/Source/Scene/Model/MetadataPipelineStage.js +31 -3
- package/Source/Scene/Model/Model.js +82 -32
- package/Source/Scene/Model/Model3DTileContent.js +31 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +16 -15
- package/Source/Scene/Model/ModelSceneGraph.js +6 -0
- package/Source/Scene/Model/pickModel.js +426 -0
- package/Source/Scene/Multiple3DTileContent.js +42 -0
- package/Source/Scene/PickFramebuffer.js +37 -2
- package/Source/Scene/Picking.js +113 -39
- package/Source/Scene/Primitive.js +6 -2
- package/Source/Scene/QuadtreePrimitive.js +1 -1
- package/Source/Scene/Scene.js +312 -46
- package/Source/Scene/ScreenSpaceCameraController.js +23 -13
- package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
- package/Source/Scene/SkyAtmosphere.js +5 -6
- package/Source/Scene/SpatialNode.js +12 -19
- package/Source/Scene/StructuralMetadata.js +1 -1
- package/Source/Scene/Terrain.js +49 -0
- package/Source/Scene/TileBoundingS2Cell.js +2 -2
- package/Source/Scene/Tileset3DTileContent.js +4 -0
- package/Source/Scene/Vector3DTileContent.js +4 -0
- package/Source/Scene/VoxelBoxShape.js +76 -0
- package/Source/Scene/VoxelCell.js +273 -0
- package/Source/Scene/VoxelCylinderShape.js +114 -43
- package/Source/Scene/VoxelEllipsoidShape.js +158 -116
- package/Source/Scene/VoxelPrimitive.js +3 -1
- package/Source/Scene/VoxelRenderResources.js +3 -0
- package/Source/Scene/VoxelShape.js +13 -0
- package/Source/Scene/VoxelTraversal.js +76 -54
- package/Source/Scene/buildVoxelDrawCommands.js +23 -0
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -0
- package/Source/Scene/processVoxelProperties.js +2 -0
- package/Source/Shaders/AtmosphereCommon.glsl +3 -11
- package/Source/Shaders/AtmosphereCommon.js +3 -11
- package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.js +34 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.js +12 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +44 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +46 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js +32 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.glsl +150 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.js +152 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.js +24 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +5 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +5 -0
- package/Source/Shaders/GlobeFS.glsl +16 -25
- package/Source/Shaders/GlobeFS.js +16 -25
- package/Source/Shaders/GlobeVS.glsl +1 -1
- package/Source/Shaders/GlobeVS.js +1 -1
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +111 -0
- package/Source/Shaders/Model/AtmosphereStageFS.js +113 -0
- package/Source/Shaders/Model/AtmosphereStageVS.glsl +12 -0
- package/Source/Shaders/Model/AtmosphereStageVS.js +14 -0
- package/Source/Shaders/Model/GeometryStageFS.glsl +1 -1
- package/Source/Shaders/Model/GeometryStageFS.js +1 -1
- package/Source/Shaders/Model/GeometryStageVS.glsl +4 -4
- package/Source/Shaders/Model/GeometryStageVS.js +4 -4
- package/Source/Shaders/Model/ModelColorStageFS.glsl +1 -1
- package/Source/Shaders/Model/ModelColorStageFS.js +2 -1
- package/Source/Shaders/Model/ModelFS.glsl +4 -0
- package/Source/Shaders/Model/ModelFS.js +4 -0
- package/Source/Shaders/Model/ModelVS.glsl +9 -4
- package/Source/Shaders/Model/ModelVS.js +9 -4
- package/Source/Shaders/SkyAtmosphereCommon.glsl +3 -13
- package/Source/Shaders/SkyAtmosphereCommon.js +3 -13
- package/Source/Shaders/SkyAtmosphereFS.glsl +5 -10
- package/Source/Shaders/SkyAtmosphereFS.js +5 -10
- package/Source/Shaders/SkyAtmosphereVS.glsl +3 -2
- package/Source/Shaders/SkyAtmosphereVS.js +3 -2
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +14 -111
- package/Source/Shaders/Voxels/IntersectCylinder.js +14 -111
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +32 -113
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +32 -113
- package/Source/Shaders/Voxels/IntersectLongitude.glsl +102 -0
- package/Source/Shaders/Voxels/IntersectLongitude.js +104 -0
- package/Source/Shaders/Voxels/VoxelFS.glsl +39 -1
- package/Source/Shaders/Voxels/VoxelFS.js +39 -1
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +19 -37
- package/Source/Shaders/Voxels/convertUvToCylinder.js +19 -37
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +24 -44
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +24 -44
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/Source/Workers/createGeometry.js +40 -11
- package/Source/Workers/decodeI3S.js +720 -94
- package/index.d.ts +574 -71
- package/index.js +217 -196
- package/package.json +3 -3
- package/Build/Workers/chunk-ATB2I7OS.js +0 -55
|
@@ -4,19 +4,22 @@ import Cartesian2 from "../Core/Cartesian2.js";
|
|
|
4
4
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
5
5
|
import Check from "../Core/Check.js";
|
|
6
6
|
import Color from "../Core/Color.js";
|
|
7
|
+
import defaultValue from "../Core/defaultValue.js";
|
|
7
8
|
import defined from "../Core/defined.js";
|
|
8
9
|
import destroyObject from "../Core/destroyObject.js";
|
|
9
10
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
11
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
10
12
|
import Matrix4 from "../Core/Matrix4.js";
|
|
11
13
|
import Resource from "../Core/Resource.js";
|
|
12
14
|
import ColorBlendMode from "../Scene/ColorBlendMode.js";
|
|
13
|
-
import HeightReference
|
|
15
|
+
import HeightReference, {
|
|
16
|
+
isHeightReferenceClamp,
|
|
17
|
+
} from "../Scene/HeightReference.js";
|
|
14
18
|
import Model from "../Scene/Model/Model.js";
|
|
15
19
|
import ModelAnimationLoop from "../Scene/ModelAnimationLoop.js";
|
|
16
20
|
import ShadowMode from "../Scene/ShadowMode.js";
|
|
17
21
|
import BoundingSphereState from "./BoundingSphereState.js";
|
|
18
22
|
import Property from "./Property.js";
|
|
19
|
-
import sampleTerrainMostDetailed from "../Core/sampleTerrainMostDetailed.js";
|
|
20
23
|
import Cartographic from "../Core/Cartographic.js";
|
|
21
24
|
|
|
22
25
|
const defaultScale = 1.0;
|
|
@@ -172,9 +175,6 @@ ModelVisualizer.prototype.update = function (time) {
|
|
|
172
175
|
articulationsScratch: {},
|
|
173
176
|
loadFailed: false,
|
|
174
177
|
modelUpdated: false,
|
|
175
|
-
awaitingSampleTerrain: false,
|
|
176
|
-
clampedBoundingSphere: undefined,
|
|
177
|
-
sampleTerrainFailed: false,
|
|
178
178
|
};
|
|
179
179
|
modelHash[entity.id] = modelData;
|
|
180
180
|
|
|
@@ -399,9 +399,6 @@ ModelVisualizer.prototype.destroy = function () {
|
|
|
399
399
|
return destroyObject(this);
|
|
400
400
|
};
|
|
401
401
|
|
|
402
|
-
// Used for testing.
|
|
403
|
-
ModelVisualizer._sampleTerrainMostDetailed = sampleTerrainMostDetailed;
|
|
404
|
-
|
|
405
402
|
const scratchPosition = new Cartesian3();
|
|
406
403
|
const scratchCartographic = new Cartographic();
|
|
407
404
|
/**
|
|
@@ -445,106 +442,30 @@ ModelVisualizer.prototype.getBoundingSphere = function (entity, result) {
|
|
|
445
442
|
|
|
446
443
|
const scene = this._scene;
|
|
447
444
|
const globe = scene.globe;
|
|
445
|
+
const ellipsoid = defaultValue(globe?.ellipsoid, Ellipsoid.WGS84);
|
|
448
446
|
|
|
449
|
-
// cannot access a terrain provider if there is no globe; formally set to undefined
|
|
450
|
-
const terrainProvider = defined(globe) ? globe.terrainProvider : undefined;
|
|
451
447
|
const hasHeightReference = model.heightReference !== HeightReference.NONE;
|
|
452
|
-
if (
|
|
453
|
-
const ellipsoid = globe.ellipsoid;
|
|
448
|
+
if (hasHeightReference) {
|
|
454
449
|
const modelMatrix = model.modelMatrix;
|
|
455
450
|
scratchPosition.x = modelMatrix[12];
|
|
456
451
|
scratchPosition.y = modelMatrix[13];
|
|
457
452
|
scratchPosition.z = modelMatrix[14];
|
|
458
|
-
const cartoPosition = ellipsoid.cartesianToCartographic(
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
if (!defined(terrainProvider.availability)) {
|
|
463
|
-
// Regardless of what the original model's position is set to, for CLAMP_TO_GROUND, we reset it to 0
|
|
464
|
-
// when computing the position to zoom/fly to.
|
|
465
|
-
if (model.heightReference === HeightReference.CLAMP_TO_GROUND) {
|
|
466
|
-
cartoPosition.height = 0;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
const scratchPosition = ellipsoid.cartographicToCartesian(cartoPosition);
|
|
470
|
-
BoundingSphere.clone(model.boundingSphere, result);
|
|
471
|
-
result.center = scratchPosition;
|
|
472
|
-
|
|
473
|
-
return BoundingSphereState.DONE;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
// Otherwise, in the case of terrain providers with availability,
|
|
477
|
-
// since the model's bounding sphere may be clamped to a lower LOD tile if
|
|
478
|
-
// the camera is initially far away, we use sampleTerrainMostDetailed to estimate
|
|
479
|
-
// where the bounding sphere should be and set that as the target bounding sphere
|
|
480
|
-
// for the camera.
|
|
481
|
-
let clampedBoundingSphere = this._modelHash[entity.id]
|
|
482
|
-
.clampedBoundingSphere;
|
|
483
|
-
|
|
484
|
-
// Check if the sample terrain function has failed.
|
|
485
|
-
const sampleTerrainFailed = this._modelHash[entity.id].sampleTerrainFailed;
|
|
486
|
-
if (sampleTerrainFailed) {
|
|
487
|
-
this._modelHash[entity.id].sampleTerrainFailed = false;
|
|
488
|
-
return BoundingSphereState.FAILED;
|
|
489
|
-
}
|
|
453
|
+
const cartoPosition = ellipsoid.cartesianToCartographic(
|
|
454
|
+
scratchPosition,
|
|
455
|
+
scratchCartographic
|
|
456
|
+
);
|
|
490
457
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
.awaitingSampleTerrain;
|
|
498
|
-
if (!awaitingSampleTerrain) {
|
|
499
|
-
Cartographic.clone(cartoPosition, scratchCartographic);
|
|
500
|
-
this._modelHash[entity.id].awaitingSampleTerrain = true;
|
|
501
|
-
ModelVisualizer._sampleTerrainMostDetailed(terrainProvider, [
|
|
502
|
-
scratchCartographic,
|
|
503
|
-
])
|
|
504
|
-
.then((result) => {
|
|
505
|
-
if (this.isDestroyed()) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
this._modelHash[entity.id].awaitingSampleTerrain = false;
|
|
510
|
-
|
|
511
|
-
const updatedCartographic = result[0];
|
|
512
|
-
if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {
|
|
513
|
-
updatedCartographic.height += cartoPosition.height;
|
|
514
|
-
}
|
|
515
|
-
ellipsoid.cartographicToCartesian(
|
|
516
|
-
updatedCartographic,
|
|
517
|
-
scratchPosition
|
|
518
|
-
);
|
|
519
|
-
|
|
520
|
-
// Update the bounding sphere with the updated position.
|
|
521
|
-
BoundingSphere.clone(model.boundingSphere, clampedBoundingSphere);
|
|
522
|
-
clampedBoundingSphere.center = scratchPosition;
|
|
523
|
-
|
|
524
|
-
this._modelHash[
|
|
525
|
-
entity.id
|
|
526
|
-
].clampedBoundingSphere = BoundingSphere.clone(
|
|
527
|
-
clampedBoundingSphere
|
|
528
|
-
);
|
|
529
|
-
})
|
|
530
|
-
.catch((e) => {
|
|
531
|
-
if (this.isDestroyed()) {
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
this._modelHash[entity.id].sampleTerrainFailed = true;
|
|
536
|
-
this._modelHash[entity.id].awaitingSampleTerrain = false;
|
|
537
|
-
});
|
|
458
|
+
const height = scene.getHeight(cartoPosition, model.heightReference);
|
|
459
|
+
if (defined(height)) {
|
|
460
|
+
if (isHeightReferenceClamp(model.heightReference)) {
|
|
461
|
+
cartoPosition.height = height;
|
|
462
|
+
} else {
|
|
463
|
+
cartoPosition.height += height;
|
|
538
464
|
}
|
|
539
|
-
|
|
540
|
-
// We will return the state as pending until the clamped bounding sphere is defined,
|
|
541
|
-
// which happens when the sampleTerrainMostDetailed promise returns.
|
|
542
|
-
return BoundingSphereState.PENDING;
|
|
543
465
|
}
|
|
544
466
|
|
|
545
|
-
BoundingSphere.clone(
|
|
546
|
-
|
|
547
|
-
this._modelHash[entity.id].clampedBoundingSphere = undefined;
|
|
467
|
+
BoundingSphere.clone(model.boundingSphere, result);
|
|
468
|
+
result.center = ellipsoid.cartographicToCartesian(cartoPosition);
|
|
548
469
|
return BoundingSphereState.DONE;
|
|
549
470
|
}
|
|
550
471
|
|
|
@@ -418,8 +418,14 @@ PolygonGeometryUpdater.prototype._setStaticOptions = function (
|
|
|
418
418
|
extrudedHeightReferenceValue
|
|
419
419
|
);
|
|
420
420
|
if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {
|
|
421
|
+
const rectangle = PolygonGeometry.computeRectangleFromPositions(
|
|
422
|
+
options.polygonHierarchy.positions,
|
|
423
|
+
options.ellipsoid,
|
|
424
|
+
options.arcType,
|
|
425
|
+
scratchRectangle
|
|
426
|
+
);
|
|
421
427
|
extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(
|
|
422
|
-
|
|
428
|
+
rectangle
|
|
423
429
|
).minimumTerrainHeight;
|
|
424
430
|
}
|
|
425
431
|
|
|
@@ -565,8 +571,14 @@ DyanmicPolygonGeometryUpdater.prototype._setOptions = function (
|
|
|
565
571
|
extrudedHeightReferenceValue
|
|
566
572
|
);
|
|
567
573
|
if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {
|
|
574
|
+
const rectangle = PolygonGeometry.computeRectangleFromPositions(
|
|
575
|
+
options.polygonHierarchy.positions,
|
|
576
|
+
options.ellipsoid,
|
|
577
|
+
options.arcType,
|
|
578
|
+
scratchRectangle
|
|
579
|
+
);
|
|
568
580
|
extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(
|
|
569
|
-
|
|
581
|
+
rectangle
|
|
570
582
|
).minimumTerrainHeight;
|
|
571
583
|
}
|
|
572
584
|
|
|
@@ -249,8 +249,7 @@ Object.defineProperties(PolylineGeometryUpdater.prototype, {
|
|
|
249
249
|
},
|
|
250
250
|
/**
|
|
251
251
|
* Gets a value indicating if the geometry is time-varying.
|
|
252
|
-
*
|
|
253
|
-
* returned by GeometryUpdater#createDynamicUpdater.
|
|
252
|
+
*
|
|
254
253
|
* @memberof PolylineGeometryUpdater.prototype
|
|
255
254
|
*
|
|
256
255
|
* @type {boolean}
|
|
@@ -661,12 +660,13 @@ function getLine(dynamicGeometryUpdater) {
|
|
|
661
660
|
return dynamicGeometryUpdater._line;
|
|
662
661
|
}
|
|
663
662
|
|
|
664
|
-
const sceneId = dynamicGeometryUpdater._geometryUpdater._scene.id;
|
|
665
|
-
let polylineCollection = polylineCollections[sceneId];
|
|
666
663
|
const primitives = dynamicGeometryUpdater._primitives;
|
|
664
|
+
const polylineCollectionId =
|
|
665
|
+
dynamicGeometryUpdater._geometryUpdater._scene.id + primitives._guid;
|
|
666
|
+
let polylineCollection = polylineCollections[polylineCollectionId];
|
|
667
667
|
if (!defined(polylineCollection) || polylineCollection.isDestroyed()) {
|
|
668
668
|
polylineCollection = new PolylineCollection();
|
|
669
|
-
polylineCollections[
|
|
669
|
+
polylineCollections[polylineCollectionId] = polylineCollection;
|
|
670
670
|
primitives.add(polylineCollection);
|
|
671
671
|
} else if (!primitives.contains(polylineCollection)) {
|
|
672
672
|
primitives.add(polylineCollection);
|
|
@@ -869,13 +869,14 @@ DynamicGeometryUpdater.prototype.isDestroyed = function () {
|
|
|
869
869
|
|
|
870
870
|
DynamicGeometryUpdater.prototype.destroy = function () {
|
|
871
871
|
const geometryUpdater = this._geometryUpdater;
|
|
872
|
-
const
|
|
873
|
-
|
|
872
|
+
const polylineCollectionId =
|
|
873
|
+
geometryUpdater._scene.id + this._primitives._guid;
|
|
874
|
+
const polylineCollection = polylineCollections[polylineCollectionId];
|
|
874
875
|
if (defined(polylineCollection)) {
|
|
875
876
|
polylineCollection.remove(this._line);
|
|
876
877
|
if (polylineCollection.length === 0) {
|
|
877
878
|
this._primitives.removeAndDestroy(polylineCollection);
|
|
878
|
-
delete polylineCollections[
|
|
879
|
+
delete polylineCollections[polylineCollectionId];
|
|
879
880
|
}
|
|
880
881
|
}
|
|
881
882
|
if (defined(this._groundPolylinePrimitive)) {
|
|
@@ -6,12 +6,12 @@ import destroyObject from "../Core/destroyObject.js";
|
|
|
6
6
|
import Event from "../Core/Event.js";
|
|
7
7
|
import Iso8601 from "../Core/Iso8601.js";
|
|
8
8
|
import CesiumMath from "../Core/Math.js";
|
|
9
|
-
import HeightReference
|
|
10
|
-
|
|
9
|
+
import HeightReference, {
|
|
10
|
+
isHeightReferenceRelative,
|
|
11
|
+
} from "../Scene/HeightReference.js";
|
|
11
12
|
import Property from "./Property.js";
|
|
12
13
|
|
|
13
14
|
const scratchPosition = new Cartesian3();
|
|
14
|
-
const scratchCarto = new Cartographic();
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @private
|
|
@@ -118,40 +118,32 @@ TerrainOffsetProperty.prototype._updateClamping = function () {
|
|
|
118
118
|
const globe = scene.globe;
|
|
119
119
|
const position = this._position;
|
|
120
120
|
|
|
121
|
-
if (
|
|
121
|
+
if (Cartesian3.equals(position, Cartesian3.ZERO)) {
|
|
122
122
|
this._terrainHeight = 0;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
const ellipsoid = globe.ellipsoid;
|
|
126
|
-
const surface = globe._surface;
|
|
127
|
-
|
|
128
|
-
const that = this;
|
|
129
126
|
const cartographicPosition = ellipsoid.cartesianToCartographic(
|
|
130
127
|
position,
|
|
131
128
|
this._cartographicPosition
|
|
132
129
|
);
|
|
133
|
-
|
|
130
|
+
|
|
131
|
+
const height = scene.getHeight(cartographicPosition, this._heightReference);
|
|
134
132
|
if (defined(height)) {
|
|
135
133
|
this._terrainHeight = height;
|
|
136
134
|
} else {
|
|
137
135
|
this._terrainHeight = 0;
|
|
138
136
|
}
|
|
139
137
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
that._terrainHeight = carto.height;
|
|
147
|
-
} else {
|
|
148
|
-
that._terrainHeight = clampedPosition.x;
|
|
149
|
-
}
|
|
150
|
-
that.definitionChanged.raiseEvent();
|
|
151
|
-
}
|
|
152
|
-
this._removeCallbackFunc = surface.updateHeight(
|
|
138
|
+
const updateFunction = (clampedPosition) => {
|
|
139
|
+
this._terrainHeight = clampedPosition.height;
|
|
140
|
+
this.definitionChanged.raiseEvent();
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
this._removeCallbackFunc = scene.updateHeight(
|
|
153
144
|
cartographicPosition,
|
|
154
|
-
updateFunction
|
|
145
|
+
updateFunction,
|
|
146
|
+
this._heightReference
|
|
155
147
|
);
|
|
156
148
|
};
|
|
157
149
|
|
|
@@ -174,7 +166,7 @@ TerrainOffsetProperty.prototype.getValue = function (time, result) {
|
|
|
174
166
|
|
|
175
167
|
if (
|
|
176
168
|
heightReference === HeightReference.NONE &&
|
|
177
|
-
extrudedHeightReference
|
|
169
|
+
!isHeightReferenceRelative(extrudedHeightReference)
|
|
178
170
|
) {
|
|
179
171
|
this._position = Cartesian3.clone(Cartesian3.ZERO, this._position);
|
|
180
172
|
return Cartesian3.clone(Cartesian3.ZERO, result);
|
|
@@ -954,7 +954,8 @@ const AutomaticUniforms = {
|
|
|
954
954
|
|
|
955
955
|
/**
|
|
956
956
|
* An automatic GLSL uniform containing the ellipsoid radii of curvature at the camera position.
|
|
957
|
-
* The .x component is the prime vertical radius
|
|
957
|
+
* The .x component is the prime vertical radius of curvature (east-west direction)
|
|
958
|
+
* .y is the meridional radius of curvature (north-south direction)
|
|
958
959
|
* This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
|
|
959
960
|
*/
|
|
960
961
|
czm_eyeEllipsoidCurvature: new AutomaticUniform({
|
|
@@ -1591,6 +1592,125 @@ const AutomaticUniforms = {
|
|
|
1591
1592
|
},
|
|
1592
1593
|
}),
|
|
1593
1594
|
|
|
1595
|
+
/**
|
|
1596
|
+
* An automatic GLSL uniform scalar used to set a minimum brightness when dynamic lighting is applied to fog.
|
|
1597
|
+
*
|
|
1598
|
+
* @see czm_fog
|
|
1599
|
+
*/
|
|
1600
|
+
czm_fogMinimumBrightness: new AutomaticUniform({
|
|
1601
|
+
size: 1,
|
|
1602
|
+
datatype: WebGLConstants.FLOAT,
|
|
1603
|
+
getValue: function (uniformState) {
|
|
1604
|
+
return uniformState.fogMinimumBrightness;
|
|
1605
|
+
},
|
|
1606
|
+
}),
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* An automatic uniform representing the color shift for the atmosphere in HSB color space
|
|
1610
|
+
*
|
|
1611
|
+
* @example
|
|
1612
|
+
* uniform vec3 czm_atmosphereHsbShift;
|
|
1613
|
+
*/
|
|
1614
|
+
czm_atmosphereHsbShift: new AutomaticUniform({
|
|
1615
|
+
size: 1,
|
|
1616
|
+
datatype: WebGLConstants.FLOAT_VEC3,
|
|
1617
|
+
getValue: function (uniformState) {
|
|
1618
|
+
return uniformState.atmosphereHsbShift;
|
|
1619
|
+
},
|
|
1620
|
+
}),
|
|
1621
|
+
/**
|
|
1622
|
+
* An automatic uniform representing the intensity of the light that is used for computing the atmosphere color
|
|
1623
|
+
*
|
|
1624
|
+
* @example
|
|
1625
|
+
* uniform float czm_atmosphereLightIntensity;
|
|
1626
|
+
*/
|
|
1627
|
+
czm_atmosphereLightIntensity: new AutomaticUniform({
|
|
1628
|
+
size: 1,
|
|
1629
|
+
datatype: WebGLConstants.FLOAT,
|
|
1630
|
+
getValue: function (uniformState) {
|
|
1631
|
+
return uniformState.atmosphereLightIntensity;
|
|
1632
|
+
},
|
|
1633
|
+
}),
|
|
1634
|
+
/**
|
|
1635
|
+
* An automatic uniform representing the Rayleigh scattering coefficient used when computing the atmosphere scattering
|
|
1636
|
+
*
|
|
1637
|
+
* @example
|
|
1638
|
+
* uniform vec3 czm_atmosphereRayleighCoefficient;
|
|
1639
|
+
*/
|
|
1640
|
+
czm_atmosphereRayleighCoefficient: new AutomaticUniform({
|
|
1641
|
+
size: 1,
|
|
1642
|
+
datatype: WebGLConstants.FLOAT_VEC3,
|
|
1643
|
+
getValue: function (uniformState) {
|
|
1644
|
+
return uniformState.atmosphereRayleighCoefficient;
|
|
1645
|
+
},
|
|
1646
|
+
}),
|
|
1647
|
+
/**
|
|
1648
|
+
* An automatic uniform representing the Rayleigh scale height in meters used for computing atmosphere scattering.
|
|
1649
|
+
*
|
|
1650
|
+
* @example
|
|
1651
|
+
* uniform vec3 czm_atmosphereRayleighScaleHeight;
|
|
1652
|
+
*/
|
|
1653
|
+
czm_atmosphereRayleighScaleHeight: new AutomaticUniform({
|
|
1654
|
+
size: 1,
|
|
1655
|
+
datatype: WebGLConstants.FLOAT,
|
|
1656
|
+
getValue: function (uniformState) {
|
|
1657
|
+
return uniformState.atmosphereRayleighScaleHeight;
|
|
1658
|
+
},
|
|
1659
|
+
}),
|
|
1660
|
+
/**
|
|
1661
|
+
* An automatic uniform representing the Mie scattering coefficient used when computing atmosphere scattering.
|
|
1662
|
+
*
|
|
1663
|
+
* @example
|
|
1664
|
+
* uniform vec3 czm_atmosphereMieCoefficient;
|
|
1665
|
+
*/
|
|
1666
|
+
czm_atmosphereMieCoefficient: new AutomaticUniform({
|
|
1667
|
+
size: 1,
|
|
1668
|
+
datatype: WebGLConstants.FLOAT_VEC3,
|
|
1669
|
+
getValue: function (uniformState) {
|
|
1670
|
+
return uniformState.atmosphereMieCoefficient;
|
|
1671
|
+
},
|
|
1672
|
+
}),
|
|
1673
|
+
/**
|
|
1674
|
+
* An automatic uniform storign the Mie scale height used when computing atmosphere scattering.
|
|
1675
|
+
*
|
|
1676
|
+
* @example
|
|
1677
|
+
* uniform float czm_atmosphereMieScaleHeight;
|
|
1678
|
+
*/
|
|
1679
|
+
czm_atmosphereMieScaleHeight: new AutomaticUniform({
|
|
1680
|
+
size: 1,
|
|
1681
|
+
datatype: WebGLConstants.FLOAT,
|
|
1682
|
+
getValue: function (uniformState) {
|
|
1683
|
+
return uniformState.atmosphereMieScaleHeight;
|
|
1684
|
+
},
|
|
1685
|
+
}),
|
|
1686
|
+
/**
|
|
1687
|
+
* An automatic uniform representing the anisotropy of the medium to consider for Mie scattering.
|
|
1688
|
+
*
|
|
1689
|
+
* @example
|
|
1690
|
+
* uniform float czm_atmosphereAnisotropy;
|
|
1691
|
+
*/
|
|
1692
|
+
czm_atmosphereMieAnisotropy: new AutomaticUniform({
|
|
1693
|
+
size: 1,
|
|
1694
|
+
datatype: WebGLConstants.FLOAT,
|
|
1695
|
+
getValue: function (uniformState) {
|
|
1696
|
+
return uniformState.atmosphereMieAnisotropy;
|
|
1697
|
+
},
|
|
1698
|
+
}),
|
|
1699
|
+
|
|
1700
|
+
/**
|
|
1701
|
+
* An automatic uniform representing which light source to use for dynamic lighting
|
|
1702
|
+
*
|
|
1703
|
+
* @example
|
|
1704
|
+
* uniform float czm_atmosphereDynamicLighting
|
|
1705
|
+
*/
|
|
1706
|
+
czm_atmosphereDynamicLighting: new AutomaticUniform({
|
|
1707
|
+
size: 1,
|
|
1708
|
+
datatype: WebGLConstants.FLOAT,
|
|
1709
|
+
getValue: function (uniformState) {
|
|
1710
|
+
return uniformState.atmosphereDynamicLighting;
|
|
1711
|
+
},
|
|
1712
|
+
}),
|
|
1713
|
+
|
|
1594
1714
|
/**
|
|
1595
1715
|
* An automatic GLSL uniform representing the splitter position to use when rendering with a splitter.
|
|
1596
1716
|
* This will be in pixel coordinates relative to the canvas.
|
|
@@ -1432,6 +1432,16 @@ Context.prototype.endFrame = function () {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
};
|
|
1434
1434
|
|
|
1435
|
+
/**
|
|
1436
|
+
* @private
|
|
1437
|
+
* @param {object} readState An object with the following properties:
|
|
1438
|
+
* @param {number} [readState.x=0] The x offset of the rectangle to read from.
|
|
1439
|
+
* @param {number} [readState.y=0] The y offset of the rectangle to read from.
|
|
1440
|
+
* @param {number} [readState.width=gl.drawingBufferWidth] The width of the rectangle to read from.
|
|
1441
|
+
* @param {number} [readState.height=gl.drawingBufferHeight] The height of the rectangle to read from.
|
|
1442
|
+
* @param {Framebuffer} [readState.framebuffer] The framebuffer to read from. If undefined, the read will be from the default framebuffer.
|
|
1443
|
+
* @returns {Uint8Array|Uint16Array|Float32Array|Uint32Array} The pixels in the specified rectangle.
|
|
1444
|
+
*/
|
|
1435
1445
|
Context.prototype.readPixels = function (readState) {
|
|
1436
1446
|
const gl = this._gl;
|
|
1437
1447
|
|
|
@@ -161,6 +161,16 @@ function UniformState() {
|
|
|
161
161
|
this._specularEnvironmentMapsMaximumLOD = undefined;
|
|
162
162
|
|
|
163
163
|
this._fogDensity = undefined;
|
|
164
|
+
this._fogMinimumBrightness = undefined;
|
|
165
|
+
|
|
166
|
+
this._atmosphereHsbShift = undefined;
|
|
167
|
+
this._atmosphereLightIntensity = undefined;
|
|
168
|
+
this._atmosphereRayleighCoefficient = new Cartesian3();
|
|
169
|
+
this._atmosphereRayleighScaleHeight = new Cartesian3();
|
|
170
|
+
this._atmosphereMieCoefficient = new Cartesian3();
|
|
171
|
+
this._atmosphereMieScaleHeight = undefined;
|
|
172
|
+
this._atmosphereMieAnisotropy = undefined;
|
|
173
|
+
this._atmosphereDynamicLighting = undefined;
|
|
164
174
|
|
|
165
175
|
this._invertClassificationColor = undefined;
|
|
166
176
|
|
|
@@ -915,6 +925,99 @@ Object.defineProperties(UniformState.prototype, {
|
|
|
915
925
|
},
|
|
916
926
|
},
|
|
917
927
|
|
|
928
|
+
/**
|
|
929
|
+
* A scalar used as a minimum value when brightening fog
|
|
930
|
+
* @memberof UniformState.prototype
|
|
931
|
+
* @type {number}
|
|
932
|
+
*/
|
|
933
|
+
fogMinimumBrightness: {
|
|
934
|
+
get: function () {
|
|
935
|
+
return this._fogMinimumBrightness;
|
|
936
|
+
},
|
|
937
|
+
},
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* A color shift to apply to the atmosphere color in HSB.
|
|
941
|
+
* @memberof UniformState.prototype
|
|
942
|
+
* @type {Cartesian3}
|
|
943
|
+
*/
|
|
944
|
+
atmosphereHsbShift: {
|
|
945
|
+
get: function () {
|
|
946
|
+
return this._atmosphereHsbShift;
|
|
947
|
+
},
|
|
948
|
+
},
|
|
949
|
+
/**
|
|
950
|
+
* The intensity of the light that is used for computing the atmosphere color
|
|
951
|
+
* @memberof UniformState.prototype
|
|
952
|
+
* @type {number}
|
|
953
|
+
*/
|
|
954
|
+
atmosphereLightIntensity: {
|
|
955
|
+
get: function () {
|
|
956
|
+
return this._atmosphereLightIntensity;
|
|
957
|
+
},
|
|
958
|
+
},
|
|
959
|
+
/**
|
|
960
|
+
* The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
|
|
961
|
+
* @memberof UniformState.prototype
|
|
962
|
+
* @type {Cartesian3}
|
|
963
|
+
*/
|
|
964
|
+
atmosphereRayleighCoefficient: {
|
|
965
|
+
get: function () {
|
|
966
|
+
return this._atmosphereRayleighCoefficient;
|
|
967
|
+
},
|
|
968
|
+
},
|
|
969
|
+
/**
|
|
970
|
+
* The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
|
|
971
|
+
* @memberof UniformState.prototype
|
|
972
|
+
* @type {number}
|
|
973
|
+
*/
|
|
974
|
+
atmosphereRayleighScaleHeight: {
|
|
975
|
+
get: function () {
|
|
976
|
+
return this._atmosphereRayleighScaleHeight;
|
|
977
|
+
},
|
|
978
|
+
},
|
|
979
|
+
/**
|
|
980
|
+
* The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
|
|
981
|
+
* @memberof UniformState.prototype
|
|
982
|
+
* @type {Cartesian3}
|
|
983
|
+
*/
|
|
984
|
+
atmosphereMieCoefficient: {
|
|
985
|
+
get: function () {
|
|
986
|
+
return this._atmosphereMieCoefficient;
|
|
987
|
+
},
|
|
988
|
+
},
|
|
989
|
+
/**
|
|
990
|
+
* The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
|
|
991
|
+
* @memberof UniformState.prototype
|
|
992
|
+
* @type {number}
|
|
993
|
+
*/
|
|
994
|
+
atmosphereMieScaleHeight: {
|
|
995
|
+
get: function () {
|
|
996
|
+
return this._atmosphereMieScaleHeight;
|
|
997
|
+
},
|
|
998
|
+
},
|
|
999
|
+
/**
|
|
1000
|
+
* The anisotropy of the medium to consider for Mie scattering.
|
|
1001
|
+
* @memberof UniformState.prototype
|
|
1002
|
+
* @type {number}
|
|
1003
|
+
*/
|
|
1004
|
+
atmosphereMieAnisotropy: {
|
|
1005
|
+
get: function () {
|
|
1006
|
+
return this._atmosphereMieAnisotropy;
|
|
1007
|
+
},
|
|
1008
|
+
},
|
|
1009
|
+
/**
|
|
1010
|
+
* Which light source to use for dynamically lighting the atmosphere
|
|
1011
|
+
*
|
|
1012
|
+
* @memberof UniformState.prototype
|
|
1013
|
+
* @type {DynamicAtmosphereLightingType}
|
|
1014
|
+
*/
|
|
1015
|
+
atmosphereDynamicLighting: {
|
|
1016
|
+
get: function () {
|
|
1017
|
+
return this._atmosphereDynamicLighting;
|
|
1018
|
+
},
|
|
1019
|
+
},
|
|
1020
|
+
|
|
918
1021
|
/**
|
|
919
1022
|
* A scalar that represents the geometric tolerance per meter
|
|
920
1023
|
* @memberof UniformState.prototype
|
|
@@ -1411,6 +1514,30 @@ UniformState.prototype.update = function (frameState) {
|
|
|
1411
1514
|
}
|
|
1412
1515
|
|
|
1413
1516
|
this._fogDensity = frameState.fog.density;
|
|
1517
|
+
this._fogMinimumBrightness = frameState.fog.minimumBrightness;
|
|
1518
|
+
|
|
1519
|
+
const atmosphere = frameState.atmosphere;
|
|
1520
|
+
if (defined(atmosphere)) {
|
|
1521
|
+
this._atmosphereHsbShift = Cartesian3.fromElements(
|
|
1522
|
+
atmosphere.hueShift,
|
|
1523
|
+
atmosphere.saturationShift,
|
|
1524
|
+
atmosphere.brightnessShift,
|
|
1525
|
+
this._atmosphereHsbShift
|
|
1526
|
+
);
|
|
1527
|
+
this._atmosphereLightIntensity = atmosphere.lightIntensity;
|
|
1528
|
+
this._atmosphereRayleighCoefficient = Cartesian3.clone(
|
|
1529
|
+
atmosphere.rayleighCoefficient,
|
|
1530
|
+
this._atmosphereRayleighCoefficient
|
|
1531
|
+
);
|
|
1532
|
+
this._atmosphereRayleighScaleHeight = atmosphere.rayleighScaleHeight;
|
|
1533
|
+
this._atmosphereMieCoefficient = Cartesian3.clone(
|
|
1534
|
+
atmosphere.mieCoefficient,
|
|
1535
|
+
this._atmosphereMieCoefficient
|
|
1536
|
+
);
|
|
1537
|
+
this._atmosphereMieScaleHeight = atmosphere.mieScaleHeight;
|
|
1538
|
+
this._atmosphereMieAnisotropy = atmosphere.mieAnisotropy;
|
|
1539
|
+
this._atmosphereDynamicLighting = atmosphere.dynamicLighting;
|
|
1540
|
+
}
|
|
1414
1541
|
|
|
1415
1542
|
this._invertClassificationColor = frameState.invertClassificationColor;
|
|
1416
1543
|
|
|
@@ -26,7 +26,10 @@ function demodernizeShader(input, isFragmentShader) {
|
|
|
26
26
|
|
|
27
27
|
if (isFragmentShader) {
|
|
28
28
|
// Replace the in with varying.
|
|
29
|
-
output = output.replaceAll(
|
|
29
|
+
output = output.replaceAll(
|
|
30
|
+
/\n\s*(in)\s+(vec\d|mat\d|float)/g,
|
|
31
|
+
`\nvarying $2`
|
|
32
|
+
);
|
|
30
33
|
|
|
31
34
|
if (/out_FragData_(\d+)/.test(output)) {
|
|
32
35
|
output = `#extension GL_EXT_draw_buffers : enable\n${output}`;
|
|
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"
|
|
7
|
+
"AAPKc6e43bbc520149f79229d173c04883558jat1YV8r6Xjl50ulCDeLTkHzW0vzUC-9m6ASQvGmPbo4-xY_kAzsJxJZm-j_Unr";
|
|
8
8
|
/**
|
|
9
9
|
* Default options for accessing the ArcGIS image tile service.
|
|
10
10
|
*
|