@cesium/engine 12.0.1 → 13.1.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-7D6T2WYT.js → chunk-2ONAV62A.js} +14 -47
- package/Build/Workers/{chunk-MV7YO647.js → chunk-2SRHVCFD.js} +6 -6
- package/Build/Workers/{chunk-ZPTNVB3S.js → chunk-3SCCWLZS.js} +34 -8
- package/Build/Workers/{chunk-7CKQ7PVJ.js → chunk-54I6VSRP.js} +6 -6
- package/Build/Workers/{chunk-XDJ7V4NZ.js → chunk-5I3LPAS7.js} +5 -5
- package/Build/Workers/{chunk-GSJ6LWIS.js → chunk-5ICYLS6B.js} +35 -21
- package/Build/Workers/{chunk-BH5M522L.js → chunk-5JY4LYO3.js} +7 -7
- package/Build/Workers/{chunk-DR56WFYZ.js → chunk-APCS5YJI.js} +7 -7
- package/Build/Workers/{chunk-COHL4R3G.js → chunk-AXYZUG4N.js} +1 -1
- package/Build/Workers/{chunk-2IJZVFHY.js → chunk-B34JXFHF.js} +5 -5
- package/Build/Workers/{chunk-54NYY4U4.js → chunk-B6IJY6AN.js} +7 -7
- package/Build/Workers/{chunk-H3RMGG7L.js → chunk-BMFWWTD7.js} +5 -5
- package/Build/Workers/{chunk-PJHRB4YJ.js → chunk-CBE4HRBH.js} +7 -7
- package/Build/Workers/{chunk-U7SH6OK7.js → chunk-CNPP6TQ2.js} +4 -4
- package/Build/Workers/{chunk-2XOUWNPN.js → chunk-DWIKWWEE.js} +5 -5
- package/Build/Workers/{chunk-PNA47CR7.js → chunk-EHGQQA7C.js} +1 -1
- package/Build/Workers/{chunk-7EBHNJTG.js → chunk-EJ5DT5BP.js} +1 -1
- package/Build/Workers/{chunk-3Y4UGAYI.js → chunk-EYZFEJX3.js} +6 -6
- package/Build/Workers/{chunk-EMCXAVSG.js → chunk-FNCXBBCF.js} +2 -2
- package/Build/Workers/{chunk-NL73INJS.js → chunk-GIOZHX7U.js} +2 -2
- package/Build/Workers/{chunk-VHGI7D3P.js → chunk-GSLKQJM2.js} +10 -10
- package/Build/Workers/{chunk-647NL6VU.js → chunk-HI73PIPQ.js} +2 -2
- package/Build/Workers/{chunk-GRQQHWMD.js → chunk-IP7F2MVW.js} +7 -7
- package/Build/Workers/{chunk-LBNGHEJY.js → chunk-IXNXKVOB.js} +4 -4
- package/Build/Workers/{chunk-2F42VIW6.js → chunk-J7BMSSY7.js} +13 -13
- package/Build/Workers/{chunk-PH3T7LNP.js → chunk-K62EHZFT.js} +15 -15
- package/Build/Workers/{chunk-GBPW65E3.js → chunk-K6SQV4IS.js} +6 -6
- package/Build/Workers/{chunk-WMHJAREU.js → chunk-KO232FLP.js} +2 -2
- package/Build/Workers/{chunk-AER5CLXD.js → chunk-KRVALCCI.js} +5 -5
- package/Build/Workers/{chunk-22FZ334F.js → chunk-LFUFGHL3.js} +10 -10
- package/Build/Workers/{chunk-AGYO4ZSF.js → chunk-LQT2ZK7D.js} +17 -17
- package/Build/Workers/{chunk-KJ65M35B.js → chunk-M2AA2ARJ.js} +11 -11
- package/Build/Workers/{chunk-YT5PQMSP.js → chunk-MGABCOOH.js} +6 -6
- package/Build/Workers/{chunk-JPNFQRN7.js → chunk-NQDKNE7V.js} +13 -13
- package/Build/Workers/{chunk-IJWXYSFC.js → chunk-OARMSJUU.js} +2 -2
- package/Build/Workers/{chunk-K7QC3WDT.js → chunk-OGRXNUR2.js} +1 -1
- package/Build/Workers/{chunk-KKMH4BKN.js → chunk-OZTFRHA2.js} +6 -6
- package/Build/Workers/{chunk-DJ7K7EYK.js → chunk-PBJQFLKS.js} +11 -11
- package/Build/Workers/{chunk-ETXXXGMP.js → chunk-PM76TX2X.js} +6 -6
- package/Build/Workers/{chunk-PISTPJXS.js → chunk-PTFIVVLX.js} +12 -12
- package/Build/Workers/{chunk-VXVQITFC.js → chunk-R2KGFZBA.js} +13 -13
- package/Build/Workers/{chunk-VO4SXJXT.js → chunk-S3UM4OKP.js} +7 -7
- package/Build/Workers/{chunk-NELAPOO6.js → chunk-SAKQO5NX.js} +2 -2
- package/Build/Workers/{chunk-ENARO52I.js → chunk-T34EOLFR.js} +14 -14
- package/Build/Workers/{chunk-X6YBZOOA.js → chunk-THDHWSEJ.js} +4 -4
- package/Build/Workers/{chunk-LVHHB5T6.js → chunk-TOHDFUJM.js} +4 -4
- package/Build/Workers/{chunk-Q7IIOKAT.js → chunk-UBAHTE4Q.js} +1 -1
- package/Build/Workers/{chunk-IAX6MIST.js → chunk-WAJNX74N.js} +17 -17
- package/Build/Workers/{chunk-76KRKKEF.js → chunk-WE4KF4AM.js} +9 -9
- package/Build/Workers/{chunk-JAKTB6CE.js → chunk-WUIDEXAN.js} +7 -7
- package/Build/Workers/{chunk-IVCFTVYW.js → chunk-YVGU235V.js} +4 -4
- package/Build/Workers/{chunk-ZCCI55EY.js → chunk-ZWSWJYJP.js} +13 -13
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -32
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +20 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/BingMapsGeocoderService.js +2 -0
- package/Source/Core/Check.d.ts +2 -1
- package/Source/Core/GoogleGeocoderService.js +110 -0
- package/Source/Core/ITwinPlatform.js +324 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonGeocodeProviderType.js +33 -0
- package/Source/Core/IonGeocoderService.js +72 -0
- package/Source/Core/JulianDate.js +14 -7
- package/Source/Core/Rectangle.js +0 -20
- package/Source/Core/TrackingReferenceFrame.js +45 -0
- package/Source/Core/defined.d.ts +11 -0
- package/Source/DataSources/Entity.js +15 -1
- package/Source/DataSources/EntityView.js +55 -4
- package/Source/DataSources/ModelGraphics.js +23 -1
- package/Source/DataSources/ModelVisualizer.js +22 -1
- package/Source/DataSources/SampledProperty.js +24 -0
- package/Source/Renderer/ContextLimits.js +1 -1
- package/Source/Renderer/Texture.js +104 -92
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/Cesium3DTilesetStatistics.js +109 -42
- package/Source/Scene/DerivedCommand.js +109 -16
- package/Source/Scene/DynamicEnvironmentMapManager.js +202 -65
- package/Source/Scene/GltfTextureLoader.js +16 -1
- package/Source/Scene/ITwinData.js +208 -0
- package/Source/Scene/Label.js +17 -3
- package/Source/Scene/MetadataClassProperty.js +26 -0
- package/Source/Scene/MetadataPicking.js +108 -17
- package/Source/Scene/MetadataType.js +20 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js +6 -11
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/Model/Model3DTileContent.js +23 -1
- package/Source/Scene/Model/ModelStatistics.js +33 -5
- package/Source/Scene/Model/PointCloudStylingPipelineStage.js +2 -1
- package/Source/Scene/PickedMetadataInfo.js +21 -3
- package/Source/Scene/Picking.js +7 -1
- package/Source/Scene/PostProcessStage.js +14 -17
- package/Source/Scene/PostProcessStageCollection.js +4 -16
- package/Source/Scene/PostProcessStageLibrary.js +13 -51
- package/Source/Scene/PropertyAttributeProperty.js +15 -3
- package/Source/Scene/PropertyTextureProperty.js +12 -0
- package/Source/Scene/Scene.js +17 -2
- package/Source/Scene/SkyBox.js +23 -4
- package/Source/Scene/UrlTemplateImageryProvider.js +5 -5
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +55 -16
- package/Source/Scene/getMetadataProperty.js +48 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.glsl +1 -1
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.js +1 -1
- package/Source/Shaders/ConvolveSpecularMapFS.glsl +1 -1
- package/Source/Shaders/ConvolveSpecularMapFS.js +1 -1
- package/Source/Shaders/DepthPlaneVS.glsl +1 -1
- package/Source/Shaders/DepthPlaneVS.js +1 -1
- package/Source/Shaders/Model/ModelFS.glsl +7 -0
- package/Source/Shaders/Model/ModelFS.js +7 -0
- package/Source/Shaders/Model/ModelVS.glsl +9 -1
- package/Source/Shaders/Model/ModelVS.js +9 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +66 -37
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +66 -37
- package/index.d.ts +295 -42
- package/index.js +67 -61
- package/package.json +1 -1
|
@@ -61,7 +61,15 @@ function ModelStatistics() {
|
|
|
61
61
|
// Sets of buffers and textures that have already been counted.
|
|
62
62
|
// This is to prevent double-counting cached assets.
|
|
63
63
|
this._bufferIdSet = {};
|
|
64
|
-
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The mapping from `texture.id` strings to the byte length of the
|
|
67
|
+
* respective texture
|
|
68
|
+
*
|
|
69
|
+
* @type {object}
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
this._textureIdByteLengths = {};
|
|
65
73
|
|
|
66
74
|
// Associated array of batch textures that have already been counted.
|
|
67
75
|
// This allows for quick look-up to check if a texture has been counted,
|
|
@@ -111,7 +119,7 @@ ModelStatistics.prototype.clear = function () {
|
|
|
111
119
|
this.propertyTablesByteLength = 0;
|
|
112
120
|
|
|
113
121
|
this._bufferIdSet = {};
|
|
114
|
-
this.
|
|
122
|
+
this._textureIdByteLengths = {};
|
|
115
123
|
this._batchTextureIdMap.removeAll();
|
|
116
124
|
};
|
|
117
125
|
|
|
@@ -160,12 +168,32 @@ ModelStatistics.prototype.addTexture = function (texture) {
|
|
|
160
168
|
Check.typeOf.object("texture", texture);
|
|
161
169
|
//>>includeEnd('debug');
|
|
162
170
|
|
|
163
|
-
if (!this.
|
|
171
|
+
if (!this._textureIdByteLengths.hasOwnProperty(texture._id)) {
|
|
164
172
|
this.texturesByteLength += texture.sizeInBytes;
|
|
173
|
+
this._textureIdByteLengths[texture._id] = texture.sizeInBytes;
|
|
165
174
|
}
|
|
175
|
+
};
|
|
166
176
|
|
|
167
|
-
|
|
168
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Returns an array containing the `texture.id` values for all textures
|
|
179
|
+
* that are part of the model.
|
|
180
|
+
*
|
|
181
|
+
* @returns {string[]} The texture IDs
|
|
182
|
+
*/
|
|
183
|
+
ModelStatistics.prototype.getTextureIds = function () {
|
|
184
|
+
return Object.keys(this._textureIdByteLengths);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Returns the length, in bytes, of the texture data for the texture with
|
|
189
|
+
* the given ID that is part of the model, or `undefined` if the model
|
|
190
|
+
* does not contain the texture with the given ID.
|
|
191
|
+
*
|
|
192
|
+
* @param {string} textureId The texture ID
|
|
193
|
+
* @returns {number|undefined} The texture byte length
|
|
194
|
+
*/
|
|
195
|
+
ModelStatistics.prototype.getTextureByteLengthById = function (textureId) {
|
|
196
|
+
return this._textureIdByteLengths[textureId];
|
|
169
197
|
};
|
|
170
198
|
|
|
171
199
|
/**
|
|
@@ -333,9 +333,10 @@ function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) {
|
|
|
333
333
|
shaderBuilder.addDefine(
|
|
334
334
|
"HAS_POINT_CLOUD_SHOW_STYLE",
|
|
335
335
|
undefined,
|
|
336
|
-
ShaderDestination.
|
|
336
|
+
ShaderDestination.BOTH,
|
|
337
337
|
);
|
|
338
338
|
shaderBuilder.addVertexLines(showStyleFunction);
|
|
339
|
+
shaderBuilder.addVarying("float", "v_pointCloudShow");
|
|
339
340
|
}
|
|
340
341
|
|
|
341
342
|
const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;
|
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
* the metadata values of an object into the picking frame buffer. The
|
|
7
7
|
* raw values are read from that buffer, and are then translated back into
|
|
8
8
|
* proper metadata values in `Picking.pickMetadata`, using the structural
|
|
9
|
-
* information about the metadata
|
|
9
|
+
* information about the metadata that is stored here.
|
|
10
10
|
*
|
|
11
11
|
* @private
|
|
12
12
|
*/
|
|
13
|
-
function PickedMetadataInfo(
|
|
13
|
+
function PickedMetadataInfo(
|
|
14
|
+
schemaId,
|
|
15
|
+
className,
|
|
16
|
+
propertyName,
|
|
17
|
+
classProperty,
|
|
18
|
+
metadataProperty,
|
|
19
|
+
) {
|
|
14
20
|
/**
|
|
15
21
|
* The optional ID of the metadata schema
|
|
16
22
|
*
|
|
@@ -29,11 +35,23 @@ function PickedMetadataInfo(schemaId, className, propertyName, classProperty) {
|
|
|
29
35
|
* @type {string}
|
|
30
36
|
*/
|
|
31
37
|
this.propertyName = propertyName;
|
|
38
|
+
|
|
32
39
|
/**
|
|
33
|
-
* The
|
|
40
|
+
* The the `MetadataClassProperty` that is described by this
|
|
41
|
+
* structure, as obtained from the `MetadataSchema`
|
|
34
42
|
*
|
|
35
43
|
* @type {MetadataClassProperty}
|
|
36
44
|
*/
|
|
37
45
|
this.classProperty = classProperty;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The `PropertyTextureProperty` or `PropertyAttributeProperty` that
|
|
49
|
+
* is described by this structure, as obtained from the property texture
|
|
50
|
+
* or property attribute of the `StructuralMetadata` that matches the
|
|
51
|
+
* class name and property name.
|
|
52
|
+
*
|
|
53
|
+
* @type {object}
|
|
54
|
+
*/
|
|
55
|
+
this.metadataProperty = metadataProperty;
|
|
38
56
|
}
|
|
39
57
|
export default PickedMetadataInfo;
|
package/Source/Scene/Picking.js
CHANGED
|
@@ -426,9 +426,14 @@ Picking.prototype.pickVoxelCoordinate = function (
|
|
|
426
426
|
* - For `VEC3`, the return type will be a `Cartesian3`
|
|
427
427
|
* - For `VEC4`, the return type will be a `Cartesian4`
|
|
428
428
|
*
|
|
429
|
+
* Future implementations may additionally return `string`- or
|
|
430
|
+
* `boolean` types, and `MATn` values as `MatrixN` objects,
|
|
431
|
+
* and arrays of the respective types.
|
|
432
|
+
*
|
|
429
433
|
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
430
434
|
* @param {PickedMetadataInfo} pickedMetadataInfo Information about the picked metadata.
|
|
431
|
-
* @returns {
|
|
435
|
+
* @returns {MetadataValue|undefined} The metadata value, or `undefined`
|
|
436
|
+
* when no matching metadata value could be picked at the given position
|
|
432
437
|
*
|
|
433
438
|
* @private
|
|
434
439
|
*/
|
|
@@ -517,6 +522,7 @@ Picking.prototype.pickMetadata = function (
|
|
|
517
522
|
|
|
518
523
|
const metadataValue = MetadataPicking.decodeMetadataValues(
|
|
519
524
|
pickedMetadataInfo.classProperty,
|
|
525
|
+
pickedMetadataInfo.metadataProperty,
|
|
520
526
|
rawMetadataPixel,
|
|
521
527
|
);
|
|
522
528
|
|
|
@@ -94,9 +94,16 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js";
|
|
|
94
94
|
function PostProcessStage(options) {
|
|
95
95
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
96
96
|
const {
|
|
97
|
+
name = createGuid(),
|
|
97
98
|
fragmentShader,
|
|
99
|
+
uniforms,
|
|
98
100
|
textureScale = 1.0,
|
|
101
|
+
forcePowerOfTwo = false,
|
|
102
|
+
sampleMode = PostProcessStageSampleMode.NEAREST,
|
|
99
103
|
pixelFormat = PixelFormat.RGBA,
|
|
104
|
+
pixelDatatype = PixelDatatype.UNSIGNED_BYTE,
|
|
105
|
+
clearColor = Color.BLACK,
|
|
106
|
+
scissorRectangle,
|
|
100
107
|
} = options;
|
|
101
108
|
|
|
102
109
|
//>>includeStart('debug', pragmas.debug);
|
|
@@ -113,19 +120,13 @@ function PostProcessStage(options) {
|
|
|
113
120
|
//>>includeEnd('debug');
|
|
114
121
|
|
|
115
122
|
this._fragmentShader = fragmentShader;
|
|
116
|
-
this._uniforms =
|
|
123
|
+
this._uniforms = uniforms;
|
|
117
124
|
this._textureScale = textureScale;
|
|
118
|
-
this._forcePowerOfTwo =
|
|
119
|
-
this._sampleMode =
|
|
120
|
-
options.sampleMode,
|
|
121
|
-
PostProcessStageSampleMode.NEAREST,
|
|
122
|
-
);
|
|
125
|
+
this._forcePowerOfTwo = forcePowerOfTwo;
|
|
126
|
+
this._sampleMode = sampleMode;
|
|
123
127
|
this._pixelFormat = pixelFormat;
|
|
124
|
-
this._pixelDatatype =
|
|
125
|
-
|
|
126
|
-
PixelDatatype.UNSIGNED_BYTE,
|
|
127
|
-
);
|
|
128
|
-
this._clearColor = defaultValue(options.clearColor, Color.BLACK);
|
|
128
|
+
this._pixelDatatype = pixelDatatype;
|
|
129
|
+
this._clearColor = clearColor;
|
|
129
130
|
|
|
130
131
|
this._uniformMap = undefined;
|
|
131
132
|
this._command = undefined;
|
|
@@ -143,18 +144,14 @@ function PostProcessStage(options) {
|
|
|
143
144
|
const passState = new PassState();
|
|
144
145
|
passState.scissorTest = {
|
|
145
146
|
enabled: true,
|
|
146
|
-
rectangle: defined(
|
|
147
|
-
? BoundingRectangle.clone(
|
|
147
|
+
rectangle: defined(scissorRectangle)
|
|
148
|
+
? BoundingRectangle.clone(scissorRectangle)
|
|
148
149
|
: new BoundingRectangle(),
|
|
149
150
|
};
|
|
150
151
|
this._passState = passState;
|
|
151
152
|
|
|
152
153
|
this._ready = false;
|
|
153
154
|
|
|
154
|
-
let name = options.name;
|
|
155
|
-
if (!defined(name)) {
|
|
156
|
-
name = createGuid();
|
|
157
|
-
}
|
|
158
155
|
this._name = name;
|
|
159
156
|
|
|
160
157
|
this._logDepthChanged = undefined;
|
|
@@ -155,32 +155,20 @@ Object.defineProperties(PostProcessStageCollection.prototype, {
|
|
|
155
155
|
* surface receives light and regardless of the light's position.
|
|
156
156
|
* </p>
|
|
157
157
|
* <p>
|
|
158
|
-
* The uniforms have the following properties:
|
|
159
|
-
* <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
|
|
160
|
-
* <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
|
|
161
|
-
* </p>
|
|
158
|
+
* The uniforms have the following properties:
|
|
162
159
|
* <ul>
|
|
163
160
|
* <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>
|
|
164
|
-
*
|
|
165
161
|
* <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,
|
|
166
162
|
* sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>
|
|
167
|
-
*
|
|
168
163
|
* <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,
|
|
169
164
|
* sampling stops in the current direction. The default value is <code>0.26</code>.</li>
|
|
170
|
-
*
|
|
171
|
-
* <li><code>
|
|
172
|
-
*
|
|
173
|
-
* <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment.
|
|
174
|
-
* The default value is <code>1000.0</code>.</li>
|
|
175
|
-
*
|
|
165
|
+
* <li><code>directionCount</code> is the number of directions along which the ray marching will search for occluders. The default value is <code>8</code>.</li>
|
|
166
|
+
* <li><code>stepCount</code> is the number of steps the ray marching will take along each direction. The default value is <code>32</code>.</li>
|
|
167
|
+
* <li><code>randomTexture</code> is a texture where the red channel is a random value in [0.0, 1.0]. The default value is <code>undefined</code>. This texture needs to be set.</li>
|
|
176
168
|
* <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated
|
|
177
169
|
* with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>
|
|
178
170
|
* </ul>
|
|
179
171
|
* <p>
|
|
180
|
-
* <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
|
|
181
|
-
* The blur is applied to the shadows generated from the image to make them smoother.
|
|
182
|
-
* </p>
|
|
183
|
-
* <p>
|
|
184
172
|
* When enabled, this stage will execute before all others.
|
|
185
173
|
* </p>
|
|
186
174
|
*
|
|
@@ -476,27 +476,19 @@ PostProcessStageLibrary.createBloomStage = function () {
|
|
|
476
476
|
* surface receives light and regardless of the light's position.
|
|
477
477
|
* </p>
|
|
478
478
|
* <p>
|
|
479
|
-
* The uniforms have the following properties:
|
|
480
|
-
* <code>stepSize</code>, <code>frustumLength</code>, <code>randomTexture</code>, <code>ambientOcclusionOnly</code>,
|
|
481
|
-
* <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
|
|
482
|
-
* </p>
|
|
479
|
+
* The uniforms have the following properties:
|
|
483
480
|
* <ul>
|
|
484
481
|
* <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>
|
|
485
482
|
* <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,
|
|
486
483
|
* sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>
|
|
487
484
|
* <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,
|
|
488
485
|
* sampling stops in the current direction. The default value is <code>0.26</code>.</li>
|
|
489
|
-
* <li><code>
|
|
490
|
-
* <li><code>
|
|
491
|
-
* The default value is <code>1000.0</code>.</li>
|
|
486
|
+
* <li><code>directionCount</code> is the number of directions along which the ray marching will search for occluders. The default value is <code>8</code>.</li>
|
|
487
|
+
* <li><code>stepCount</code> is the number of steps the ray marching will take along each direction. The default value is <code>32</code>.</li>
|
|
492
488
|
* <li><code>randomTexture</code> is a texture where the red channel is a random value in [0.0, 1.0]. The default value is <code>undefined</code>. This texture needs to be set.</li>
|
|
493
489
|
* <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated
|
|
494
490
|
* with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>
|
|
495
491
|
* </ul>
|
|
496
|
-
* <p>
|
|
497
|
-
* <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
|
|
498
|
-
* The blur is applied to the shadows generated from the image to make them smoother.
|
|
499
|
-
* </p>
|
|
500
492
|
* @return {PostProcessStageComposite} A post-process stage that applies an ambient occlusion effect.
|
|
501
493
|
*
|
|
502
494
|
* @private
|
|
@@ -509,24 +501,18 @@ PostProcessStageLibrary.createAmbientOcclusionStage = function () {
|
|
|
509
501
|
intensity: 3.0,
|
|
510
502
|
bias: 0.1,
|
|
511
503
|
lengthCap: 0.26,
|
|
512
|
-
|
|
513
|
-
|
|
504
|
+
directionCount: 8,
|
|
505
|
+
stepCount: 32,
|
|
514
506
|
randomTexture: undefined,
|
|
515
507
|
},
|
|
516
508
|
});
|
|
517
|
-
const blur = createBlur("czm_ambient_occlusion_blur");
|
|
518
|
-
blur.uniforms.stepSize = 0.86;
|
|
519
|
-
const generateAndBlur = new PostProcessStageComposite({
|
|
520
|
-
name: "czm_ambient_occlusion_generate_blur",
|
|
521
|
-
stages: [generate, blur],
|
|
522
|
-
});
|
|
523
509
|
|
|
524
510
|
const ambientOcclusionModulate = new PostProcessStage({
|
|
525
511
|
name: "czm_ambient_occlusion_composite",
|
|
526
512
|
fragmentShader: AmbientOcclusionModulate,
|
|
527
513
|
uniforms: {
|
|
528
514
|
ambientOcclusionOnly: false,
|
|
529
|
-
ambientOcclusionTexture:
|
|
515
|
+
ambientOcclusionTexture: generate.name,
|
|
530
516
|
},
|
|
531
517
|
});
|
|
532
518
|
|
|
@@ -556,20 +542,20 @@ PostProcessStageLibrary.createAmbientOcclusionStage = function () {
|
|
|
556
542
|
generate.uniforms.lengthCap = value;
|
|
557
543
|
},
|
|
558
544
|
},
|
|
559
|
-
|
|
545
|
+
directionCount: {
|
|
560
546
|
get: function () {
|
|
561
|
-
return generate.uniforms.
|
|
547
|
+
return generate.uniforms.directionCount;
|
|
562
548
|
},
|
|
563
549
|
set: function (value) {
|
|
564
|
-
generate.uniforms.
|
|
550
|
+
generate.uniforms.directionCount = value;
|
|
565
551
|
},
|
|
566
552
|
},
|
|
567
|
-
|
|
553
|
+
stepCount: {
|
|
568
554
|
get: function () {
|
|
569
|
-
return generate.uniforms.
|
|
555
|
+
return generate.uniforms.stepCount;
|
|
570
556
|
},
|
|
571
557
|
set: function (value) {
|
|
572
|
-
generate.uniforms.
|
|
558
|
+
generate.uniforms.stepCount = value;
|
|
573
559
|
},
|
|
574
560
|
},
|
|
575
561
|
randomTexture: {
|
|
@@ -580,30 +566,6 @@ PostProcessStageLibrary.createAmbientOcclusionStage = function () {
|
|
|
580
566
|
generate.uniforms.randomTexture = value;
|
|
581
567
|
},
|
|
582
568
|
},
|
|
583
|
-
delta: {
|
|
584
|
-
get: function () {
|
|
585
|
-
return blur.uniforms.delta;
|
|
586
|
-
},
|
|
587
|
-
set: function (value) {
|
|
588
|
-
blur.uniforms.delta = value;
|
|
589
|
-
},
|
|
590
|
-
},
|
|
591
|
-
sigma: {
|
|
592
|
-
get: function () {
|
|
593
|
-
return blur.uniforms.sigma;
|
|
594
|
-
},
|
|
595
|
-
set: function (value) {
|
|
596
|
-
blur.uniforms.sigma = value;
|
|
597
|
-
},
|
|
598
|
-
},
|
|
599
|
-
blurStepSize: {
|
|
600
|
-
get: function () {
|
|
601
|
-
return blur.uniforms.stepSize;
|
|
602
|
-
},
|
|
603
|
-
set: function (value) {
|
|
604
|
-
blur.uniforms.stepSize = value;
|
|
605
|
-
},
|
|
606
|
-
},
|
|
607
569
|
ambientOcclusionOnly: {
|
|
608
570
|
get: function () {
|
|
609
571
|
return ambientOcclusionModulate.uniforms.ambientOcclusionOnly;
|
|
@@ -616,7 +578,7 @@ PostProcessStageLibrary.createAmbientOcclusionStage = function () {
|
|
|
616
578
|
|
|
617
579
|
return new PostProcessStageComposite({
|
|
618
580
|
name: "czm_ambient_occlusion",
|
|
619
|
-
stages: [
|
|
581
|
+
stages: [generate, ambientOcclusionModulate],
|
|
620
582
|
inputPreviousStageTexture: false,
|
|
621
583
|
uniforms: uniforms,
|
|
622
584
|
});
|
|
@@ -80,7 +80,7 @@ Object.defineProperties(PropertyAttributeProperty.prototype, {
|
|
|
80
80
|
* True if offset/scale should be applied. If both offset/scale were
|
|
81
81
|
* undefined, they default to identity so this property is set false
|
|
82
82
|
*
|
|
83
|
-
* @memberof
|
|
83
|
+
* @memberof PropertyAttributeProperty.prototype
|
|
84
84
|
* @type {boolean}
|
|
85
85
|
* @readonly
|
|
86
86
|
* @private
|
|
@@ -94,7 +94,13 @@ Object.defineProperties(PropertyAttributeProperty.prototype, {
|
|
|
94
94
|
/**
|
|
95
95
|
* The offset to be added to property values as part of the value transform.
|
|
96
96
|
*
|
|
97
|
-
*
|
|
97
|
+
* This is always defined, even when `hasValueTransform` is `false`. If
|
|
98
|
+
* the property JSON itself did not define it, then it will inherit the
|
|
99
|
+
* value from the `MetadataClassProperty`. There, it also is always
|
|
100
|
+
* defined, and initialized to the default value if it was not contained
|
|
101
|
+
* in the class property JSON.
|
|
102
|
+
*
|
|
103
|
+
* @memberof PropertyAttributeProperty.prototype
|
|
98
104
|
* @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
|
|
99
105
|
* @readonly
|
|
100
106
|
* @private
|
|
@@ -108,7 +114,13 @@ Object.defineProperties(PropertyAttributeProperty.prototype, {
|
|
|
108
114
|
/**
|
|
109
115
|
* The scale to be multiplied to property values as part of the value transform.
|
|
110
116
|
*
|
|
111
|
-
*
|
|
117
|
+
* This is always defined, even when `hasValueTransform` is `false`. If
|
|
118
|
+
* the property JSON itself did not define it, then it will inherit the
|
|
119
|
+
* value from the `MetadataClassProperty`. There, it also is always
|
|
120
|
+
* defined, and initialized to the default value if it was not contained
|
|
121
|
+
* in the class property JSON.
|
|
122
|
+
*
|
|
123
|
+
* @memberof PropertyAttributeProperty.prototype
|
|
112
124
|
* @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
|
|
113
125
|
* @readonly
|
|
114
126
|
* @private
|
|
@@ -111,6 +111,12 @@ Object.defineProperties(PropertyTextureProperty.prototype, {
|
|
|
111
111
|
/**
|
|
112
112
|
* The offset to be added to property values as part of the value transform.
|
|
113
113
|
*
|
|
114
|
+
* This is always defined, even when `hasValueTransform` is `false`. If
|
|
115
|
+
* the property JSON itself did not define it, then it will inherit the
|
|
116
|
+
* value from the `MetadataClassProperty`. There, it also is always
|
|
117
|
+
* defined, and initialized to the default value if it was not contained
|
|
118
|
+
* in the class property JSON.
|
|
119
|
+
*
|
|
114
120
|
* @memberof PropertyTextureProperty.prototype
|
|
115
121
|
* @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
|
|
116
122
|
* @readonly
|
|
@@ -125,6 +131,12 @@ Object.defineProperties(PropertyTextureProperty.prototype, {
|
|
|
125
131
|
/**
|
|
126
132
|
* The scale to be multiplied to property values as part of the value transform.
|
|
127
133
|
*
|
|
134
|
+
* This is always defined, even when `hasValueTransform` is `false`. If
|
|
135
|
+
* the property JSON itself did not define it, then it will inherit the
|
|
136
|
+
* value from the `MetadataClassProperty`. There, it also is always
|
|
137
|
+
* defined, and initialized to the default value if it was not contained
|
|
138
|
+
* in the class property JSON.
|
|
139
|
+
*
|
|
128
140
|
* @memberof PropertyTextureProperty.prototype
|
|
129
141
|
* @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
|
|
130
142
|
* @readonly
|
package/Source/Scene/Scene.js
CHANGED
|
@@ -79,6 +79,7 @@ import VoxelCell from "./VoxelCell.js";
|
|
|
79
79
|
import VoxelPrimitive from "./VoxelPrimitive.js";
|
|
80
80
|
import getMetadataClassProperty from "./getMetadataClassProperty.js";
|
|
81
81
|
import PickedMetadataInfo from "./PickedMetadataInfo.js";
|
|
82
|
+
import getMetadataProperty from "./getMetadataProperty.js";
|
|
82
83
|
|
|
83
84
|
const requestRenderAfterFrame = function (scene) {
|
|
84
85
|
return function () {
|
|
@@ -4402,7 +4403,8 @@ Scene.prototype.pickVoxel = function (windowPosition, width, height) {
|
|
|
4402
4403
|
* values from
|
|
4403
4404
|
* @param {string} propertyName The name of the metadata property to pick
|
|
4404
4405
|
* values from
|
|
4405
|
-
* @returns The metadata value
|
|
4406
|
+
* @returns {MetadataValue|undefined} The metadata value, or `undefined` when
|
|
4407
|
+
* no matching metadata was found at the given position
|
|
4406
4408
|
*
|
|
4407
4409
|
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
4408
4410
|
*/
|
|
@@ -4426,7 +4428,11 @@ Scene.prototype.pickMetadata = function (
|
|
|
4426
4428
|
// Check if the picked object is a model that has structural
|
|
4427
4429
|
// metadata, with a schema that contains the specified
|
|
4428
4430
|
// property.
|
|
4429
|
-
const
|
|
4431
|
+
const structuralMetadata = pickedObject.detail?.model?.structuralMetadata;
|
|
4432
|
+
if (!defined(structuralMetadata)) {
|
|
4433
|
+
return undefined;
|
|
4434
|
+
}
|
|
4435
|
+
const schema = structuralMetadata.schema;
|
|
4430
4436
|
const classProperty = getMetadataClassProperty(
|
|
4431
4437
|
schema,
|
|
4432
4438
|
schemaId,
|
|
@@ -4436,12 +4442,21 @@ Scene.prototype.pickMetadata = function (
|
|
|
4436
4442
|
if (!defined(classProperty)) {
|
|
4437
4443
|
return undefined;
|
|
4438
4444
|
}
|
|
4445
|
+
const metadataProperty = getMetadataProperty(
|
|
4446
|
+
structuralMetadata,
|
|
4447
|
+
className,
|
|
4448
|
+
propertyName,
|
|
4449
|
+
);
|
|
4450
|
+
if (!defined(metadataProperty)) {
|
|
4451
|
+
return undefined;
|
|
4452
|
+
}
|
|
4439
4453
|
|
|
4440
4454
|
const pickedMetadataInfo = new PickedMetadataInfo(
|
|
4441
4455
|
schemaId,
|
|
4442
4456
|
className,
|
|
4443
4457
|
propertyName,
|
|
4444
4458
|
classProperty,
|
|
4459
|
+
metadataProperty,
|
|
4445
4460
|
);
|
|
4446
4461
|
|
|
4447
4462
|
const pickedMetadataValues = this._picking.pickMetadata(
|
package/Source/Scene/SkyBox.js
CHANGED
|
@@ -81,6 +81,8 @@ function SkyBox(options) {
|
|
|
81
81
|
|
|
82
82
|
this._attributeLocations = undefined;
|
|
83
83
|
this._useHdr = undefined;
|
|
84
|
+
this._hasError = false;
|
|
85
|
+
this._error = undefined;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
/**
|
|
@@ -111,6 +113,15 @@ SkyBox.prototype.update = function (frameState, useHdr) {
|
|
|
111
113
|
return undefined;
|
|
112
114
|
}
|
|
113
115
|
|
|
116
|
+
// Throw any errors that had previously occurred asynchronously so they aren't
|
|
117
|
+
// ignored when running. See https://github.com/CesiumGS/cesium/pull/12307
|
|
118
|
+
if (this._hasError) {
|
|
119
|
+
const error = this._error;
|
|
120
|
+
this._hasError = false;
|
|
121
|
+
this._error = undefined;
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
|
|
114
125
|
if (this._sources !== this.sources) {
|
|
115
126
|
this._sources = this.sources;
|
|
116
127
|
const sources = this.sources;
|
|
@@ -141,10 +152,18 @@ SkyBox.prototype.update = function (frameState, useHdr) {
|
|
|
141
152
|
|
|
142
153
|
if (typeof sources.positiveX === "string") {
|
|
143
154
|
// Given urls for cube-map images. Load them.
|
|
144
|
-
loadCubeMap(context, this._sources)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
loadCubeMap(context, this._sources)
|
|
156
|
+
.then(function (cubeMap) {
|
|
157
|
+
that._cubeMap = that._cubeMap && that._cubeMap.destroy();
|
|
158
|
+
that._cubeMap = cubeMap;
|
|
159
|
+
})
|
|
160
|
+
.catch((error) => {
|
|
161
|
+
// Defer throwing the error until the next call to update to prevent
|
|
162
|
+
// test from failing in `afterAll` if this is rejected after the test
|
|
163
|
+
// using the Skybox ends. See https://github.com/CesiumGS/cesium/pull/12307
|
|
164
|
+
this._hasError = true;
|
|
165
|
+
this._error = error;
|
|
166
|
+
});
|
|
148
167
|
} else {
|
|
149
168
|
this._cubeMap = this._cubeMap && this._cubeMap.destroy();
|
|
150
169
|
this._cubeMap = new CubeMap({
|
|
@@ -159,13 +159,13 @@ const pickFeaturesTags = combine(tags, {
|
|
|
159
159
|
* });
|
|
160
160
|
* // Access a Web Map Service (WMS) server.
|
|
161
161
|
* const wms = new Cesium.UrlTemplateImageryProvider({
|
|
162
|
-
* url : 'https://
|
|
163
|
-
* 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
|
|
164
|
-
* 'styles=&service=WMS&version=1.
|
|
165
|
-
* 'layers=
|
|
162
|
+
* url : 'https://services.ga.gov.au/gis/services/NM_Hydrology_and_Marine_Points/MapServer/WMSServer?' +
|
|
163
|
+
* 'tiled=true&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
|
|
164
|
+
* 'styles=&service=WMS&version=1.3.0&request=GetMap&' +
|
|
165
|
+
* 'layers=Bores&crs=EPSG%3A3857&' +
|
|
166
166
|
* 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
|
|
167
167
|
* 'width=256&height=256',
|
|
168
|
-
* rectangle : Cesium.Rectangle.fromDegrees(
|
|
168
|
+
* rectangle : Cesium.Rectangle.fromDegrees(95.0, -55.0, 170.0, -1.0) // From GetCapabilities EX_GeographicBoundingBox
|
|
169
169
|
* });
|
|
170
170
|
* // Using custom tags in your template url.
|
|
171
171
|
* const custom = new Cesium.UrlTemplateImageryProvider({
|