Skip to content

Commit 16496df

Browse files
committed
Merge remote-tracking branch 'origin/main' into itwin-more-reality-data-types
2 parents b27251b + 382c517 commit 16496df

21 files changed

+201
-192
lines changed

Apps/Sandcastle/gallery/AEC Architectural Design.html

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@
5050
// Enable rendering the sky
5151
viewer.scene.skyAtmosphere.show = true;
5252

53+
// Configure Ambient Occlusion
54+
if (Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
55+
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
56+
ambientOcclusion.enabled = true;
57+
ambientOcclusion.uniforms.intensity = 2.0;
58+
ambientOcclusion.uniforms.bias = 0.1;
59+
ambientOcclusion.uniforms.lengthCap = 0.5;
60+
ambientOcclusion.uniforms.directionCount = 16;
61+
ambientOcclusion.uniforms.stepCount = 32;
62+
}
63+
5364
// Set to 1 PM Philadelphia time in UTC
5465
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2024-11-22T18:00:00Z");
5566

@@ -90,24 +101,29 @@
90101

91102
// The Architectural Design is comprised of multiple tilesets
92103
const tilesetData = [
93-
{ title: "Architecture", assetId: 2864367 },
94-
{ title: "Facade", assetId: 2864370 },
95-
{ title: "Structural", assetId: 2864375 },
96-
{ title: "Electrical", assetId: 2864368 },
97-
{ title: "HVAC", assetId: 2864372 },
98-
{ title: "Plumbing", assetId: 2864373 },
99-
{ title: "Site", assetId: 2864374 },
104+
{ title: "Architecture", assetId: 2887123, visible: true },
105+
{ title: "Facade", assetId: 2887125, visible: true },
106+
{ title: "Structural", assetId: 2887130, visible: false },
107+
{ title: "Electrical", assetId: 2887124, visible: true },
108+
{ title: "HVAC", assetId: 2887126, visible: true },
109+
{ title: "Plumbing", assetId: 2887127, visible: true },
110+
{ title: "Site", assetId: 2887129, visible: true },
100111
];
101112

102113
// Load each tileset and create a corresponding visibility toggle button
103-
for (const { title, assetId } of tilesetData) {
114+
for (const { title, assetId, visible } of tilesetData) {
104115
try {
105116
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(assetId);
106117
viewer.scene.primitives.add(tileset);
107-
108-
Sandcastle.addToggleButton(title, true, function (checked) {
109-
tileset.show = checked;
110-
});
118+
tileset.show = visible;
119+
120+
const toggleBtn = Sandcastle.addToggleButton(
121+
title,
122+
visible,
123+
function (checked) {
124+
tileset.show = checked;
125+
},
126+
);
111127
} catch (error) {
112128
console.log(`Error loading tileset (${title}): ${error}`);
113129
}

Apps/Sandcastle/gallery/AEC Isolate by Category.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@
4949
// Enable rendering the sky
5050
viewer.scene.skyAtmosphere.show = true;
5151

52+
// Configure Ambient Occlusion
53+
if (Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
54+
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
55+
ambientOcclusion.enabled = true;
56+
ambientOcclusion.uniforms.intensity = 2.0;
57+
ambientOcclusion.uniforms.bias = 0.1;
58+
ambientOcclusion.uniforms.lengthCap = 0.5;
59+
ambientOcclusion.uniforms.directionCount = 16;
60+
ambientOcclusion.uniforms.stepCount = 32;
61+
}
62+
5263
// Set to 1 PM Philadelphia time in UTC
5364
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2024-11-22T18:00:00Z");
5465

@@ -87,18 +98,18 @@
8798

8899
googleTileset.clippingPolygons = polygons;
89100

90-
// Add the architectural tileset as a semi-transparent ghost
101+
// Add the architectural tileset
91102
let archTileset;
92103
try {
93-
archTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864367);
104+
archTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887123);
94105
viewer.scene.primitives.add(archTileset);
95106
} catch (error) {
96107
console.log(`Error loading tileset: ${error}`);
97108
}
98109

