@cesium/engine 9.1.0 → 10.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/pako_deflate.min.js +108 -210
- package/Build/ThirdParty/Workers/pako_inflate.min.js +466 -568
- package/Build/ThirdParty/Workers/z-worker-pako.js +54 -104
- package/Build/Workers/{chunk-TMMOULW3.js → chunk-2J3JKXCP.js} +5 -5
- package/Build/Workers/{chunk-ZDP32RQI.js → chunk-3WUV74WM.js} +95 -155
- package/Build/Workers/{chunk-FOZQIHZK.js → chunk-4BAE4PWO.js} +6 -6
- package/Build/Workers/{chunk-CYAJYEKW.js → chunk-4MSUJ4I7.js} +8 -8
- package/Build/Workers/{chunk-KPY4F4BW.js → chunk-4YSNMHZ4.js} +6 -6
- package/Build/Workers/{chunk-66E3H2KU.js → chunk-5S7OLEPK.js} +12 -12
- package/Build/Workers/{chunk-4AJGCQFX.js → chunk-7XGC6YB2.js} +14 -14
- package/Build/Workers/{chunk-BDUJXBVF.js → chunk-AA4GZKOT.js} +3 -5
- package/Build/Workers/{chunk-7LPEGKOF.js → chunk-AD5HBJ2F.js} +11 -8
- package/Build/Workers/{chunk-XHLDDE65.js → chunk-AVI4IUWC.js} +11 -11
- package/Build/Workers/{chunk-MWYZ64MH.js → chunk-BCL4PHHT.js} +10 -10
- package/Build/Workers/{chunk-PWF3YJJ5.js → chunk-BDFNKFOE.js} +13 -13
- package/Build/Workers/{chunk-7VZNXIKG.js → chunk-BJF5LOWE.js} +7 -7
- package/Build/Workers/{chunk-3S2MFY4B.js → chunk-C2CGMAIU.js} +13 -13
- package/Build/Workers/{chunk-UAJEGIWA.js → chunk-COYFZ5VA.js} +6 -6
- package/Build/Workers/{chunk-ZWPIM77Q.js → chunk-DGS5QNIO.js} +13 -13
- package/Build/Workers/{chunk-V7JB576Q.js → chunk-DKVHRNFY.js} +5 -5
- package/Build/Workers/{chunk-NI2R52QD.js → chunk-DOXCPOG4.js} +11 -9
- package/Build/Workers/{chunk-XWML5Y7N.js → chunk-FXIHSF7O.js} +9 -9
- package/Build/Workers/{chunk-LW7WGHEU.js → chunk-G3YR53LY.js} +13 -13
- package/Build/Workers/{chunk-34DGOKCO.js → chunk-GR3CDLCP.js} +7 -7
- package/Build/Workers/{chunk-AOIKO5Y7.js → chunk-GRAT5GE7.js} +5 -5
- package/Build/Workers/{chunk-AOFMPKUB.js → chunk-I2RC4XVN.js} +4 -4
- package/Build/Workers/{chunk-PK7TEP3J.js → chunk-JYAHOGGL.js} +15 -15
- package/Build/Workers/{chunk-4KIUON73.js → chunk-KUN2ZA5X.js} +4 -4
- package/Build/Workers/{chunk-POLFRINT.js → chunk-L6RTJ3RE.js} +14 -14
- package/Build/Workers/{chunk-LVJCR7DH.js → chunk-LCLJJ2MZ.js} +18 -18
- package/Build/Workers/{chunk-3RZK5NNV.js → chunk-LEABCTLP.js} +4 -4
- package/Build/Workers/{chunk-QKF7XXEQ.js → chunk-MDHQR3ZS.js} +10 -8
- package/Build/Workers/{chunk-4PHPQRSH.js → chunk-MSKXMXJI.js} +5 -6
- package/Build/Workers/{chunk-GIFJ77E4.js → chunk-NTXTUNEF.js} +4 -4
- package/Build/Workers/{chunk-I5TDPPC4.js → chunk-O3JCMSS3.js} +17 -17
- package/Build/Workers/{chunk-PEABJLCK.js → chunk-OOK53QUQ.js} +1 -1
- package/Build/Workers/{chunk-PS6AEMBR.js → chunk-OORVMGDU.js} +7 -7
- package/Build/Workers/{chunk-JI2445T5.js → chunk-PCP4YQST.js} +11 -11
- package/Build/Workers/{chunk-C5CE4OG6.js → chunk-PYHLO636.js} +42 -13
- package/Build/Workers/{chunk-S4XDCPKD.js → chunk-Q55ECN3Y.js} +1 -1
- package/Build/Workers/{chunk-WWP3I7R5.js → chunk-QD4KM3GO.js} +5 -5
- package/Build/Workers/{chunk-YLZTCEBJ.js → chunk-QMLTCCYG.js} +1 -1
- package/Build/Workers/{chunk-IBXGK4WV.js → chunk-QX5XS4LC.js} +2 -2
- package/Build/Workers/{chunk-RL73GOEF.js → chunk-R6B7UCQB.js} +2 -2
- package/Build/Workers/{chunk-RR7EOKGZ.js → chunk-RJYML24O.js} +48 -85
- package/Build/Workers/{chunk-U4IMCOF5.js → chunk-S3PI2KFM.js} +2 -2
- package/Build/Workers/{chunk-6HCAQOVK.js → chunk-STBBMQGG.js} +6 -6
- package/Build/Workers/{chunk-CE6GTZ4I.js → chunk-SYCPRK3D.js} +10 -10
- package/Build/Workers/{chunk-WFICTTOE.js → chunk-T77JILCU.js} +2 -2
- package/Build/Workers/{chunk-ZC4AGBZK.js → chunk-TO2PVHKI.js} +2 -2
- package/Build/Workers/{chunk-UCPPWV64.js → chunk-VE7BFUIX.js} +1 -1
- package/Build/Workers/{chunk-2CSEEWHN.js → chunk-VFBNELXB.js} +7 -7
- package/Build/Workers/{chunk-A6NCZSL3.js → chunk-VO3ACQB2.js} +19 -19
- package/Build/Workers/{chunk-WEGCQ5DY.js → chunk-X23FRWHJ.js} +6 -6
- package/Build/Workers/{chunk-G7CJQKKD.js → chunk-XD445VDH.js} +7 -7
- 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 +29 -25
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +32 -32
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +27 -27
- 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 +24 -24
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createPolylineGeometry.js +24 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +30 -30
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +26 -26
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +19 -19
- package/Build/Workers/createSimplePolylineGeometry.js +22 -22
- 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 +21 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +23 -23
- package/Build/Workers/createWallOutlineGeometry.js +22 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +12 -19
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +43 -79
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/ApproximateTerrainHeights.js +4 -4
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +12 -8
- package/Source/Core/BoundingRectangle.js +2 -0
- package/Source/Core/BoundingSphere.js +4 -2
- package/Source/Core/Cartesian3.js +13 -10
- package/Source/Core/Cartographic.js +11 -8
- package/Source/Core/CesiumTerrainProvider.js +3 -2
- package/Source/Core/CircleGeometry.js +6 -2
- package/Source/Core/CircleOutlineGeometry.js +1 -1
- package/Source/Core/CoplanarPolygonGeometry.js +3 -3
- package/Source/Core/CorridorGeometry.js +4 -4
- package/Source/Core/CorridorOutlineGeometry.js +2 -2
- package/Source/Core/Credit.js +3 -2
- package/Source/Core/CustomHeightmapTerrainProvider.js +17 -3
- package/Source/Core/EllipseGeometry.js +4 -4
- package/Source/Core/EllipseOutlineGeometry.js +2 -2
- package/Source/Core/Ellipsoid.js +34 -0
- package/Source/Core/EllipsoidGeodesic.js +2 -2
- package/Source/Core/EllipsoidRhumbLine.js +4 -4
- package/Source/Core/EllipsoidTangentPlane.js +3 -3
- package/Source/Core/EllipsoidTerrainProvider.js +3 -3
- package/Source/Core/GeographicProjection.js +4 -3
- package/Source/Core/GeographicTilingScheme.js +3 -3
- package/Source/Core/GeometryPipeline.js +2 -2
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
- package/Source/Core/GoogleMaps.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +1 -1
- package/Source/Core/HeightmapTessellator.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/Math.js +0 -5
- package/Source/Core/Occluder.js +3 -3
- package/Source/Core/OrientedBoundingBox.js +2 -2
- package/Source/Core/PolygonGeometry.js +4 -4
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +3 -3
- package/Source/Core/PolygonPipeline.js +2 -2
- package/Source/Core/PolylineGeometry.js +2 -2
- package/Source/Core/PolylinePipeline.js +6 -6
- package/Source/Core/PolylineVolumeGeometry.js +2 -2
- package/Source/Core/PolylineVolumeOutlineGeometry.js +2 -2
- package/Source/Core/Rectangle.js +6 -6
- package/Source/Core/RectangleGeometry.js +6 -6
- package/Source/Core/RectangleGeometryLibrary.js +3 -0
- package/Source/Core/RectangleOutlineGeometry.js +2 -2
- package/Source/Core/Simon1994PlanetaryPositions.js +3 -2
- package/Source/Core/SimplePolylineGeometry.js +2 -2
- package/Source/Core/Stereographic.js +2 -2
- package/Source/Core/TaskProcessor.js +19 -3
- package/Source/Core/Transforms.js +17 -17
- package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
- package/Source/Core/WallGeometry.js +3 -3
- package/Source/Core/WallOutlineGeometry.js +3 -3
- package/Source/Core/WebMercatorTilingScheme.js +3 -3
- package/Source/Core/createWorldTerrainAsync.js +2 -0
- package/Source/Core/sampleTerrain.js +3 -3
- package/Source/DataSources/BoxGeometryUpdater.js +2 -2
- package/Source/DataSources/CylinderGeometryUpdater.js +2 -2
- package/Source/DataSources/CzmlDataSource.js +8 -8
- package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -3
- package/Source/DataSources/EntityCluster.js +1 -1
- package/Source/DataSources/EntityView.js +2 -2
- package/Source/DataSources/KmlDataSource.js +4 -4
- package/Source/DataSources/ModelVisualizer.js +1 -2
- package/Source/DataSources/PolygonGeometryUpdater.js +1 -1
- package/Source/DataSources/PolylineGeometryUpdater.js +3 -2
- package/Source/DataSources/RectangleGeometryUpdater.js +1 -1
- package/Source/DataSources/ScaledPositionProperty.js +2 -2
- package/Source/DataSources/TerrainOffsetProperty.js +3 -7
- package/Source/DataSources/VelocityOrientationProperty.js +2 -2
- package/Source/DataSources/exportKml.js +2 -2
- package/Source/Renderer/UniformState.js +1 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +2 -2
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +8 -6
- package/Source/Scene/BingMapsImageryProvider.js +1 -1
- package/Source/Scene/Camera.js +16 -10
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/ClippingPolygon.js +2 -2
- package/Source/Scene/ClippingPolygonCollection.js +1 -1
- package/Source/Scene/CreditDisplay.js +94 -104
- package/Source/Scene/Globe.js +16 -13
- package/Source/Scene/GltfLoader.js +458 -435
- package/Source/Scene/GltfLoaderUtil.js +5 -16
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +23 -7
- package/Source/Scene/GltfStructuralMetadataLoader.js +11 -9
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +1 -1
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
- package/Source/Scene/GridImageryProvider.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/Label.js +1 -1
- package/Source/Scene/MapboxImageryProvider.js +1 -1
- package/Source/Scene/MapboxStyleImageryProvider.js +1 -1
- package/Source/Scene/MetadataSemantic.js +4 -4
- package/Source/Scene/Model/AlphaPipelineStage.js +1 -1
- package/Source/Scene/Model/GeometryPipelineStage.js +15 -43
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +7 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +3 -3
- package/Source/Scene/Model/LightingPipelineStage.js +2 -4
- package/Source/Scene/Model/MaterialPipelineStage.js +395 -29
- package/Source/Scene/Model/Model.js +15 -7
- package/Source/Scene/Model/ModelSceneGraph.js +1 -1
- package/Source/Scene/Model/ModelUtility.js +3 -0
- package/Source/Scene/Model/SceneMode2DPipelineStage.js +3 -3
- package/Source/Scene/Model/VerticalExaggerationPipelineStage.js +4 -6
- package/Source/Scene/Model/pickModel.js +2 -2
- package/Source/Scene/ModelComponents.js +178 -1
- package/Source/Scene/PickDepth.js +23 -15
- package/Source/Scene/Picking.js +4 -13
- package/Source/Scene/PointPrimitive.js +5 -2
- package/Source/Scene/ResourceCache.js +41 -50
- package/Source/Scene/ResourceCacheKey.js +41 -53
- package/Source/Scene/Scene.js +39 -31
- package/Source/Scene/SceneTransforms.js +78 -20
- package/Source/Scene/SceneTransitioner.js +2 -2
- package/Source/Scene/ScreenSpaceCameraController.js +29 -19
- package/Source/Scene/SkyBox.js +26 -0
- package/Source/Scene/Sun.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -10
- package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/{ellipsoidWgs84TextureCoordinates.js → ellipsoidTextureCoordinates.js} +3 -3
- package/Source/Shaders/Builtin/Functions/maximumComponent.glsl +21 -0
- package/Source/Shaders/Builtin/Functions/maximumComponent.js +23 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +108 -44
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +108 -44
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +1 -1
- package/Source/Shaders/Builtin/Structs/materialInput.js +1 -1
- package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +16 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.js +16 -0
- package/Source/Shaders/EllipsoidFS.glsl +1 -1
- package/Source/Shaders/EllipsoidFS.js +1 -1
- package/Source/Shaders/GlobeFS.glsl +3 -3
- package/Source/Shaders/GlobeFS.js +3 -3
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +211 -133
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +212 -133
- package/Source/Shaders/Model/LightingStageFS.glsl +113 -48
- package/Source/Shaders/Model/LightingStageFS.js +113 -48
- package/Source/Shaders/Model/MaterialStageFS.glsl +407 -136
- package/Source/Shaders/Model/MaterialStageFS.js +407 -136
- package/Source/Widget/CesiumWidget.css +0 -5
- package/Source/Widget/CesiumWidget.js +29 -28
- package/index.d.ts +184 -116
- package/index.js +92 -95
- package/package.json +2 -2
- package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.glsl +0 -16
- package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.js +0 -18
- package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.glsl +0 -10
- package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.glsl +0 -37
- package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js +0 -39
- package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.glsl +0 -30
- package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js +0 -32
- package/Source/Shaders/Builtin/Structs/pbrParameters.glsl +0 -16
- package/Source/Shaders/Builtin/Structs/pbrParameters.js +0 -18
|
@@ -35,9 +35,7 @@ const GltfLoaderUtil = {};
|
|
|
35
35
|
*/
|
|
36
36
|
GltfLoaderUtil.getImageIdFromTexture = function (options) {
|
|
37
37
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
38
|
-
const gltf = options
|
|
39
|
-
const textureId = options.textureId;
|
|
40
|
-
const supportedImageFormats = options.supportedImageFormats;
|
|
38
|
+
const { gltf, textureId, supportedImageFormats } = options;
|
|
41
39
|
|
|
42
40
|
//>>includeStart('debug', pragmas.debug);
|
|
43
41
|
Check.typeOf.object("options.gltf", gltf);
|
|
@@ -73,12 +71,7 @@ GltfLoaderUtil.getImageIdFromTexture = function (options) {
|
|
|
73
71
|
*/
|
|
74
72
|
GltfLoaderUtil.createSampler = function (options) {
|
|
75
73
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
76
|
-
const gltf = options
|
|
77
|
-
const textureInfo = options.textureInfo;
|
|
78
|
-
const compressedTextureNoMipmap = defaultValue(
|
|
79
|
-
options.compressedTextureNoMipmap,
|
|
80
|
-
false
|
|
81
|
-
);
|
|
74
|
+
const { gltf, textureInfo, compressedTextureNoMipmap = false } = options;
|
|
82
75
|
|
|
83
76
|
//>>includeStart('debug', pragmas.debug);
|
|
84
77
|
Check.typeOf.object("options.gltf", gltf);
|
|
@@ -140,9 +133,7 @@ const defaultScale = new Cartesian2(1.0, 1.0);
|
|
|
140
133
|
*/
|
|
141
134
|
GltfLoaderUtil.createModelTextureReader = function (options) {
|
|
142
135
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
143
|
-
const textureInfo = options
|
|
144
|
-
const channels = options.channels;
|
|
145
|
-
const texture = options.texture;
|
|
136
|
+
const { textureInfo, channels, texture } = options;
|
|
146
137
|
|
|
147
138
|
//>>includeStart('debug', pragmas.debug);
|
|
148
139
|
Check.typeOf.object("options.textureInfo", textureInfo);
|
|
@@ -151,10 +142,7 @@ GltfLoaderUtil.createModelTextureReader = function (options) {
|
|
|
151
142
|
let texCoord = defaultValue(textureInfo.texCoord, 0);
|
|
152
143
|
let transform;
|
|
153
144
|
|
|
154
|
-
const textureTransform =
|
|
155
|
-
textureInfo.extensions,
|
|
156
|
-
defaultValue.EMPTY_OBJECT
|
|
157
|
-
).KHR_texture_transform;
|
|
145
|
+
const textureTransform = textureInfo.extensions?.KHR_texture_transform;
|
|
158
146
|
|
|
159
147
|
if (defined(textureTransform)) {
|
|
160
148
|
texCoord = defaultValue(textureTransform.texCoord, texCoord);
|
|
@@ -186,6 +174,7 @@ GltfLoaderUtil.createModelTextureReader = function (options) {
|
|
|
186
174
|
modelTextureReader.index = textureInfo.index;
|
|
187
175
|
modelTextureReader.texture = texture;
|
|
188
176
|
modelTextureReader.texCoord = texCoord;
|
|
177
|
+
modelTextureReader.scale = textureInfo.scale;
|
|
189
178
|
modelTextureReader.transform = transform;
|
|
190
179
|
modelTextureReader.channels = channels;
|
|
191
180
|
|
|
@@ -33,10 +33,11 @@ function forEachTextureInMaterial(material, handler) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const { extensions } = material;
|
|
37
|
+
if (defined(extensions)) {
|
|
37
38
|
// Spec gloss extension
|
|
38
39
|
const pbrSpecularGlossiness =
|
|
39
|
-
|
|
40
|
+
extensions.KHR_materials_pbrSpecularGlossiness;
|
|
40
41
|
if (defined(pbrSpecularGlossiness)) {
|
|
41
42
|
if (defined(pbrSpecularGlossiness.diffuseTexture)) {
|
|
42
43
|
const textureInfo = pbrSpecularGlossiness.diffuseTexture;
|
|
@@ -54,13 +55,28 @@ function forEachTextureInMaterial(material, handler) {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
// Specular extension
|
|
59
|
+
const specular = extensions.KHR_materials_specular;
|
|
60
|
+
if (defined(specular)) {
|
|
61
|
+
const { specularTexture, specularColorTexture } = specular;
|
|
62
|
+
if (defined(specularTexture)) {
|
|
63
|
+
const value = handler(specularTexture.index, specularTexture);
|
|
64
|
+
if (defined(value)) {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (defined(specularColorTexture)) {
|
|
69
|
+
const value = handler(specularColorTexture.index, specularColorTexture);
|
|
70
|
+
if (defined(value)) {
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
57
76
|
// Materials common extension (may be present in models converted from glTF 1.0)
|
|
58
|
-
const materialsCommon =
|
|
77
|
+
const materialsCommon = extensions.KHR_materials_common;
|
|
59
78
|
if (defined(materialsCommon) && defined(materialsCommon.values)) {
|
|
60
|
-
const diffuse = materialsCommon.values
|
|
61
|
-
const ambient = materialsCommon.values.ambient;
|
|
62
|
-
const emission = materialsCommon.values.emission;
|
|
63
|
-
const specular = materialsCommon.values.specular;
|
|
79
|
+
const { diffuse, ambient, emission, specular } = materialsCommon.values;
|
|
64
80
|
if (defined(diffuse) && defined(diffuse.index)) {
|
|
65
81
|
const value = handler(diffuse.index, diffuse);
|
|
66
82
|
if (defined(value)) {
|
|
@@ -34,15 +34,17 @@ import ResourceLoaderState from "./ResourceLoaderState.js";
|
|
|
34
34
|
*/
|
|
35
35
|
function GltfStructuralMetadataLoader(options) {
|
|
36
36
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
const {
|
|
38
|
+
gltf,
|
|
39
|
+
extension,
|
|
40
|
+
extensionLegacy,
|
|
41
|
+
gltfResource,
|
|
42
|
+
baseResource,
|
|
43
|
+
supportedImageFormats,
|
|
44
|
+
frameState,
|
|
45
|
+
cacheKey,
|
|
46
|
+
asynchronous = true,
|
|
47
|
+
} = options;
|
|
46
48
|
|
|
47
49
|
//>>includeStart('debug', pragmas.debug);
|
|
48
50
|
Check.typeOf.object("options.gltf", gltf);
|
|
@@ -45,7 +45,7 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function (
|
|
|
45
45
|
*
|
|
46
46
|
* Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
|
|
47
47
|
*
|
|
48
|
-
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the
|
|
48
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
49
49
|
* @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile
|
|
50
50
|
* is invalid and should be discarded. If this value is not specified, a default
|
|
51
51
|
* is to discard tiles that fail to download.
|
|
@@ -41,7 +41,7 @@ import ImageryProvider from "./ImageryProvider.js";
|
|
|
41
41
|
* @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile
|
|
42
42
|
* is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
|
|
43
43
|
* a {@link NeverTileDiscardPolicy} for this parameter.
|
|
44
|
-
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the
|
|
44
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -14,9 +14,9 @@ const defaultBackgroundColor = new Color(0.0, 0.5, 0.0, 0.2);
|
|
|
14
14
|
* Initialization options for the GridImageryProvider constructor
|
|
15
15
|
*
|
|
16
16
|
* @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.
|
|
17
|
-
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
|
|
17
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If the tilingScheme is specified,
|
|
18
18
|
* this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
|
|
19
|
-
* parameter is specified, the
|
|
19
|
+
* parameter is specified, the default ellipsoid is used.
|
|
20
20
|
* @property {number} [cells=8] The number of grids cells.
|
|
21
21
|
* @property {Color} [color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines.
|
|
22
22
|
* @property {Color} [glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines.
|
|
@@ -436,7 +436,7 @@ ImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) {
|
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
const pickedLocation = scene.
|
|
439
|
+
const pickedLocation = scene.ellipsoid.cartesianToCartographic(
|
|
440
440
|
pickedPosition
|
|
441
441
|
);
|
|
442
442
|
|
|
@@ -491,7 +491,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
|
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
const pickedLocation = scene.
|
|
494
|
+
const pickedLocation = scene.ellipsoid.cartesianToCartographic(
|
|
495
495
|
pickedPosition
|
|
496
496
|
);
|
|
497
497
|
|
package/Source/Scene/Label.js
CHANGED
|
@@ -91,7 +91,7 @@ function parseFont(label) {
|
|
|
91
91
|
* Initialization options for the Label constructor
|
|
92
92
|
*
|
|
93
93
|
* @property {Cartesian3} position The cartesian position of the label.
|
|
94
|
-
* @property {
|
|
94
|
+
* @property {*} [id] A user-defined object to return when the label is picked with {@link Scene#pick}.
|
|
95
95
|
* @property {boolean} [show=true] Determines if this label will be shown.
|
|
96
96
|
* @property {string} [text] A string specifying the text of the label.
|
|
97
97
|
* @property {string} [font='30px sans-serif'] A string specifying the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
|
|
@@ -19,7 +19,7 @@ const defaultCredit = new Credit(
|
|
|
19
19
|
* @property {string} mapId The Mapbox Map ID.
|
|
20
20
|
* @property {string} accessToken The public access token for the imagery.
|
|
21
21
|
* @property {string} [format='png'] The format of the image request.
|
|
22
|
-
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the
|
|
22
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
23
23
|
* @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
24
24
|
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
|
|
25
25
|
* to result in rendering problems.
|
|
@@ -21,7 +21,7 @@ const defaultCredit = new Credit(
|
|
|
21
21
|
* @property {string} accessToken The public access token for the imagery.
|
|
22
22
|
* @property {number} [tilesize=512] The size of the image tiles.
|
|
23
23
|
* @property {boolean} [scaleFactor] Determines if tiles are rendered at a @2x scale factor.
|
|
24
|
-
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the
|
|
24
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
25
25
|
* @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
26
26
|
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
|
|
27
27
|
* to result in rendering problems.
|
|
@@ -65,7 +65,7 @@ const MetadataSemantic = {
|
|
|
65
65
|
*/
|
|
66
66
|
TILE_BOUNDING_SPHERE: "TILE_BOUNDING_SPHERE",
|
|
67
67
|
/**
|
|
68
|
-
* The minimum height of a tile above (or below) the
|
|
68
|
+
* The minimum height of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.
|
|
69
69
|
*
|
|
70
70
|
* @type {string}
|
|
71
71
|
* @constant
|
|
@@ -73,7 +73,7 @@ const MetadataSemantic = {
|
|
|
73
73
|
*/
|
|
74
74
|
TILE_MINIMUM_HEIGHT: "TILE_MINIMUM_HEIGHT",
|
|
75
75
|
/**
|
|
76
|
-
* The maximum height of a tile above (or below) the
|
|
76
|
+
* The maximum height of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.
|
|
77
77
|
*
|
|
78
78
|
* @type {string}
|
|
79
79
|
* @constant
|
|
@@ -123,7 +123,7 @@ const MetadataSemantic = {
|
|
|
123
123
|
*/
|
|
124
124
|
CONTENT_BOUNDING_SPHERE: "CONTENT_BOUNDING_SPHERE",
|
|
125
125
|
/**
|
|
126
|
-
* The minimum height of the content of a tile above (or below) the
|
|
126
|
+
* The minimum height of the content of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>
|
|
127
127
|
*
|
|
128
128
|
* @type {string}
|
|
129
129
|
* @constant
|
|
@@ -131,7 +131,7 @@ const MetadataSemantic = {
|
|
|
131
131
|
*/
|
|
132
132
|
CONTENT_MINIMUM_HEIGHT: "CONTENT_MINIMUM_HEIGHT",
|
|
133
133
|
/**
|
|
134
|
-
* The maximum height of the content of a tile above (or below) the
|
|
134
|
+
* The maximum height of the content of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>
|
|
135
135
|
*
|
|
136
136
|
* @type {string}
|
|
137
137
|
* @constant
|
|
@@ -63,8 +63,7 @@ GeometryPipelineStage.process = function (
|
|
|
63
63
|
primitive,
|
|
64
64
|
frameState
|
|
65
65
|
) {
|
|
66
|
-
const shaderBuilder = renderResources
|
|
67
|
-
const model = renderResources.model;
|
|
66
|
+
const { shaderBuilder, model } = renderResources;
|
|
68
67
|
|
|
69
68
|
// These structs are similar, though the fragment shader version has a couple
|
|
70
69
|
// additional fields.
|
|
@@ -125,8 +124,7 @@ GeometryPipelineStage.process = function (
|
|
|
125
124
|
);
|
|
126
125
|
|
|
127
126
|
// .pnts point clouds store sRGB color rather than linear color
|
|
128
|
-
|
|
129
|
-
if (modelType === ModelType.TILE_PNTS) {
|
|
127
|
+
if (model.type === ModelType.TILE_PNTS) {
|
|
130
128
|
shaderBuilder.addDefine(
|
|
131
129
|
"HAS_SRGB_COLOR",
|
|
132
130
|
undefined,
|
|
@@ -246,8 +244,7 @@ function processAttribute(
|
|
|
246
244
|
}
|
|
247
245
|
|
|
248
246
|
function addSemanticDefine(shaderBuilder, attribute) {
|
|
249
|
-
const semantic = attribute
|
|
250
|
-
const setIndex = attribute.setIndex;
|
|
247
|
+
const { semantic, setIndex } = attribute;
|
|
251
248
|
switch (semantic) {
|
|
252
249
|
case VertexAttributeSemantic.NORMAL:
|
|
253
250
|
shaderBuilder.addDefine("HAS_NORMALS");
|
|
@@ -272,19 +269,11 @@ function addAttributeToRenderResources(
|
|
|
272
269
|
attributeIndex,
|
|
273
270
|
modifyFor2D
|
|
274
271
|
) {
|
|
275
|
-
const quantization = attribute
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
type = quantization.type;
|
|
280
|
-
componentDatatype = quantization.componentDatatype;
|
|
281
|
-
} else {
|
|
282
|
-
type = attribute.type;
|
|
283
|
-
componentDatatype = attribute.componentDatatype;
|
|
284
|
-
}
|
|
272
|
+
const { quantization, semantic, setIndex } = attribute;
|
|
273
|
+
const { type, componentDatatype } = defined(quantization)
|
|
274
|
+
? quantization
|
|
275
|
+
: attribute;
|
|
285
276
|
|
|
286
|
-
const semantic = attribute.semantic;
|
|
287
|
-
const setIndex = attribute.setIndex;
|
|
288
277
|
if (
|
|
289
278
|
semantic === VertexAttributeSemantic.FEATURE_ID &&
|
|
290
279
|
setIndex >= renderResources.featureIdVertexAttributeSetIndex
|
|
@@ -337,18 +326,10 @@ function addMatrixAttributeToRenderResources(
|
|
|
337
326
|
attributeIndex,
|
|
338
327
|
columnCount
|
|
339
328
|
) {
|
|
340
|
-
const quantization = attribute
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
type = quantization.type;
|
|
345
|
-
componentDatatype = quantization.componentDatatype;
|
|
346
|
-
} else {
|
|
347
|
-
type = attribute.type;
|
|
348
|
-
componentDatatype = attribute.componentDatatype;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
const normalized = attribute.normalized;
|
|
329
|
+
const { quantization, normalized } = attribute;
|
|
330
|
+
const { type, componentDatatype } = defined(quantization)
|
|
331
|
+
? quantization
|
|
332
|
+
: attribute;
|
|
352
333
|
|
|
353
334
|
// componentCount is either 4, 9 or 16
|
|
354
335
|
const componentCount = AttributeType.getNumberOfComponents(type);
|
|
@@ -435,7 +416,7 @@ function addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D) {
|
|
|
435
416
|
function updateAttributesStruct(shaderBuilder, attributeInfo, use2D) {
|
|
436
417
|
const vsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS;
|
|
437
418
|
const fsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS;
|
|
438
|
-
const variableName = attributeInfo
|
|
419
|
+
const { variableName, glslType } = attributeInfo;
|
|
439
420
|
|
|
440
421
|
if (variableName === "tangentMC") {
|
|
441
422
|
// The w component of the tangent is only used for computing the bitangent,
|
|
@@ -451,16 +432,8 @@ function updateAttributesStruct(shaderBuilder, attributeInfo, use2D) {
|
|
|
451
432
|
shaderBuilder.addStructField(vsStructId, "vec3", "normalMC");
|
|
452
433
|
shaderBuilder.addStructField(fsStructId, "vec3", "normalEC");
|
|
453
434
|
} else {
|
|
454
|
-
shaderBuilder.addStructField(
|
|
455
|
-
|
|
456
|
-
attributeInfo.glslType,
|
|
457
|
-
variableName
|
|
458
|
-
);
|
|
459
|
-
shaderBuilder.addStructField(
|
|
460
|
-
fsStructId,
|
|
461
|
-
attributeInfo.glslType,
|
|
462
|
-
variableName
|
|
463
|
-
);
|
|
435
|
+
shaderBuilder.addStructField(vsStructId, glslType, variableName);
|
|
436
|
+
shaderBuilder.addStructField(fsStructId, glslType, variableName);
|
|
464
437
|
}
|
|
465
438
|
|
|
466
439
|
if (variableName === "positionMC" && use2D) {
|
|
@@ -501,8 +474,7 @@ function updateInitializeAttributesFunction(
|
|
|
501
474
|
}
|
|
502
475
|
|
|
503
476
|
function updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo) {
|
|
504
|
-
const semantic = attributeInfo.attribute
|
|
505
|
-
const setIndex = attributeInfo.attribute.setIndex;
|
|
477
|
+
const { semantic, setIndex } = attributeInfo.attribute;
|
|
506
478
|
if (defined(semantic) && !defined(setIndex)) {
|
|
507
479
|
// positions, normals, and tangents are handled statically in
|
|
508
480
|
// GeometryStageVS
|
|
@@ -8,6 +8,13 @@ const ImageBasedLightingPipelineStage = {
|
|
|
8
8
|
name: "ImageBasedLightingPipelineStage", // Helps with debugging
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Add shader code, uniforms, and defines related to image based lighting
|
|
13
|
+
* @param {ModelRenderResources} renderResources
|
|
14
|
+
* @param {Model} model
|
|
15
|
+
* @param {FrameState} frameState
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
11
18
|
ImageBasedLightingPipelineStage.process = function (
|
|
12
19
|
renderResources,
|
|
13
20
|
model,
|
|
@@ -276,7 +276,7 @@ function projectPositionTo2D(
|
|
|
276
276
|
projectedPositionScratch
|
|
277
277
|
);
|
|
278
278
|
|
|
279
|
-
result = SceneTransforms.
|
|
279
|
+
result = SceneTransforms.computeActualEllipsoidPosition(
|
|
280
280
|
frameState,
|
|
281
281
|
finalPosition,
|
|
282
282
|
result
|
|
@@ -432,7 +432,7 @@ function computeReferencePoint2D(renderResources, frameState) {
|
|
|
432
432
|
scratchProjectedMin
|
|
433
433
|
);
|
|
434
434
|
|
|
435
|
-
const projectedMin = SceneTransforms.
|
|
435
|
+
const projectedMin = SceneTransforms.computeActualEllipsoidPosition(
|
|
436
436
|
frameState,
|
|
437
437
|
transformedPositionMin,
|
|
438
438
|
transformedPositionMin
|
|
@@ -444,7 +444,7 @@ function computeReferencePoint2D(renderResources, frameState) {
|
|
|
444
444
|
scratchProjectedMax
|
|
445
445
|
);
|
|
446
446
|
|
|
447
|
-
const projectedMax = SceneTransforms.
|
|
447
|
+
const projectedMax = SceneTransforms.computeActualEllipsoidPosition(
|
|
448
448
|
frameState,
|
|
449
449
|
transformedPositionMax,
|
|
450
450
|
transformedPositionMax
|
|
@@ -28,9 +28,7 @@ const LightingPipelineStage = {
|
|
|
28
28
|
* @private
|
|
29
29
|
*/
|
|
30
30
|
LightingPipelineStage.process = function (renderResources, primitive) {
|
|
31
|
-
const model = renderResources
|
|
32
|
-
const lightingOptions = renderResources.lightingOptions;
|
|
33
|
-
const shaderBuilder = renderResources.shaderBuilder;
|
|
31
|
+
const { model, lightingOptions, shaderBuilder } = renderResources;
|
|
34
32
|
|
|
35
33
|
if (defined(model.lightColor)) {
|
|
36
34
|
shaderBuilder.addDefine(
|
|
@@ -53,7 +51,7 @@ LightingPipelineStage.process = function (renderResources, primitive) {
|
|
|
53
51
|
|
|
54
52
|
// The lighting model is always set by the material. However, custom shaders
|
|
55
53
|
// can override this.
|
|
56
|
-
const lightingModel = lightingOptions
|
|
54
|
+
const { lightingModel } = lightingOptions;
|
|
57
55
|
|
|
58
56
|
if (lightingModel === LightingModel.PBR) {
|
|
59
57
|
shaderBuilder.addDefine(
|