Skip to content

Commit 79acb71

Browse files
authored
Merge branch 'main' into dev-error-matchers
2 parents 647c2e2 + c72ad38 commit 79acb71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1756
-307
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"iife",
6363
"lerp",
6464
"Lilli",
65+
"maki",
6566
"MAXAR",
6667
"minifiers",
6768
"mipmapped",

Apps/Sandcastle/Sandcastle-header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
)
106106
) {
107107
window.location =
108-
"https://github.com/CesiumGS/cesium/wiki/Contributor%27s-Guide";
108+
"https://github.com/CesiumGS/cesium/blob/main/Documentation/Contributors/BuildGuide/README.md#quickstart";
109109
}
110110
}
111111
})();

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: 17 additions & 7 deletions
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>
@@ -120,18 +120,28 @@
120120
scene.primitives.add(surroundingArea);
121121
scene.primitives.add(station);
122122

123+
// Create tileset of the reality data mesh
124+
const iTwinId = "535a24a3-9b29-4e23-bb5d-9cedb524c743";
125+
const realityMeshId = "85897090-3bcc-470b-bec7-20bb639cc1b9";
126+
const realityMesh = await Cesium.ITwinData.createTilesetForRealityDataId(
127+
iTwinId,
128+
realityMeshId,
129+
);
130+
scene.primitives.add(realityMesh);
131+
123132
Sandcastle.addToolbarButton(
124133
"Toggle Surrounding Area",
125-
function () {
126-
surroundingArea.show = !surroundingArea.show;
127-
},
134+
() => (surroundingArea.show = !surroundingArea.show),
128135
"layers",
129136
);
130137
Sandcastle.addToolbarButton(
131138
"Toggle Station Model",
132-
function () {
133-
station.show = !station.show;
134-
},
139+
() => (station.show = !station.show),
140+
"layers",
141+
);
142+
Sandcastle.addToolbarButton(
143+
"Toggle Reality Mesh",
144+
() => (realityMesh.show = !realityMesh.show),
135145
"layers",
136146
);
137147

Loading
-12.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)