99110
// Add the site tileset
100111
try {
101-
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864374);
112+
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887129);
102113
viewer.scene.primitives.add(tileset);
103114
} catch (error) {
104115
console.log(`Error loading tileset: ${error}`);

Apps/Sandcastle/gallery/AEC Metadata Styling.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@
7171
// Enable rendering the sky
7272
viewer.scene.skyAtmosphere.show = true;
7373

74+
// Configure Ambient Occlusion
75+
if (Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
76+
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
77+
ambientOcclusion.enabled = true;
78+
ambientOcclusion.uniforms.intensity = 2.0;
79+
ambientOcclusion.uniforms.bias = 0.1;
80+
ambientOcclusion.uniforms.lengthCap = 0.5;
81+
ambientOcclusion.uniforms.directionCount = 16;
82+
ambientOcclusion.uniforms.stepCount = 32;
83+
}
84+
7485
// Set to 1 PM Philadelphia time in UTC
7586
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2024-11-22T18:00:00Z");
7687

@@ -111,7 +122,7 @@
111122

112123
// Add the architectural tileset as a semi-transparent ghost
113124
try {
114-
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864367);
125+
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887123);
115126
viewer.scene.primitives.add(tileset);
116127
tileset.style = new Cesium.Cesium3DTileStyle({
117128
color: "color('lightblue', 0.05)",
@@ -122,16 +133,16 @@
122133

123134
// Add the site tileset
124135
try {
125-
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864374);
136+
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887129);
126137
viewer.scene.primitives.add(tileset);
127138
} catch (error) {
128139
console.log(`Error loading tileset: ${error}`);
129140
}
130141

131-
// Add the pipe tileset which will be styled by metadata
142+
// Add the HVAC tileset which will be styled by metadata
132143
let pipeTileset;
133144
try {
134-
pipeTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864372);
145+
pipeTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887126);
135146
pipeTileset.maximumScreenSpaceError = 4;
136147
viewer.scene.primitives.add(pipeTileset);
137148
} catch (error) {

Apps/Sandcastle/gallery/Ambient Occlusion.html

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,38 @@
6262
</td>
6363
</tr>
6464
<tr>
65-
<td>Step Size</td>
65+
<td>Step Count</td>
6666
<td>
6767
<input
6868
type="range"
6969
min="1"
70-
max="10"
71-
step="0.01"
72-
data-bind="value: stepSize, valueUpdate: 'input'"
70+
max="64"
71+
step="1"
72+
data-bind="value: stepCount, valueUpdate: 'input'"
7373
/>
7474
</td>
7575
</tr>
7676
<tr>
77-
<td>Bias</td>
77+
<td>Direction Count</td>
7878
<td>
7979
<input
8080
type="range"
81-
min="0"
82-
max="1"
83-
step="0.01"
84-
data-bind="value: bias, valueUpdate: 'input'"
81+
min="1"
82+
max="16"
83+
step="1"
84+
data-bind="value: directionCount, valueUpdate: 'input'"
8585
/>
8686
</td>
8787
</tr>
8888
<tr>
89-
<td>Blur Step Size</td>
89+
<td>Bias</td>
9090
<td>
9191
<input
9292
type="range"
9393
min="0"
94-
max="4"
94+
max="1"
9595
step="0.01"
96-
data-bind="value: blurStepSize, valueUpdate: 'input'"
96+
data-bind="value: bias, valueUpdate: 'input'"
9797
/>
9898
</td>
9999
</tr>
@@ -106,7 +106,11 @@
106106
//Sandcastle_Begin
107107
const viewer = new Cesium.Viewer("cesiumContainer");
108108

109-
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z");
109+
const { canvas, camera, clock, scene } = viewer;
110+
camera.frustum.near = 1.0;
111+
scene.debugShowFramesPerSecond = true;
112+
113+
clock.currentTime = Cesium.JulianDate.fromIso8601("2022-08-01T00:00:00Z");
110114

111115
if (!Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
112116
window.alert(
@@ -119,9 +123,9 @@
119123
ambientOcclusionOnly: false,
120124
intensity: 3.0,
121125
bias: 0.1,
122-
lengthCap: 0.03,
123-
stepSize: 1.0,
124-
blurStepSize: 0.86,
126+
lengthCap: 0.26,
127+
directionCount: 8,
128+
stepCount: 32,
125129
};
126130

127131
Cesium.knockout.track(viewModel);
@@ -134,7 +138,7 @@
134138
}
135139

136140
function updatePostProcess() {
137-
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
141+
const ambientOcclusion = scene.postProcessStages.ambientOcclusion;
138142
ambientOcclusion.enabled =
139143
Boolean(viewModel.show) || Boolean(viewModel.ambientOcclusionOnly);
140144
ambientOcclusion.uniforms.ambientOcclusionOnly = Boolean(
@@ -143,12 +147,11 @@
143147
ambientOcclusion.uniforms.intensity = Number(viewModel.intensity);
144148
ambientOcclusion.uniforms.bias = Number(viewModel.bias);
145149
ambientOcclusion.uniforms.lengthCap = Number(viewModel.lengthCap);
146-
ambientOcclusion.uniforms.stepSize = Number(viewModel.stepSize);
147-
ambientOcclusion.uniforms.blurStepSize = Number(viewModel.blurStepSize);
150+
ambientOcclusion.uniforms.directionCount = Number(viewModel.directionCount);
151+
ambientOcclusion.uniforms.stepCount = Number(viewModel.stepCount);
148152
}
149153
updatePostProcess();
150154

151-
const camera = viewer.scene.camera;
152155
camera.position = new Cesium.Cartesian3(
153156
1234127.2294710164,
154157
-5086011.666443127,
@@ -173,7 +176,7 @@
173176
try {
174177
// Power Plant design model provided by Bentley Systems
175178
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2464651);
176-
viewer.scene.primitives.add(tileset);
179+
scene.primitives.add(tileset);
177180
} catch (error) {
178181
console.log(`Error loading tileset: ${error}`);
179182
} //Sandcastle_End

Apps/Sandcastle/gallery/Clipping Regions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
animation: false,
4444
sceneModePicker: false,
4545
baseLayerPicker: false,
46-
geocoder: Cesium.IonGeocoderProviderType.GOOGLE,
46+
geocoder: Cesium.IonGeocodeProviderType.GOOGLE,
4747
});
4848
const scene = viewer.scene;
4949

