Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into itwin-more-reality-da…
Browse files Browse the repository at this point in the history
…ta-types
  • Loading branch information
jjspace committed Dec 4, 2024
2 parents b27251b + 382c517 commit 16496df
Show file tree
Hide file tree
Showing 21 changed files with 201 additions and 192 deletions.
40 changes: 28 additions & 12 deletions Apps/Sandcastle/gallery/AEC Architectural Design.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@
// Enable rendering the sky
viewer.scene.skyAtmosphere.show = true;

// Configure Ambient Occlusion
if (Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
ambientOcclusion.enabled = true;
ambientOcclusion.uniforms.intensity = 2.0;
ambientOcclusion.uniforms.bias = 0.1;
ambientOcclusion.uniforms.lengthCap = 0.5;
ambientOcclusion.uniforms.directionCount = 16;
ambientOcclusion.uniforms.stepCount = 32;
}

// Set to 1 PM Philadelphia time in UTC
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2024-11-22T18:00:00Z");

Expand Down Expand Up @@ -90,24 +101,29 @@

// The Architectural Design is comprised of multiple tilesets
const tilesetData = [
{ title: "Architecture", assetId: 2864367 },
{ title: "Facade", assetId: 2864370 },
{ title: "Structural", assetId: 2864375 },
{ title: "Electrical", assetId: 2864368 },
{ title: "HVAC", assetId: 2864372 },
{ title: "Plumbing", assetId: 2864373 },
{ title: "Site", assetId: 2864374 },
{ title: "Architecture", assetId: 2887123, visible: true },
{ title: "Facade", assetId: 2887125, visible: true },
{ title: "Structural", assetId: 2887130, visible: false },
{ title: "Electrical", assetId: 2887124, visible: true },
{ title: "HVAC", assetId: 2887126, visible: true },
{ title: "Plumbing", assetId: 2887127, visible: true },
{ title: "Site", assetId: 2887129, visible: true },
];

// Load each tileset and create a corresponding visibility toggle button
for (const { title, assetId } of tilesetData) {
for (const { title, assetId, visible } of tilesetData) {
try {
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(assetId);
viewer.scene.primitives.add(tileset);

Sandcastle.addToggleButton(title, true, function (checked) {
tileset.show = checked;
});
tileset.show = visible;

const toggleBtn = Sandcastle.addToggleButton(
title,
visible,
function (checked) {
tileset.show = checked;
},
);
} catch (error) {
console.log(`Error loading tileset (${title}): ${error}`);
}
Expand Down
17 changes: 14 additions & 3 deletions Apps/Sandcastle/gallery/AEC Isolate by Category.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@
// Enable rendering the sky
viewer.scene.skyAtmosphere.show = true;

// Configure Ambient Occlusion
if (Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
ambientOcclusion.enabled = true;
ambientOcclusion.uniforms.intensity = 2.0;
ambientOcclusion.uniforms.bias = 0.1;
ambientOcclusion.uniforms.lengthCap = 0.5;
ambientOcclusion.uniforms.directionCount = 16;
ambientOcclusion.uniforms.stepCount = 32;
}

// Set to 1 PM Philadelphia time in UTC
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2024-11-22T18:00:00Z");

Expand Down Expand Up @@ -87,18 +98,18 @@

googleTileset.clippingPolygons = polygons;

// Add the architectural tileset as a semi-transparent ghost
// Add the architectural tileset
let archTileset;
try {
archTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864367);
archTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887123);
viewer.scene.primitives.add(archTileset);
} catch (error) {
console.log(`Error loading tileset: ${error}`);
}

// Add the site tileset
try {
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864374);
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887129);
viewer.scene.primitives.add(tileset);
} catch (error) {
console.log(`Error loading tileset: ${error}`);
Expand Down
19 changes: 15 additions & 4 deletions Apps/Sandcastle/gallery/AEC Metadata Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@
// Enable rendering the sky
viewer.scene.skyAtmosphere.show = true;

// Configure Ambient Occlusion
if (Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
const ambientOcclusion = viewer.scene.postProcessStages.ambientOcclusion;
ambientOcclusion.enabled = true;
ambientOcclusion.uniforms.intensity = 2.0;
ambientOcclusion.uniforms.bias = 0.1;
ambientOcclusion.uniforms.lengthCap = 0.5;
ambientOcclusion.uniforms.directionCount = 16;
ambientOcclusion.uniforms.stepCount = 32;
}

// Set to 1 PM Philadelphia time in UTC
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2024-11-22T18:00:00Z");

Expand Down Expand Up @@ -111,7 +122,7 @@

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

// Add the site tileset
try {
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864374);
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887129);
viewer.scene.primitives.add(tileset);
} catch (error) {
console.log(`Error loading tileset: ${error}`);
}

// Add the pipe tileset which will be styled by metadata
// Add the HVAC tileset which will be styled by metadata
let pipeTileset;
try {
pipeTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2864372);
pipeTileset = await Cesium.Cesium3DTileset.fromIonAssetId(2887126);
pipeTileset.maximumScreenSpaceError = 4;
viewer.scene.primitives.add(pipeTileset);
} catch (error) {
Expand Down
45 changes: 24 additions & 21 deletions Apps/Sandcastle/gallery/Ambient Occlusion.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,38 @@
</td>
</tr>
<tr>
<td>Step Size</td>
<td>Step Count</td>
<td>
<input
type="range"
min="1"
max="10"
step="0.01"
data-bind="value: stepSize, valueUpdate: 'input'"
max="64"
step="1"
data-bind="value: stepCount, valueUpdate: 'input'"
/>
</td>
</tr>
<tr>
<td>Bias</td>
<td>Direction Count</td>
<td>
<input
type="range"
min="0"
max="1"
step="0.01"
data-bind="value: bias, valueUpdate: 'input'"
min="1"
max="16"
step="1"
data-bind="value: directionCount, valueUpdate: 'input'"
/>
</td>
</tr>
<tr>
<td>Blur Step Size</td>
<td>Bias</td>
<td>
<input
type="range"
min="0"
max="4"
max="1"
step="0.01"
data-bind="value: blurStepSize, valueUpdate: 'input'"
data-bind="value: bias, valueUpdate: 'input'"
/>
</td>
</tr>
Expand All @@ -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(
Expand All @@ -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);
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Clipping Regions.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
animation: false,
sceneModePicker: false,
baseLayerPicker: false,
geocoder: Cesium.IonGeocoderProviderType.GOOGLE,
geocoder: Cesium.IonGeocodeProviderType.GOOGLE,
});
const scene = viewer.scene;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
content="Demonstrate loading iModel data from the iTwin platform."
/>
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles" />
<title>iTwin iModel demo</title>
<title>iModel Mesh Export Service</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="module" src="../load-cesium-es6.js"></script>
</head>
Expand Down
File renamed without changes
7 changes: 4 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@
- 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.
- Added `GoogleGeocoderService` for standalone usage of Google geocoder. [#12299](https://github.com/CesiumGS/cesium/pull/12299)

##### 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:

Expand Down
2 changes: 1 addition & 1 deletion ThirdParty.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Source/Core/Ion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Source/Scene/ArcGisMapService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Loading

0 comments on commit 16496df

Please sign in to comment.