@@ -106,7 +106,11 @@
//Sandcastle_Begin
const viewer = new Cesium.Viewer("cesiumContainer");
- viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z");
+ const { canvas, camera, clock, scene } = viewer;
+ camera.frustum.near = 1.0;
+ scene.debugShowFramesPerSecond = true;
+
+ clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z");
if (!Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
window.alert(
@@ -119,9 +123,9 @@
ambientOcclusionOnly: false,
intensity: 3.0,
bias: 0.1,
- lengthCap: 0.03,
- stepSize: 1.0,
- blurStepSize: 0.86,
+ lengthCap: 0.26,
+ directionCount: 8,
+ stepCount: 32,
};
Cesium.knockout.track(viewModel);
@@ -134,7 +138,7 @@
}
function updatePostProcess() {
- const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
+ const ambientOcclusion = scene.postProcessStages.ambientOcclusion;
ambientOcclusion.enabled =
Boolean(viewModel.show) || Boolean(viewModel.ambientOcclusionOnly);
ambientOcclusion.uniforms.ambientOcclusionOnly = Boolean(
@@ -143,12 +147,11 @@
ambientOcclusion.uniforms.intensity = Number(viewModel.intensity);
ambientOcclusion.uniforms.bias = Number(viewModel.bias);
ambientOcclusion.uniforms.lengthCap = Number(viewModel.lengthCap);
- ambientOcclusion.uniforms.stepSize = Number(viewModel.stepSize);
- ambientOcclusion.uniforms.blurStepSize = Number(viewModel.blurStepSize);
+ ambientOcclusion.uniforms.directionCount = Number(viewModel.directionCount);
+ ambientOcclusion.uniforms.stepCount = Number(viewModel.stepCount);
}
updatePostProcess();
- const camera = viewer.scene.camera;
camera.position = new Cesium.Cartesian3(
1234127.2294710164,
-5086011.666443127,
@@ -173,7 +176,7 @@
try {
// Power Plant design model provided by Bentley Systems
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2464651);
- viewer.scene.primitives.add(tileset);
+ scene.primitives.add(tileset);
} catch (error) {
console.log(`Error loading tileset: ${error}`);
} //Sandcastle_End
diff --git a/Apps/Sandcastle/gallery/Clipping Regions.html b/Apps/Sandcastle/gallery/Clipping Regions.html
index b7116fc29f17..f56a5c886b27 100644
--- a/Apps/Sandcastle/gallery/Clipping Regions.html
+++ b/Apps/Sandcastle/gallery/Clipping Regions.html
@@ -43,7 +43,7 @@
animation: false,
sceneModePicker: false,
baseLayerPicker: false,
- geocoder: Cesium.IonGeocoderProviderType.GOOGLE,
+ geocoder: Cesium.IonGeocodeProviderType.GOOGLE,
});
const scene = viewer.scene;
diff --git a/Apps/Sandcastle/gallery/iTwin Demo.html b/Apps/Sandcastle/gallery/iModel Mesh Export Service.html
similarity index 99%
rename from Apps/Sandcastle/gallery/iTwin Demo.html
rename to Apps/Sandcastle/gallery/iModel Mesh Export Service.html
index e78ab95f4c15..b445ff763ad7 100644
--- a/Apps/Sandcastle/gallery/iTwin Demo.html
+++ b/Apps/Sandcastle/gallery/iModel Mesh Export Service.html
@@ -12,7 +12,7 @@
content="Demonstrate loading iModel data from the iTwin platform."
/>
- iTwin iModel demo
+ iModel Mesh Export Service
diff --git a/Apps/Sandcastle/gallery/iTwin Demo.jpg b/Apps/Sandcastle/gallery/iModel Mesh Export Service.jpg
similarity index 100%
rename from Apps/Sandcastle/gallery/iTwin Demo.jpg
rename to Apps/Sandcastle/gallery/iModel Mesh Export Service.jpg
diff --git a/CHANGES.md b/CHANGES.md
index 61808466ebdc..698829a9cbd4 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -10,7 +10,7 @@
- Added an integration with the [iTwin Platform](https://developer.bentley.com/) to load Reality Data terrain meshes and GeoJSON. Use `ITwinPlatform.defaultAccessToken` to set the access token. Then use `ITwinData.createTilesetForRealityDataId(iTwinId, dataId)` to load terrain meshes as a `Cesium3DTileset` or `ITwinData.createDataSourceForRealityDataId(iTwinId, dataId)` to load GeoJSON or KML files as data sources. [#12344](https://github.com/CesiumGS/cesium/pull/12344)
- Added `getSample` to `SampledProperty` to get the time of samples. [#12253](https://github.com/CesiumGS/cesium/pull/12253)
- Added `Entity.trackingReferenceFrame` property to allow tracking entities in various reference frames. [#12194](https://github.com/CesiumGS/cesium/pull/12194), [#12314](https://github.com/CesiumGS/cesium/pull/12314)
- - `TrackingReferenceFrame.AUTODETECT` (default): uses either VVLH or ENU dependeding on entity's dynamic. Use `TrackingReferenceFrame.ENU` if your camera orientation flips abruptly from time to time.
+ - `TrackingReferenceFrame.AUTODETECT` (default): uses either VVLH or ENU depending on entity's dynamic. Use `TrackingReferenceFrame.ENU` if your camera orientation flips abruptly from time to time.
- `TrackingReferenceFrame.ENU`: uses the entity's local East-North-Up reference frame.
- `TrackingReferenceFrame.INERTIAL`: uses the entity's inertial reference frame.
- `TrackingReferenceFrame.VELOCITY`: uses entity's `VelocityOrientationProperty` as orientation.
@@ -18,15 +18,16 @@
##### Breaking Changes :mega:
+- `PostProcessStageCollection.ambientOcclusion` has been updated with a new algorithm to provide better results at all scales, with tunable performance cost. To approximate the appearance and performance of the old algorithm, set the following values for `scene.postProcessStages.ambientOcclusion.uniforms`: `{ lengthCap: 0.02, directionCount: 6, stepCount: 8 }`. For best results at long distances, consider setting `Viewer.camera.frustum.near` to `1.0` or more, to improve precision in the depth buffer. [#12316](https://github.com/CesiumGS/cesium/pull/12316)
- `Rectangle.validate` has been removed.
##### Fixes :wrench:
- Fixed bug where shared external textures from glTF files were not accounted for in resource statistics. [#12331](https://github.com/CesiumGS/cesium/pull/12331)
-- Fix label rendering bug in WebGL1 contexts. [#12301](https://github.com/CesiumGS/cesium/pull/12301)
- Fixed lag or crashes when loading many models in the same frame. [#12320](https://github.com/CesiumGS/cesium/pull/12320)
-- Updated WMS example URL in UrlTemplateImageryProvider documentation to use an active service. [#12323](https://github.com/CesiumGS/cesium/pull/12323)
- Fix point cloud filtering performance on certain hardware [#12317](https://github.com/CesiumGS/cesium/pull/12317)
+- Fix label rendering bug in WebGL1 contexts. [#12301](https://github.com/CesiumGS/cesium/pull/12301)
+- Updated WMS example URL in UrlTemplateImageryProvider documentation to use an active service. [#12323](https://github.com/CesiumGS/cesium/pull/12323)
##### Deprecated :hourglass_flowing_sand:
diff --git a/ThirdParty.json b/ThirdParty.json
index 10a55aa1d64e..ed72a070a4c1 100644
--- a/ThirdParty.json
+++ b/ThirdParty.json
@@ -44,7 +44,7 @@
"license": [
"Apache-2.0"
],
- "version": "3.1.7",
+ "version": "3.2.2",
"url": "https://www.npmjs.com/package/dompurify",
"notes": "dompurify is available as both MPL-2.0 OR Apache-2.0"
},
diff --git a/package.json b/package.json
index 41eb18d38f80..5f1ed19eb0bd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cesium",
- "version": "1.123.1",
+ "version": "1.124.0",
"description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.",
"homepage": "http://cesium.com/cesiumjs/",
"license": "Apache-2.0",
@@ -51,8 +51,8 @@
"./Specs/**/*"
],
"dependencies": {
- "@cesium/engine": "^12.0.1",
- "@cesium/widgets": "^9.0.1"
+ "@cesium/engine": "^13.0.0",
+ "@cesium/widgets": "^10.0.0"
},
"devDependencies": {
"@playwright/test": "^1.41.1",
diff --git a/packages/engine/Source/Core/Ion.js b/packages/engine/Source/Core/Ion.js
index 56c3b1d900d0..a0a75ec33486 100644
--- a/packages/engine/Source/Core/Ion.js
+++ b/packages/engine/Source/Core/Ion.js
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
let defaultTokenCredit;
const defaultAccessToken =
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiZjBmMDE4Ny05M2JlLTRlMzgtYjIxYi05YmJjM2QwMzJkYWMiLCJpZCI6MjU5LCJpYXQiOjE3MzA0NjY3MDl9.t-7gCGPUe-oGCyCoeXPtYmlMVdgqUQD9mn-Da23yUoI";
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0ZDdmNWJiNy0wMmNlLTQ1MWUtODM2YS02NGM1MTBlOGMwMWQiLCJpZCI6MjU5LCJpYXQiOjE3MzMxNTc4OTV9.B3URHf0VdHDtGckb-hv7uqATdn8KfvkiuoAFZUq8tAo";
/**
* Default settings for accessing the Cesium ion API.
*
diff --git a/packages/engine/Source/Scene/ArcGisMapService.js b/packages/engine/Source/Scene/ArcGisMapService.js
index e2f65714ba21..693004b42cd1 100644
--- a/packages/engine/Source/Scene/ArcGisMapService.js
+++ b/packages/engine/Source/Scene/ArcGisMapService.js
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
let defaultTokenCredit;
const defaultAccessToken =
- "AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQpcUfxe1Yndhf82d5oKkQJ4_7VPaBQGYSISOMaRew7Sy-eTX1JQ4XwaC8v5aCvV72O6LCPs5Ss1pXXH-0uEw6bSRhTeQYHOmikutC2OMyZt6lu0VfT7FA-jVMO_UsunWNTf2cycP2O4IeDN_UV9G-VNmUu2jRvCHioi8o72ua4238s2219cYLEmcoGRJGVJTA.AT1_PjLvyih0";
+ "AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSrZYLHFXe7j_lQcsSJKc8-7rwh0IFSNWLGZErkzXRnYjMjURTz-hGiKMEeAJIZBG7uiYEn0Mt1rrwlJGIpirZQC4iO428519DlO3QC9DnRBqLXGTBhirgoU7-Z2209sy87s49kw6NOC8_Eew6nCLf-pZ883DRPRyAYH7LC8cvRLInud0EdndtUFa4y83TamrA.AT1_ahjrWDrq";
/**
* Default options for accessing the ArcGIS image tile service.
*
diff --git a/packages/engine/Source/Scene/PostProcessStage.js b/packages/engine/Source/Scene/PostProcessStage.js
index 44012ca77b56..454822ca4e8f 100644
--- a/packages/engine/Source/Scene/PostProcessStage.js
+++ b/packages/engine/Source/Scene/PostProcessStage.js
@@ -94,9 +94,16 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js";
function PostProcessStage(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
const {
+ name = createGuid(),
fragmentShader,
+ uniforms,
textureScale = 1.0,
+ forcePowerOfTwo = false,
+ sampleMode = PostProcessStageSampleMode.NEAREST,
pixelFormat = PixelFormat.RGBA,
+ pixelDatatype = PixelDatatype.UNSIGNED_BYTE,
+ clearColor = Color.BLACK,
+ scissorRectangle,
} = options;
//>>includeStart('debug', pragmas.debug);
@@ -113,19 +120,13 @@ function PostProcessStage(options) {
//>>includeEnd('debug');
this._fragmentShader = fragmentShader;
- this._uniforms = options.uniforms;
+ this._uniforms = uniforms;
this._textureScale = textureScale;
- this._forcePowerOfTwo = defaultValue(options.forcePowerOfTwo, false);
- this._sampleMode = defaultValue(
- options.sampleMode,
- PostProcessStageSampleMode.NEAREST,
- );
+ this._forcePowerOfTwo = forcePowerOfTwo;
+ this._sampleMode = sampleMode;
this._pixelFormat = pixelFormat;
- this._pixelDatatype = defaultValue(
- options.pixelDatatype,
- PixelDatatype.UNSIGNED_BYTE,
- );
- this._clearColor = defaultValue(options.clearColor, Color.BLACK);
+ this._pixelDatatype = pixelDatatype;
+ this._clearColor = clearColor;
this._uniformMap = undefined;
this._command = undefined;
@@ -143,18 +144,14 @@ function PostProcessStage(options) {
const passState = new PassState();
passState.scissorTest = {
enabled: true,
- rectangle: defined(options.scissorRectangle)
- ? BoundingRectangle.clone(options.scissorRectangle)
+ rectangle: defined(scissorRectangle)
+ ? BoundingRectangle.clone(scissorRectangle)
: new BoundingRectangle(),
};
this._passState = passState;
this._ready = false;
- let name = options.name;
- if (!defined(name)) {
- name = createGuid();
- }
this._name = name;
this._logDepthChanged = undefined;
diff --git a/packages/engine/Source/Scene/PostProcessStageCollection.js b/packages/engine/Source/Scene/PostProcessStageCollection.js
index 59ca0e293923..20019fa840cd 100644
--- a/packages/engine/Source/Scene/PostProcessStageCollection.js
+++ b/packages/engine/Source/Scene/PostProcessStageCollection.js
@@ -155,32 +155,20 @@ Object.defineProperties(PostProcessStageCollection.prototype, {
* surface receives light and regardless of the light's position.
*
*
- * The uniforms have the following properties: intensity, bias, lengthCap,
- * stepSize, frustumLength, ambientOcclusionOnly,
- * delta, sigma, and blurStepSize.
- *
+ * The uniforms have the following properties:
*
*
intensity is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is 3.0.
- *
*
bias 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,
* sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is 0.1.
- *
*
lengthCap is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,
* sampling stops in the current direction. The default value is 0.26.
- *
- *
stepSize is a scalar value indicating the distance to the next texel sample in the current direction. The default value is 1.95.
- *
- *
frustumLength 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.
- * The default value is 1000.0.
- *
+ *
directionCount is the number of directions along which the ray marching will search for occluders. The default value is 8.
+ *
stepCount is the number of steps the ray marching will take along each direction. The default value is 32.
+ *
randomTexture is a texture where the red channel is a random value in [0.0, 1.0]. The default value is undefined. This texture needs to be set.
*
ambientOcclusionOnly is a boolean value. When true, only the shadows generated are written to the output. When false, the input texture is modulated
* with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is false.
*
*
- * delta, sigma, and blurStepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
- * The blur is applied to the shadows generated from the image to make them smoother.
- *
- *
* When enabled, this stage will execute before all others.
*
*
diff --git a/packages/engine/Source/Scene/PostProcessStageLibrary.js b/packages/engine/Source/Scene/PostProcessStageLibrary.js
index f4329daee77f..9168c068da54 100644
--- a/packages/engine/Source/Scene/PostProcessStageLibrary.js
+++ b/packages/engine/Source/Scene/PostProcessStageLibrary.js
@@ -476,27 +476,19 @@ PostProcessStageLibrary.createBloomStage = function () {
* surface receives light and regardless of the light's position.
*
*
- * The uniforms have the following properties: intensity, bias, lengthCap,
- * stepSize, frustumLength, randomTexture, ambientOcclusionOnly,
- * delta, sigma, and blurStepSize.
- *
+ * The uniforms have the following properties:
*
*
intensity is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is 3.0.
*
bias 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,
* sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is 0.1.
*
lengthCap is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,
* sampling stops in the current direction. The default value is 0.26.
- *
stepSize is a scalar value indicating the distance to the next texel sample in the current direction. The default value is 1.95.
- *
frustumLength 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.
- * The default value is 1000.0.
+ *
directionCount is the number of directions along which the ray marching will search for occluders. The default value is 8.
+ *
stepCount is the number of steps the ray marching will take along each direction. The default value is 32.
*
randomTexture is a texture where the red channel is a random value in [0.0, 1.0]. The default value is undefined. This texture needs to be set.
*
ambientOcclusionOnly is a boolean value. When true, only the shadows generated are written to the output. When false, the input texture is modulated
* with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is false.
*
- *
- * delta, sigma, and blurStepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
- * The blur is applied to the shadows generated from the image to make them smoother.
- *