Apps/Sandcastle/gallery/iTwin Demo.html renamed to Apps/Sandcastle/gallery/iModel Mesh Export Service.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
content="Demonstrate loading iModel data from the iTwin platform."
1313
/>
1414
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles" />
15-
<title>iTwin iModel demo</title>
15+
<title>iModel Mesh Export Service</title>
1616
<script type="text/javascript" src="../Sandcastle-header.js"></script>
1717
<script type="module" src="../load-cesium-es6.js"></script>
1818
</head>

CHANGES.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,24 @@
1010
- 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)
1111
- Added `getSample` to `SampledProperty` to get the time of samples. [#12253](https://github.com/CesiumGS/cesium/pull/12253)
1212
- 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)
13-
- `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.
13+
- `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.
1414
- `TrackingReferenceFrame.ENU`: uses the entity's local East-North-Up reference frame.
1515
- `TrackingReferenceFrame.INERTIAL`: uses the entity's inertial reference frame.
1616
- `TrackingReferenceFrame.VELOCITY`: uses entity's `VelocityOrientationProperty` as orientation.
1717
- Added `GoogleGeocoderService` for standalone usage of Google geocoder. [#12299](https://github.com/CesiumGS/cesium/pull/12299)
1818

1919
##### Breaking Changes :mega:
2020

21+
- `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)
2122
- `Rectangle.validate` has been removed.
2223

2324
##### Fixes :wrench:
2425

2526
- Fixed bug where shared external textures from glTF files were not accounted for in resource statistics. [#12331](https://github.com/CesiumGS/cesium/pull/12331)
26-
- Fix label rendering bug in WebGL1 contexts. [#12301](https://github.com/CesiumGS/cesium/pull/12301)
2727
- Fixed lag or crashes when loading many models in the same frame. [#12320](https://github.com/CesiumGS/cesium/pull/12320)
28-
- Updated WMS example URL in UrlTemplateImageryProvider documentation to use an active service. [#12323](https://github.com/CesiumGS/cesium/pull/12323)
2928
- Fix point cloud filtering performance on certain hardware [#12317](https://github.com/CesiumGS/cesium/pull/12317)
29+
- Fix label rendering bug in WebGL1 contexts. [#12301](https://github.com/CesiumGS/cesium/pull/12301)
30+
- Updated WMS example URL in UrlTemplateImageryProvider documentation to use an active service. [#12323](https://github.com/CesiumGS/cesium/pull/12323)
3031

3132
##### Deprecated :hourglass_flowing_sand:
3233

ThirdParty.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"license": [
4545
"Apache-2.0"
4646
],
47-
"version": "3.1.7",
47+
"version": "3.2.2",
4848
"url": "https://www.npmjs.com/package/dompurify",
4949
"notes": "dompurify is available as both MPL-2.0 OR Apache-2.0"
5050
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cesium",
3-
"version": "1.123.1",
3+
"version": "1.124.0",
44
"description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.",
55
"homepage": "http://cesium.com/cesiumjs/",
66
"license": "Apache-2.0",
@@ -51,8 +51,8 @@
5151
"./Specs/**/*"
5252
],
5353
"dependencies": {
54-
"@cesium/engine": "^12.0.1",
55-
"@cesium/widgets": "^9.0.1"
54+
"@cesium/engine": "^13.0.0",
55+
"@cesium/widgets": "^10.0.0"
5656
},
5757
"devDependencies": {
5858
"@playwright/test": "^1.41.1",

0 commit comments

Comments
 (0)