Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
狗空 committed Jan 8, 2025
2 parents 2680e4b + 268232a commit ac57264
Show file tree
Hide file tree
Showing 24 changed files with 420 additions and 170 deletions.
11 changes: 0 additions & 11 deletions .slackbot.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
"3DTILES",
"aabb",
"Amato",
"basisu",
"bathymetric",
"bitangent",
"bitangents",
"bivariate",
"Bourke",
"brdf",
"cartesians",
"carto",
"cartographics",
"cesiumjs",
"comms",
Expand Down Expand Up @@ -93,6 +95,7 @@
"unregisters",
"unrenderable",
"voxel",
"VVLH",
"WEBG",
"xdescribe"
]
Expand Down
25 changes: 20 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# Change Log

### 1.126 - 2025-02-03

#### @cesium/engine

##### Fixes :wrench:

- Fixed error when resetting `Cesium3DTileset.modelMatrix` to its initial value. [#12409](https://github.com/CesiumGS/cesium/pull/12409)
- Fixed type of `ImageryLayer.fromProviderAsync`, to correctly show that the param `options` is optional. [#12400](https://github.com/CesiumGS/cesium/pull/12400)

### 1.125 - 2025-01-02

#### @cesium/engine

##### Additions :tada:

- Expanded integration with the [iTwin Platform](https://developer.bentley.com/) to load GeoJSON and KML data from the Reality Management API. Use `ITwinData.createDataSourceForRealityDataId` to load data as either GeoJSON or KML`. [#12344](https://github.com/CesiumGS/cesium/pull/12344)
- Added `environmentMapOptions` to `ModelGraphics`. For performance reasons by default, the environment map will not update if the entity position change. If environment map updates based on entity position are desired, provide an appropriate `environmentMapOptions.maximumPositionEpsilon` value. [#12358](https://github.com/CesiumGS/cesium/pull/12358)

##### Fixes :wrench:

- Fixed JulianDate to always generate valid ISO strings for fractional milliseconds [#12345](https://github.com/CesiumGS/cesium/pull/12345)
- Reduced memory usage and performance bottlenecks when using environment maps with models. [#12356](https://github.com/CesiumGS/cesium/issues/12356)
- Fixed `JulianDate` to always generate valid ISO strings for fractional milliseconds. [#12345](https://github.com/CesiumGS/cesium/pull/12345)
- Fixed intermittent z-fighting issue. [#12337](https://github.com/CesiumGS/cesium/issues/12337)

### 1.124 - 2024-12-02

Expand All @@ -13,7 +31,7 @@
##### Additions :tada:

- Added an integration with the [iTwin Platform](https://developer.bentley.com/) to load iModels as 3D Tiles. Use `ITwinPlatform.defaultAccessToken` to set the access token. Use `ITwinData.createTilesetFromIModelId(iModelId)` to load the iModel as a `Cesium3DTileset`. [#12289](https://github.com/CesiumGS/cesium/pull/12289)
- 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 an integration with the [iTwin Platform](https://developer.bentley.com/) to load Reality Data terrain meshes. Use `ITwinPlatform.defaultAccessToken` to set the access token. Then use `ITwinData.createTilesetForRealityDataId(iTwinId, dataId)` to load terrain meshes as a `Cesium3DTileset` [#12334](https://github.com/CesiumGS/cesium/pull/12334)
- 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 depending on entity's dynamic. Use `TrackingReferenceFrame.ENU` if your camera orientation flips abruptly from time to time.
Expand Down Expand Up @@ -96,9 +114,6 @@
- Fix flickering issue caused by bounding sphere retrieval being blocked by the bounding sphere of another entity. [#12230](https://github.com/CesiumGS/cesium/pull/12230)
- Fixed `ImageBasedLighting.imageBasedLightingFactor` not affecting lighting. [#12129](https://github.com/CesiumGS/cesium/pull/12129)
- Fix error with normalization of corner points for lines and corridors with collinear points. [#12255](https://github.com/CesiumGS/cesium/pull/12255)

##### Fixes :wrench:

- Properly handle `offset` and `scale` properties when picking metadata from property textures. [#12237](https://github.com/CesiumGS/cesium/pull/12237)

### 1.122 - 2024-10-01
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,5 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Emanuele Mastaglia](https://github.com/Masty88)
- [Connor Manning](https://github.com/connormanning)
- [Isaac Young](https://github.com/ibreathebsb)
- [Nick Crews](https://github.com/NickCrews)
- [胡文康](https://github.com/XiaoHu1994)
2 changes: 1 addition & 1 deletion Documentation/Contributors/ReleaseGuide/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Guide

We release Cesium on the first work day of every month. [This file](../../../.slackbot.yml) outlines the release schedule and the developer responsible for each month's release.
We release Cesium on the first work day of every month. The [Release Schedule](./ReleaseSchedule.md) outlines the release schedule and the developer responsible for each month's release.

There is no release manager; instead, our community shares the responsibility. Any committer can create the release for a given month, and at any point, they can pass the responsibility to someone else, or someone else can ask for it. This spreads knowledge, avoids stratification, avoids a single point of failure, and is beautifully unstructured ([more info](https://community.cesium.com/t/cesium-releases/45)).

Expand Down
16 changes: 16 additions & 0 deletions Documentation/Contributors/ReleaseGuide/ReleaseSchedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Release Schedule

| Date | User |
| --------- | ---------------- |
| 1/2/2025 | `@ggetz` |
| 2/3/2025 | `@jjhembd` |
| 3/3/2025 | `@lukemckinstry` |
| 4/1/2025 | `@jjspace` |
| 5/1/2025 | `@ggetz` |
| 6/2/2025 | `@jjhembd` |
| 7/1/2025 | `@lukemckinstry` |
| 8/1/2025 | `@jjspace` |
| 9/1/2025 | `@ggetz` |
| 10/1/2025 | `@jjhembd` |
| 11/3/2025 | `@lukemckinstry` |
| 12/1/2025 | `@jjspace` |
8 changes: 4 additions & 4 deletions ThirdParty.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"license": [
"BSD-3-Clause"
],
"version": "2.7.53",
"version": "2.7.54",
"url": "https://www.npmjs.com/package/@zip.js/zip.js"
},
{
"name": "autolinker",
"license": [
"MIT"
],
"version": "4.0.0",
"version": "4.1.0",
"url": "https://www.npmjs.com/package/autolinker"
},
{
Expand All @@ -44,7 +44,7 @@
"license": [
"Apache-2.0"
],
"version": "3.2.2",
"version": "3.2.3",
"url": "https://www.npmjs.com/package/dompurify",
"notes": "dompurify is available as both MPL-2.0 OR Apache-2.0"
},
Expand All @@ -61,7 +61,7 @@
"license": [
"ISC"
],
"version": "3.0.0",
"version": "3.0.1",
"url": "https://www.npmjs.com/package/earcut"
},
{
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cesium",
"version": "1.124.0",
"version": "1.125.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": "^13.0.0",
"@cesium/widgets": "^10.0.0"
"@cesium/engine": "^13.1.0",
"@cesium/widgets": "^10.1.0"
},
"devDependencies": {
"@playwright/test": "^1.41.1",
Expand Down Expand Up @@ -159,4 +159,4 @@
"packages/engine",
"packages/widgets"
]
}
}
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.eyJqdGkiOiI0ZDdmNWJiNy0wMmNlLTQ1MWUtODM2YS02NGM1MTBlOGMwMWQiLCJpZCI6MjU5LCJpYXQiOjE3MzMxNTc4OTV9.B3URHf0VdHDtGckb-hv7uqATdn8KfvkiuoAFZUq8tAo";
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzYTBjYzY2NC0yMGEyLTQxZDYtYmI2MC1hMWE4ZTBlMGNlNjciLCJpZCI6MjU5LCJpYXQiOjE3MzU4NTEwMzF9.nshpaoC5qpRD4F5diwcjwJ3tddp1OjCSXoMrv37Ales";
/**
* Default settings for accessing the Cesium ion API.
*
Expand Down
24 changes: 23 additions & 1 deletion packages/engine/Source/DataSources/ModelGraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function createArticulationStagePropertyBag(value) {
return new PropertyBag(value);
}

function createEnvironmentMapPropertyBag(value) {
return new PropertyBag(value);
}

/**
* @typedef {object} ModelGraphics.ConstructorOptions
*
Expand All @@ -40,6 +44,7 @@ function createArticulationStagePropertyBag(value) {
* @property {Property | ColorBlendMode} [colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model.
* @property {Property | number} [colorBlendAmount=0.5] A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
* @property {Property | Cartesian2} [imageBasedLightingFactor=new Cartesian2(1.0, 1.0)] A property specifying the contribution from diffuse and specular image-based lighting.
* @property {PropertyBag | Object<string, *>} [environmentMapOptions] The properties for managing dynamic environment maps on this entity.
* @property {Property | Color} [lightColor] A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
* @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed.
* @property {PropertyBag | Object<string, TranslationRotationScale>} [nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
Expand Down Expand Up @@ -101,6 +106,8 @@ function ModelGraphics(options) {
this._colorBlendAmountSubscription = undefined;
this._imageBasedLightingFactor = undefined;
this._imageBasedLightingFactorSubscription = undefined;
this._environmentMapOptions = undefined;
this._environmentMapOptionsSubscription = undefined;
this._lightColor = undefined;
this._lightColorSubscription = undefined;
this._distanceDisplayCondition = undefined;
Expand Down Expand Up @@ -279,6 +286,17 @@ Object.defineProperties(ModelGraphics.prototype, {
"imageBasedLightingFactor",
),

/**
* Gets or sets the {@link DynamicEnvironmentMapManager.ConstructorOptions} to apply to this model. This is represented as an {@link PropertyBag}.
* @memberof ModelGraphics.prototype
* @type {PropertyBag}
*/
environmentMapOptions: createPropertyDescriptor(
"environmentMapOptions",
undefined,
createEnvironmentMapPropertyBag,
),

/**
* A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
* @memberOf ModelGraphics.prototype
Expand Down Expand Up @@ -361,6 +379,7 @@ ModelGraphics.prototype.clone = function (result) {
result.colorBlendMode = this.colorBlendMode;
result.colorBlendAmount = this.colorBlendAmount;
result.imageBasedLightingFactor = this.imageBasedLightingFactor;
result.environmentMapOptions = this.environmentMapOptions;
result.lightColor = this.lightColor;
result.distanceDisplayCondition = this.distanceDisplayCondition;
result.nodeTransformations = this.nodeTransformations;
Expand Down Expand Up @@ -430,7 +449,10 @@ ModelGraphics.prototype.merge = function (source) {
this.imageBasedLightingFactor,
source.imageBasedLightingFactor,
);

this.environmentMapOptions = defaultValue(
this.environmentMapOptions,
source.environmentMapOptions,
);
this.lightColor = defaultValue(this.lightColor, source.lightColor);
this.distanceDisplayCondition = defaultValue(
this.distanceDisplayCondition,
Expand Down
23 changes: 22 additions & 1 deletion packages/engine/Source/DataSources/ModelVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const defaultColor = Color.WHITE;
const defaultColorBlendMode = ColorBlendMode.HIGHLIGHT;
const defaultColorBlendAmount = 0.5;
const defaultImageBasedLightingFactor = new Cartesian2(1.0, 1.0);
const defaultEnvironmentMapOptions = {
maximumPositionEpsilon: Number.POSITIVE_INFINITY,
};

const modelMatrixScratch = new Matrix4();
const nodeMatrixScratch = new Matrix4();
Expand Down Expand Up @@ -76,6 +79,7 @@ async function createModelPrimitive(
entity,
resource,
incrementallyLoadTextures,
environmentMapOptions,
) {
const primitives = visualizer._primitives;
const modelHash = visualizer._modelHash;
Expand All @@ -85,6 +89,7 @@ async function createModelPrimitive(
url: resource,
incrementallyLoadTextures: incrementallyLoadTextures,
scene: visualizer._scene,
environmentMapOptions: environmentMapOptions,
});

if (visualizer.isDestroyed() || !defined(modelHash[entity.id])) {
Expand Down Expand Up @@ -176,6 +181,9 @@ ModelVisualizer.prototype.update = function (time) {
articulationsScratch: {},
loadFailed: false,
modelUpdated: false,
environmentMapOptionsScratch: {
...defaultEnvironmentMapOptions,
},
};
modelHash[entity.id] = modelData;

Expand All @@ -185,7 +193,20 @@ ModelVisualizer.prototype.update = function (time) {
defaultIncrementallyLoadTextures,
);

createModelPrimitive(this, entity, resource, incrementallyLoadTextures);
const environmentMapOptions = Property.getValueOrDefault(
modelGraphics._environmentMapOptions,
time,
defaultEnvironmentMapOptions,
modelData.environmentMapOptionsScratch,
);

createModelPrimitive(
this,
entity,
resource,
incrementallyLoadTextures,
environmentMapOptions,
);
}

const model = modelData.modelPrimitive;
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/Source/Renderer/AutomaticUniforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1488,11 +1488,11 @@ const AutomaticUniforms = {
*
* @example
* // GLSL declaration
* uniform sampler2D czm_specularEnvironmentMaps;
* uniform samplerCube czm_specularEnvironmentMaps;
*/
czm_specularEnvironmentMaps: new AutomaticUniform({
size: 1,
datatype: WebGLConstants.SAMPLER_2D,
datatype: WebGLConstants.SAMPLER_CUBE,
getValue: function (uniformState) {
return uniformState.specularEnvironmentMaps;
},
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 =
"AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSrZYLHFXe7j_lQcsSJKc8-7rwh0IFSNWLGZErkzXRnYjMjURTz-hGiKMEeAJIZBG7uiYEn0Mt1rrwlJGIpirZQC4iO428519DlO3QC9DnRBqLXGTBhirgoU7-Z2209sy87s49kw6NOC8_Eew6nCLf-pZ883DRPRyAYH7LC8cvRLInud0EdndtUFa4y83TamrA.AT1_ahjrWDrq";
"AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSFctdVnwhKUPPSRxMpNygUNlP8JmGGUdPJSkOUNGzOjDGJ6_IBw0ZIYb2CxiR6SbKR4hMj3np1HXa_Idxv_txLhu62WcUsFQSTBvq7ktym5DNKxqVmIzBnPljNsM8ff9hCKEXq0LTd8VzkHqjVA7-ig_wg7BqJGg7vUMgG1QseyUAjpmY2OaEv9rA8aeBjRrc.AT1_8nZ92i8c";
/**
* Default options for accessing the ArcGIS image tile service.
*
Expand Down
43 changes: 36 additions & 7 deletions packages/engine/Source/Scene/Cesium3DTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1729,28 +1729,57 @@ function createBoxFromTransformedRegion(
}

/**
* Creates a TileBoundingVolume from the given region and transform
* information.
*
* This may either be a TileBoundingRegion or a TileOrientedBoundingBox.
*
* If the given transform is the initial transform, then this will return
* a TileBoundingRegion. This will either be the given result parameter,
* or a new TileBoundingRegion, if the given result parameter was not
* a TileBoundingRegion.
*
* If the given transform deviates from the initial transform, then this
* will return a TileOrientedBoundingBox that was computed by applying
* the given transform to the given region. This will either be the
* given result parameter, or a new TileOrientedBoundingBox, if the given
* result parameter was not a TileOrientedBoundingBox
*
* @private
* @param {Array} region An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height]
* @param {Matrix4} transform
* @param {Matrix4} initialTransform
* @param {TileBoundingVolume} [result]
* @returns {TileBoundingVolume}
* @param {Array} region An array of six numbers that define a bounding
* geographic region in EPSG:4979 coordinates with the order
* [west, south, east, north, minimum height, maximum height]
* @param {Matrix4} transform The current computedTransform of the tile,
* which includes the parent transform (which, in turn, includes the
* modelMatrix of the containing tileset)
* @param {Matrix4} initialTransform The initial transform of the tile,
* before any changes to the modelMatrix of the containing tileset
* @param {TileBoundingVolume} [result] An optional result.
* @returns {TileBoundingVolume} The resulting bounding volume
*/
function createRegion(region, transform, initialTransform, result) {
if (
!Matrix4.equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)
) {
if (result instanceof TileOrientedBoundingBox) {
return createBoxFromTransformedRegion(
region,
transform,
initialTransform,
result,
);
}
return createBoxFromTransformedRegion(
region,
transform,
initialTransform,
result,
undefined,
);
}

const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);

if (defined(result)) {
if (result instanceof TileBoundingRegion) {
result.rectangle = Rectangle.clone(rectangleRegion, result.rectangle);
result.minimumHeight = region[4];
result.maximumHeight = region[5];
Expand Down
Loading

0 comments on commit ac57264

Please sign in to comment.