@cesium/engine 22.3.0 → 23.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/Workers/{chunk-EAAH543Q.js → chunk-2GL2EUEE.js} +11 -11
- package/Build/Workers/{chunk-EUDHHS7K.js → chunk-2WI4HGJU.js} +6 -6
- package/Build/Workers/{chunk-LWZHJWYK.js → chunk-36LBFITA.js} +665 -366
- package/Build/Workers/{chunk-7U5YNLF3.js → chunk-3B65YFXC.js} +1 -1
- package/Build/Workers/{chunk-D63Z7KKL.js → chunk-4LGFX2P5.js} +11 -11
- package/Build/Workers/{chunk-D6OKR3BQ.js → chunk-4UNQX2MP.js} +2 -2
- package/Build/Workers/{chunk-BO22JHBX.js → chunk-52K3GJKG.js} +3 -3
- package/Build/Workers/{chunk-XLIJV3YZ.js → chunk-56OHFSLH.js} +10 -10
- package/Build/Workers/{chunk-AWELU5C6.js → chunk-5A7YSAXT.js} +14 -14
- package/Build/Workers/{chunk-T5MJDW43.js → chunk-5JP5FG7U.js} +7 -7
- package/Build/Workers/{chunk-NVL7JXAQ.js → chunk-5R7SBUTW.js} +10 -10
- package/Build/Workers/chunk-5VKZVPO5.js +1829 -0
- package/Build/Workers/{chunk-YHPBT4I5.js → chunk-6FVFM2KB.js} +5 -5
- package/Build/Workers/{chunk-WHLGBMBC.js → chunk-6SLGTBB2.js} +5 -5
- package/Build/Workers/{chunk-VIQIKMTZ.js → chunk-7KRN6JPQ.js} +14 -14
- package/Build/Workers/{chunk-TCOUGKXF.js → chunk-AA33B6PU.js} +4 -4
- package/Build/Workers/{chunk-S2KVL7OJ.js → chunk-AP6XWET5.js} +8 -8
- package/Build/Workers/{chunk-5PJB7ASO.js → chunk-APDKMX7W.js} +6 -6
- package/Build/Workers/{chunk-IXL46IYV.js → chunk-ARCFIOKA.js} +12 -12
- package/Build/Workers/{chunk-KIJR26N3.js → chunk-BNBD2YZK.js} +16 -16
- package/Build/Workers/{chunk-4R6FGUFP.js → chunk-DT5SJBKA.js} +29 -15
- package/Build/Workers/{chunk-FUDC3KOT.js → chunk-ESD4IEOU.js} +5 -5
- package/Build/Workers/{chunk-K2PLKJJG.js → chunk-FSDVXW7M.js} +5 -5
- package/Build/Workers/{chunk-4BBANFU6.js → chunk-G3YT7M7A.js} +1 -1
- package/Build/Workers/{chunk-K4PGSAR5.js → chunk-GN5NEUDT.js} +8 -8
- package/Build/Workers/{chunk-OOYICVOK.js → chunk-HYLEKKO5.js} +1 -1
- package/Build/Workers/{chunk-FDOLXORR.js → chunk-HYTFXWMY.js} +7 -7
- package/Build/Workers/{chunk-7SLNBIZS.js → chunk-IFA7VHHP.js} +560 -277
- package/Build/Workers/{chunk-N66PIK46.js → chunk-IYVDOB5V.js} +4 -4
- package/Build/Workers/{chunk-ZWWN2CQH.js → chunk-JUGY5AZN.js} +4 -4
- package/Build/Workers/{chunk-4O2ARYS7.js → chunk-KPYU6YZG.js} +1 -1
- package/Build/Workers/{chunk-TY5JXMVO.js → chunk-L7RDJ4V7.js} +1 -1
- package/Build/Workers/{chunk-L4OFWHNI.js → chunk-LDQWNMEC.js} +1 -1
- package/Build/Workers/{chunk-N6XBJBI7.js → chunk-MQJG522T.js} +6 -6
- package/Build/Workers/{chunk-FS42VX2H.js → chunk-MT5M7RLZ.js} +2 -2
- package/Build/Workers/{chunk-7ATKQRBM.js → chunk-N4AWE7TZ.js} +10 -10
- package/Build/Workers/{chunk-EOSX23OS.js → chunk-NAYRNPEP.js} +4 -4
- package/Build/Workers/{chunk-NO3LMU7T.js → chunk-NNHU33JK.js} +7 -7
- package/Build/Workers/{chunk-HWGP4GVC.js → chunk-NQCAZU7S.js} +13 -13
- package/Build/Workers/{chunk-6GBGEUWR.js → chunk-NUYLNQKV.js} +2 -2
- package/Build/Workers/{chunk-E4YDCSQK.js → chunk-OC6X22PG.js} +9 -9
- package/Build/Workers/{chunk-ZGGVEGTA.js → chunk-OHBM4YG4.js} +12 -12
- package/Build/Workers/{chunk-6WDMPXQ7.js → chunk-OMXN7YF4.js} +12 -12
- package/Build/Workers/{chunk-LK7GEFGB.js → chunk-OQ3EAJNW.js} +2 -2
- package/Build/Workers/{chunk-M5DVYXJJ.js → chunk-OQBPOKPZ.js} +6 -6
- package/Build/Workers/{chunk-WUWPKBOZ.js → chunk-PQVNT5CJ.js} +6 -6
- package/Build/Workers/{chunk-W5NV72VR.js → chunk-QA24Q62E.js} +17 -17
- package/Build/Workers/{chunk-PJLRXIMS.js → chunk-QQX7S5QT.js} +17 -17
- package/Build/Workers/{chunk-D2PEV362.js → chunk-QTOHIXGF.js} +10 -10
- package/Build/Workers/{chunk-MASEF4OV.js → chunk-R7M4XNPP.js} +8 -8
- package/Build/Workers/{chunk-2MLJ46ZZ.js → chunk-SGKTBHFQ.js} +13 -13
- package/Build/Workers/{chunk-EY5HOJFQ.js → chunk-SQTRWKO2.js} +5 -5
- package/Build/Workers/{chunk-AFGP5BXS.js → chunk-T43FXHNC.js} +7 -7
- package/Build/Workers/{chunk-IHFAFGR2.js → chunk-UEEGWJJP.js} +2 -2
- package/Build/Workers/{chunk-TMGLPEZW.js → chunk-WKXDCVBO.js} +4 -4
- package/Build/Workers/{chunk-VRAAQ3FS.js → chunk-Y5AJSEEN.js} +2 -2
- package/Build/Workers/{chunk-Y5MRBKQN.js → chunk-ZIW5FCIW.js} +18 -18
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/AttributeCompression.js +53 -6
- package/Source/Core/Cartesian2.js +689 -684
- package/Source/Core/Cartesian3.js +1044 -1043
- package/Source/Core/Cartesian4.js +816 -813
- package/Source/Core/GoogleMaps.js +23 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/OpenCageGeocoderService.js +2 -3
- package/Source/Core/globalTypes.js +16 -0
- package/Source/Renderer/ShaderDestination.js +54 -13
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +7 -4
- package/Source/Scene/BillboardCollection.js +64 -25
- package/Source/Scene/BufferLoader.js +65 -74
- package/Source/Scene/CubeMapPanorama.js +351 -0
- package/Source/Scene/DerivedCommand.js +8 -31
- package/Source/Scene/DracoLoader.js +79 -78
- package/Source/Scene/EquirectangularPanorama.js +264 -0
- package/Source/Scene/FrameState.js +7 -0
- package/Source/Scene/GaussianSplatPrimitive.js +906 -167
- package/Source/Scene/GlobeSurfaceShaderSet.js +36 -32
- package/Source/Scene/GltfBufferViewLoader.js +109 -118
- package/Source/Scene/GltfDracoLoader.js +167 -176
- package/Source/Scene/GltfImageLoader.js +91 -101
- package/Source/Scene/GltfIndexBufferLoader.js +228 -241
- package/Source/Scene/GltfJsonLoader.js +90 -99
- package/Source/Scene/GltfLoader.js +313 -324
- package/Source/Scene/GltfSpzLoader.js +127 -134
- package/Source/Scene/GltfStructuralMetadataLoader.js +181 -186
- package/Source/Scene/GltfTextureLoader.js +217 -231
- package/Source/Scene/GltfVertexBufferLoader.js +267 -276
- package/Source/Scene/GoogleStreetViewCubeMapPanoramaProvider.js +341 -0
- package/Source/Scene/Label.js +6 -4
- package/Source/Scene/LabelCollection.js +59 -1
- package/Source/Scene/MetadataClassProperty.js +212 -7
- package/Source/Scene/MetadataComponentType.js +162 -127
- package/Source/Scene/MetadataSchemaLoader.js +60 -67
- package/Source/Scene/MetadataTable.js +14 -0
- package/Source/Scene/MetadataTableProperty.js +14 -0
- package/Source/Scene/Model/B3dmLoader.js +216 -224
- package/Source/Scene/Model/CustomShader.js +6 -1
- package/Source/Scene/Model/CustomShaderPipelineStage.js +122 -7
- package/Source/Scene/Model/GeoJsonLoader.js +53 -61
- package/Source/Scene/Model/GeometryPipelineStage.js +17 -3
- package/Source/Scene/Model/I3dmLoader.js +232 -240
- package/Source/Scene/Model/MaterialPipelineStage.js +1 -1
- package/Source/Scene/Model/MetadataPipelineStage.js +438 -22
- package/Source/Scene/Model/PntsLoader.js +78 -89
- package/Source/Scene/Panorama.js +53 -0
- package/Source/Scene/PanoramaProvider.js +43 -0
- package/Source/Scene/PointPrimitiveCollection.js +14 -22
- package/Source/Scene/PropertyTable.js +43 -0
- package/Source/Scene/PropertyTexture.js +1 -1
- package/Source/Scene/PropertyTextureProperty.js +0 -97
- package/Source/Scene/ResourceLoader.js +84 -92
- package/Source/Scene/Scene.js +12 -0
- package/Source/Scene/SkyBox.js +29 -164
- package/Source/Scene/StructuralMetadata.js +18 -3
- package/Source/Scene/parseStructuralMetadata.js +244 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +66 -40
- package/Source/Shaders/BillboardCollectionFS.js +67 -40
- package/Source/Shaders/BillboardCollectionVS.glsl +22 -31
- package/Source/Shaders/BillboardCollectionVS.js +22 -31
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/Builtin/Functions/decodeRGB8.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
- package/Source/Shaders/Builtin/Functions/unpackTexture.glsl +35 -0
- package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
- package/Source/Shaders/CubeMapPanoramaVS.glsl +11 -0
- package/Source/Shaders/CubeMapPanoramaVS.js +13 -0
- package/Source/Shaders/Model/MetadataStageFS.glsl +2 -1
- package/Source/Shaders/Model/MetadataStageFS.js +2 -1
- package/Source/Shaders/Model/MetadataStageVS.glsl +2 -1
- package/Source/Shaders/Model/MetadataStageVS.js +2 -1
- package/Source/Shaders/Model/ModelFS.glsl +2 -2
- package/Source/Shaders/Model/ModelFS.js +2 -2
- package/Source/Shaders/Model/ModelVS.glsl +2 -2
- package/Source/Shaders/Model/ModelVS.js +2 -2
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +8 -39
- package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
- package/index.d.ts +564 -189
- package/index.js +127 -119
- package/package.json +1 -1
- package/Build/Workers/chunk-LYBNPUEI.js +0 -1443
|
@@ -5,7 +5,11 @@ import Resource from "./Resource.js";
|
|
|
5
5
|
* Default settings for accessing the Google Maps API.
|
|
6
6
|
* <br/>
|
|
7
7
|
* An API key is only required if you are directly using any Google Maps APIs, such as through {@link createGooglePhotorealistic3DTileset}.
|
|
8
|
-
* Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}
|
|
8
|
+
* Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}.
|
|
9
|
+
* <br/>
|
|
10
|
+
* You can enable multiple Google Maps Platform APIs on a single API key.
|
|
11
|
+
* However, a separate {@link GoogleMaps.defaultStreetViewStaticApiKey}
|
|
12
|
+
* is available if you prefer to use a dedicated key for the Street View Static API.
|
|
9
13
|
*
|
|
10
14
|
* @see createGooglePhotorealistic3DTileset
|
|
11
15
|
* @see https://developers.google.com/maps/documentation/embed/get-api-key
|
|
@@ -31,9 +35,26 @@ GoogleMaps.mapTilesApiEndpoint = new Resource({
|
|
|
31
35
|
url: "https://tile.googleapis.com/",
|
|
32
36
|
});
|
|
33
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Gets or sets the default Google Maps Street View Static API key.
|
|
40
|
+
*
|
|
41
|
+
* @type {undefined|string}
|
|
42
|
+
*/
|
|
43
|
+
GoogleMaps.defaultStreetViewStaticApiKey = undefined;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Gets or sets the default Google Street View Static API endpoint.
|
|
47
|
+
*
|
|
48
|
+
* @type {string|Resource}
|
|
49
|
+
* @default https://maps.googleapis.com/maps/api/streetview
|
|
50
|
+
*/
|
|
51
|
+
GoogleMaps.streetViewStaticApiEndpoint = new Resource({
|
|
52
|
+
url: "https://maps.googleapis.com/maps/api/streetview",
|
|
53
|
+
});
|
|
54
|
+
|
|
34
55
|
GoogleMaps.getDefaultCredit = function () {
|
|
35
56
|
return new Credit(
|
|
36
|
-
`<img src
|
|
57
|
+
`<img alt=\"Google\" src=\"https://assets.ion.cesium.com/google-credit.png\" style=\"vertical-align:-6px\">`,
|
|
37
58
|
true,
|
|
38
59
|
);
|
|
39
60
|
};
|
package/Source/Core/Ion.js
CHANGED
|
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
7
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMzVlNTU2ZC1lYmM1LTQ2OWEtODRhOS0wYTFkODZmZTQ0OTgiLCJpZCI6MjU5LCJpYXQiOjE3NzI0ODIxOTR9.1oVHvVA9yr1C3CbLjlzcQQUyBuUuNaNCcc9_Giy8t7U";
|
|
8
8
|
/**
|
|
9
9
|
* Default settings for accessing the Cesium ion API.
|
|
10
10
|
*
|
|
@@ -119,9 +119,8 @@ OpenCageGeocoderService.prototype.geocode = async function (query) {
|
|
|
119
119
|
bounds.northeast.lat,
|
|
120
120
|
);
|
|
121
121
|
} else {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
destination = Cartesian3.fromDegrees(lon, lat);
|
|
122
|
+
const { lng, lat } = resultObject.geometry;
|
|
123
|
+
destination = Cartesian3.fromDegrees(lng, lat);
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
return {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Union of all numeric typed array types.
|
|
3
|
+
* @typedef {Float64Array|Float32Array|Uint32Array|Uint16Array|Uint8Array|Int32Array|Int16Array|Int8Array} TypedArray
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Union of all numeric typed array constructor types.
|
|
8
|
+
* @typedef {Float64ArrayConstructor|Float32ArrayConstructor|Uint32ArrayConstructor|Uint16ArrayConstructor|Uint8ArrayConstructor|Int32ArrayConstructor|Int16ArrayConstructor|Int8ArrayConstructor} TypedArrayConstructor
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This file is omitted from 'workspaceSourceFiles' in 'scripts/build.js', and
|
|
13
|
+
* must provide type-only exports exclusively, without runtime values.
|
|
14
|
+
* @ignore
|
|
15
|
+
*/
|
|
16
|
+
export default null;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import Check from "../Core/Check.js";
|
|
2
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
* vertex shader, the fragment shader, or both.
|
|
5
|
+
* A bit flag describing whether a variable should be added to the
|
|
6
|
+
* vertex shader, the fragment shader, or both (or none).
|
|
6
7
|
*
|
|
7
8
|
* @private
|
|
8
9
|
*/
|
|
9
10
|
const ShaderDestination = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
NONE: 0,
|
|
12
|
+
VERTEX: 1,
|
|
13
|
+
FRAGMENT: 2,
|
|
14
|
+
BOTH: 3,
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
/**
|
|
@@ -24,10 +26,7 @@ ShaderDestination.includesVertexShader = function (destination) {
|
|
|
24
26
|
Check.typeOf.number("destination", destination);
|
|
25
27
|
//>>includeEnd('debug');
|
|
26
28
|
|
|
27
|
-
return (
|
|
28
|
-
destination === ShaderDestination.VERTEX ||
|
|
29
|
-
destination === ShaderDestination.BOTH
|
|
30
|
-
);
|
|
29
|
+
return (destination & ShaderDestination.VERTEX) !== 0;
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
/**
|
|
@@ -42,10 +41,52 @@ ShaderDestination.includesFragmentShader = function (destination) {
|
|
|
42
41
|
Check.typeOf.number("destination", destination);
|
|
43
42
|
//>>includeEnd('debug');
|
|
44
43
|
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
|
|
45
|
+
return (destination & ShaderDestination.FRAGMENT) !== 0;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Compute the union of multiple ShaderDestinations (e.g., VERTEX | FRAGMENT yields BOTH)
|
|
50
|
+
* @param {...ShaderDestination} destinations
|
|
51
|
+
* @returns {ShaderDestination} The union of the provided destinations
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
ShaderDestination.union = function (...destinations) {
|
|
55
|
+
//>>includeStart('debug', pragmas.debug);
|
|
56
|
+
if (destinations.length === 0) {
|
|
57
|
+
throw new DeveloperError(
|
|
58
|
+
"ShaderDestination.union requires at least one destination.",
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
//>>includeEnd('debug');
|
|
62
|
+
|
|
63
|
+
let result = 0;
|
|
64
|
+
for (let i = 0; i < destinations.length; i++) {
|
|
65
|
+
result |= destinations[i];
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Compute the intersection of multiple ShaderDestinations (e.g., VERTEX & FRAGMENT yields NONE)
|
|
72
|
+
* @param {...ShaderDestination} destinations
|
|
73
|
+
* @returns {ShaderDestination} The intersection of the provided destinations
|
|
74
|
+
* @private
|
|
75
|
+
*/
|
|
76
|
+
ShaderDestination.intersection = function (...destinations) {
|
|
77
|
+
//>>includeStart('debug', pragmas.debug);
|
|
78
|
+
if (destinations.length === 0) {
|
|
79
|
+
throw new DeveloperError(
|
|
80
|
+
"ShaderDestination.intersection requires at least one destination.",
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
//>>includeEnd('debug');
|
|
84
|
+
|
|
85
|
+
let result = destinations[0];
|
|
86
|
+
for (let i = 1; i < destinations.length; i++) {
|
|
87
|
+
result &= destinations[i];
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
49
90
|
};
|
|
50
91
|
|
|
51
92
|
export default Object.freeze(ShaderDestination);
|
|
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"
|
|
7
|
+
"AAPTahokHpH_PEeQIduLwb1A8ZA..rA8bGH-48FscqzwJpCALUEqt2P_mHiflgl0WkBvCxPJzsFMRqAukz-mcG8oZ3eKnfk4MHGvCFMNsNrxXb2fGxfKH-3TQxCZVkCycztIPWRM5OIQ7pzTZIBOO9D7N8VXXpyPtp2bSsxWp5dUpv8qsgrfMHU4IXWGiiKWELBnANXn1QgzyLKngOHAgYWUq2OQ2XuULOpwJwOEWpyX5KvoLavJP0LFJdjB08Mmz-wCvnFqwr8CZjFpKaVSbAT1_aZs2dlMP";
|
|
8
8
|
/**
|
|
9
9
|
* Default options for accessing the ArcGIS image tile service.
|
|
10
10
|
*
|
|
@@ -52,7 +52,7 @@ import isDataUri from "../Core/isDataUri.js";
|
|
|
52
52
|
* @property {NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Specifying near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
|
|
53
53
|
* @property {BoundingRectangle} [imageSubRegion] A {@link BoundingRectangle} Specifying the sub-region of the image to use for the billboard, rather than the entire image.
|
|
54
54
|
* @property {DistanceDisplayCondition} [distanceDisplayCondition] A {@link DistanceDisplayCondition} Specifying the distance from the camera at which this billboard will be displayed.
|
|
55
|
-
* @property {number} [disableDepthTestDistance]
|
|
55
|
+
* @property {number} [disableDepthTestDistance] The distance from the camera, beyond which, depth testing is disabled—to, for example, prevent clipping against terrain.
|
|
56
56
|
* @property {SplitDirection} [splitDirection] A {@link SplitDirection} Specifying the split property of the billboard.
|
|
57
57
|
*/
|
|
58
58
|
|
|
@@ -845,10 +845,13 @@ Object.defineProperties(Billboard.prototype, {
|
|
|
845
845
|
},
|
|
846
846
|
|
|
847
847
|
/**
|
|
848
|
-
* Gets or sets the distance from the camera
|
|
849
|
-
*
|
|
848
|
+
* Gets or sets the distance from the camera, beyond which, depth testing is disbaled—to,
|
|
849
|
+
* for example, prevent clipping against terrain. When set to <code>undefined</code> or
|
|
850
|
+
* <code>0</code>, the depth test is always applied. When set to
|
|
851
|
+
* <code>Number.POSITIVE_INFINITY</code>, the depth test is never applied.
|
|
850
852
|
* @memberof Billboard.prototype
|
|
851
|
-
* @type {number}
|
|
853
|
+
* @type {number|undefined}
|
|
854
|
+
* @default undefined
|
|
852
855
|
*/
|
|
853
856
|
disableDepthTestDistance: {
|
|
854
857
|
get: function () {
|
|
@@ -118,7 +118,8 @@ const attributeLocationsInstanced = {
|
|
|
118
118
|
* is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
|
|
119
119
|
* setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
|
|
120
120
|
* @param {boolean} [options.show=true] Determines if the billboards in the collection will be shown.
|
|
121
|
-
*
|
|
121
|
+
* @param {number} [options.coarseDepthTestDistance] The distance from the camera, beyond which, billboards are depth-tested against an approximation of the globe ellipsoid rather than against the full globe depth buffer. If unspecified, the default value is determined relative to the value of {@link Ellipsoid.default}.
|
|
122
|
+
* @param {number} [options.threePointDepthTestDistance] The distance from the camera, within which, billboards with a {@link Billboard#heightReference} value of {@link HeightReference.CLAMP_TO_GROUND} or {@link HeightReference.CLAMP_TO_TERRAIN} are depth tested against three key points. This ensures that if any key point of the billboard is visible, the whole billboard will be visible. If unspecified, the default value is determined relative to the value of {@link Ellipsoid.default}.
|
|
122
123
|
* @performance For best performance, prefer a few collections, each with many billboards, to
|
|
123
124
|
* many collections with only a few billboards each. Organize collections so that billboards
|
|
124
125
|
* with the same update frequency are in the same collection, i.e., billboards that do not
|
|
@@ -317,8 +318,11 @@ function BillboardCollection(options) {
|
|
|
317
318
|
];
|
|
318
319
|
|
|
319
320
|
this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints
|
|
320
|
-
this._coarseDepthTestDistance =
|
|
321
|
-
|
|
321
|
+
this._coarseDepthTestDistance =
|
|
322
|
+
options.coarseDepthTestDistance ?? Ellipsoid.default.minimumRadius / 10.0;
|
|
323
|
+
this._threePointDepthTestDistance =
|
|
324
|
+
options.threePointDepthTestDistance ??
|
|
325
|
+
Ellipsoid.default.minimumRadius / 1000.0;
|
|
322
326
|
|
|
323
327
|
this._uniforms = {
|
|
324
328
|
u_atlas: () => {
|
|
@@ -327,13 +331,9 @@ function BillboardCollection(options) {
|
|
|
327
331
|
u_highlightColor: () => {
|
|
328
332
|
return this._highlightColor;
|
|
329
333
|
},
|
|
330
|
-
// An eye-space distance, beyond which, the billboard is simply tested against a camera-facing plane at the ellipsoid's center,
|
|
331
|
-
// rather than against a depth texture. Note: only if the disableDepthTestingDistance property permits.
|
|
332
334
|
u_coarseDepthTestDistance: () => {
|
|
333
335
|
return this._coarseDepthTestDistance;
|
|
334
336
|
},
|
|
335
|
-
// Within this distance, if the billboard is clamped to the ground, we'll depth-test 3 key points.
|
|
336
|
-
// If any key point is visible, the whole billboard will be visible.
|
|
337
337
|
u_threePointDepthTestDistance: () => {
|
|
338
338
|
return this._threePointDepthTestDistance;
|
|
339
339
|
},
|
|
@@ -466,6 +466,56 @@ Object.defineProperties(BillboardCollection.prototype, {
|
|
|
466
466
|
return this._billboardTextureCache;
|
|
467
467
|
},
|
|
468
468
|
},
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* The distance from the camera, beyond which, billboards are depth-tested against an approximation of
|
|
472
|
+
* the globe ellipsoid rather than against the full globe depth buffer. When set to <code>0</code>, the
|
|
473
|
+
* approximate depth test is always applied. When set to <code>Number.POSITIVE_INFINITY</code>, the
|
|
474
|
+
* approximate depth test is never applied.
|
|
475
|
+
* <br/><br/>
|
|
476
|
+
* This setting only applies when a billboard's {@link Billboard#disableDepthTestDistance} value would
|
|
477
|
+
* otherwise allow depth testing—i.e., distance from the camera to the billboard is less than a
|
|
478
|
+
* billboard's {@link Billboard#disableDepthTestDistance} value.
|
|
479
|
+
* @memberof BillboardCollection.prototype
|
|
480
|
+
* @type {number}
|
|
481
|
+
*/
|
|
482
|
+
coarseDepthTestDistance: {
|
|
483
|
+
get: function () {
|
|
484
|
+
return this._coarseDepthTestDistance;
|
|
485
|
+
},
|
|
486
|
+
set: function (value) {
|
|
487
|
+
//>>includeStart('debug', pragmas.debug);
|
|
488
|
+
Check.typeOf.number("coarseDepthTestDistance", value);
|
|
489
|
+
//>>includeEnd('debug');
|
|
490
|
+
this._coarseDepthTestDistance = value;
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* The distance from the camera, within which, billboards with a {@link Billboard#heightReference} value
|
|
496
|
+
* of {@link HeightReference.CLAMP_TO_GROUND} or {@link HeightReference.CLAMP_TO_TERRAIN} are depth tested
|
|
497
|
+
* against three key points. This ensures that if any key point of the billboard is visible, the whole
|
|
498
|
+
* billboard will be visible. When set to <code>0</code>, this feature is disabled and portions of a
|
|
499
|
+
* billboards behind terrain be clipped.
|
|
500
|
+
* <br/><br/>
|
|
501
|
+
* This setting only applies when a billboard's {@link Billboard#disableDepthTestDistance} value would
|
|
502
|
+
* otherwise allow depth testing—i.e., distance from the camera to the billboard is less than a
|
|
503
|
+
* billboard's {@link Billboard#disableDepthTestDistance} value.
|
|
504
|
+
* @see {@link https://cesium.com/blog/2018/07/30/billboards-on-terrain-improvements/|Billboards and Labels on Terrain Improvements}
|
|
505
|
+
* @memberof BillboardCollection.prototype
|
|
506
|
+
* @type {number}
|
|
507
|
+
*/
|
|
508
|
+
threePointDepthTestDistance: {
|
|
509
|
+
get: function () {
|
|
510
|
+
return this._threePointDepthTestDistance;
|
|
511
|
+
},
|
|
512
|
+
set: function (value) {
|
|
513
|
+
//>>includeStart('debug', pragmas.debug);
|
|
514
|
+
Check.typeOf.number("threePointDepthTestDistance", value);
|
|
515
|
+
//>>includeEnd('debug');
|
|
516
|
+
this._threePointDepthTestDistance = value;
|
|
517
|
+
},
|
|
518
|
+
},
|
|
469
519
|
});
|
|
470
520
|
|
|
471
521
|
function destroyBillboards(billboards) {
|
|
@@ -1204,22 +1254,14 @@ function writeCompressedAttrib2(
|
|
|
1204
1254
|
);
|
|
1205
1255
|
let labelHorizontalOrigin = billboard._labelHorizontalOrigin ?? -2;
|
|
1206
1256
|
labelHorizontalOrigin += 2;
|
|
1207
|
-
const compressed3 = imageHeight * LEFT_SHIFT2 + labelHorizontalOrigin;
|
|
1208
1257
|
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
|
|
1213
|
-
|
|
1214
|
-
red = Color.floatToByte(pickColor.red);
|
|
1215
|
-
green = Color.floatToByte(pickColor.green);
|
|
1216
|
-
blue = Color.floatToByte(pickColor.blue);
|
|
1217
|
-
const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
|
|
1218
|
-
|
|
1219
|
-
let compressed2 =
|
|
1258
|
+
const compressed0 = AttributeCompression.encodeRGB8(color);
|
|
1259
|
+
const compressed1 = AttributeCompression.encodeRGB8(pickColor);
|
|
1260
|
+
const compressed2 =
|
|
1220
1261
|
Color.floatToByte(color.alpha) * LEFT_SHIFT16 +
|
|
1221
|
-
Color.floatToByte(pickColor.alpha) * LEFT_SHIFT8
|
|
1222
|
-
|
|
1262
|
+
Color.floatToByte(pickColor.alpha) * LEFT_SHIFT8 +
|
|
1263
|
+
(sizeInMeters * 2.0 + validAlignedAxis);
|
|
1264
|
+
const compressed3 = imageHeight * LEFT_SHIFT2 + labelHorizontalOrigin;
|
|
1223
1265
|
|
|
1224
1266
|
if (billboardCollection._instanced) {
|
|
1225
1267
|
i = billboard._index;
|
|
@@ -1526,10 +1568,7 @@ function writeSDF(billboardCollection, frameState, vafWriters, billboard) {
|
|
|
1526
1568
|
const outlineColor = billboard.outlineColor;
|
|
1527
1569
|
const outlineWidth = billboard.outlineWidth;
|
|
1528
1570
|
|
|
1529
|
-
const
|
|
1530
|
-
const green = Color.floatToByte(outlineColor.green);
|
|
1531
|
-
const blue = Color.floatToByte(outlineColor.blue);
|
|
1532
|
-
const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
|
|
1571
|
+
const compressed0 = AttributeCompression.encodeRGB8(outlineColor);
|
|
1533
1572
|
|
|
1534
1573
|
// Compute the relative outline distance
|
|
1535
1574
|
const outlineDistance = outlineWidth / SDFSettings.RADIUS;
|
|
@@ -10,46 +10,40 @@ import ResourceLoaderState from "./ResourceLoaderState.js";
|
|
|
10
10
|
* Implements the {@link ResourceLoader} interface.
|
|
11
11
|
* </p>
|
|
12
12
|
*
|
|
13
|
-
* @alias BufferLoader
|
|
14
|
-
* @constructor
|
|
15
|
-
* @augments ResourceLoader
|
|
16
|
-
*
|
|
17
|
-
* @param {object} options Object with the following properties:
|
|
18
|
-
* @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents. Mutually exclusive with options.resource.
|
|
19
|
-
* @param {Resource} [options.resource] The {@link Resource} pointing to the external buffer. Mutually exclusive with options.typedArray.
|
|
20
|
-
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
21
|
-
*
|
|
22
|
-
* @exception {DeveloperError} One of options.typedArray and options.resource must be defined.
|
|
23
|
-
*
|
|
24
13
|
* @private
|
|
25
14
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
class BufferLoader extends ResourceLoader {
|
|
16
|
+
/**
|
|
17
|
+
* @param {object} options Object with the following properties:
|
|
18
|
+
* @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents. Mutually exclusive with options.resource.
|
|
19
|
+
* @param {Resource} [options.resource] The {@link Resource} pointing to the external buffer. Mutually exclusive with options.typedArray.
|
|
20
|
+
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
21
|
+
*
|
|
22
|
+
* @exception {DeveloperError} One of options.typedArray and options.resource must be defined.
|
|
23
|
+
*/
|
|
24
|
+
constructor(options) {
|
|
25
|
+
super();
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
//>>includeEnd('debug');
|
|
27
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
28
|
+
const typedArray = options.typedArray;
|
|
29
|
+
const resource = options.resource;
|
|
30
|
+
const cacheKey = options.cacheKey;
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
32
|
+
//>>includeStart('debug', pragmas.debug);
|
|
33
|
+
if (defined(typedArray) === defined(resource)) {
|
|
34
|
+
throw new DeveloperError(
|
|
35
|
+
"One of options.typedArray and options.resource must be defined.",
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
//>>includeEnd('debug');
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
this._typedArray = typedArray;
|
|
41
|
+
this._resource = resource;
|
|
42
|
+
this._cacheKey = cacheKey;
|
|
43
|
+
this._state = ResourceLoaderState.UNLOADED;
|
|
44
|
+
this._promise = undefined;
|
|
45
|
+
}
|
|
51
46
|
|
|
52
|
-
Object.defineProperties(BufferLoader.prototype, {
|
|
53
47
|
/**
|
|
54
48
|
* The cache key of the resource.
|
|
55
49
|
*
|
|
@@ -59,11 +53,10 @@ Object.defineProperties(BufferLoader.prototype, {
|
|
|
59
53
|
* @readonly
|
|
60
54
|
* @private
|
|
61
55
|
*/
|
|
62
|
-
cacheKey
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
56
|
+
get cacheKey() {
|
|
57
|
+
return this._cacheKey;
|
|
58
|
+
}
|
|
59
|
+
|
|
67
60
|
/**
|
|
68
61
|
* The typed array containing the embedded buffer contents.
|
|
69
62
|
*
|
|
@@ -73,31 +66,45 @@ Object.defineProperties(BufferLoader.prototype, {
|
|
|
73
66
|
* @readonly
|
|
74
67
|
* @private
|
|
75
68
|
*/
|
|
76
|
-
typedArray
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
});
|
|
69
|
+
get typedArray() {
|
|
70
|
+
return this._typedArray;
|
|
71
|
+
}
|
|
82
72
|
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Loads the resource.
|
|
75
|
+
* @returns {Promise<BufferLoader>} A promise which resolves to the loader when the resource loading is completed.
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
async load() {
|
|
79
|
+
if (defined(this._promise)) {
|
|
80
|
+
return this._promise;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (defined(this._typedArray)) {
|
|
84
|
+
this._promise = Promise.resolve(this);
|
|
85
|
+
return this._promise;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
this._promise = loadExternalBuffer(this);
|
|
90
89
|
return this._promise;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Exposed for testing
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
static _fetchArrayBuffer(resource) {
|
|
97
|
+
return resource.fetchArrayBuffer();
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Unloads the resource.
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
unload() {
|
|
105
|
+
this._typedArray = undefined;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
101
108
|
|
|
102
109
|
async function loadExternalBuffer(bufferLoader) {
|
|
103
110
|
const resource = bufferLoader._resource;
|
|
@@ -122,20 +129,4 @@ async function loadExternalBuffer(bufferLoader) {
|
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
/**
|
|
126
|
-
* Exposed for testing
|
|
127
|
-
* @private
|
|
128
|
-
*/
|
|
129
|
-
BufferLoader._fetchArrayBuffer = function (resource) {
|
|
130
|
-
return resource.fetchArrayBuffer();
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Unloads the resource.
|
|
135
|
-
* @private
|
|
136
|
-
*/
|
|
137
|
-
BufferLoader.prototype.unload = function () {
|
|
138
|
-
this._typedArray = undefined;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
132
|
export default BufferLoader;
|