Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 1.137 - 2025-12-04

### @cesium/engine

#### Additions :tada:

- Added `disableDynamicMapManager` option to `Cesium3DTileset` to conditionally disable dynamic environment map creation for allowing cesium tileset to function with an external renderer. This prevents the requirement to use a WebGL context when invoking Cesium3DTileset.

## 1.136 - 2025-12-01

### @cesium/engine
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Marco Zhan](https://github.com/marcoYxz)
- [Mikhail Porotkin](https://github.com/porotkin)
- [Adam Beili](https://github.com/Beilinson)
- [James Croney](https://jamescroney.com)
21 changes: 14 additions & 7 deletions packages/engine/Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ import ImageryLayerCollection from "./ImageryLayerCollection.js";
* @property {Cartesian3} [lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
* @property {ImageBasedLighting} [imageBasedLighting] The properties for managing image-based lighting for this tileset.
* @property {DynamicEnvironmentMapManager.ConstructorOptions} [environmentMapOptions] The properties for managing dynamic environment maps on this tileset.
* @property {boolean} [disableDynamicMapManager=false] Whether to disable the creation of the dynamic environment map manager. When true, no environment map manager will be created, which can improve performance for tilesets that don't require dynamic environment mapping.
* @property {boolean} [backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
* @property {boolean} [enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.
* @property {boolean} [showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
Expand Down Expand Up @@ -846,9 +847,13 @@ function Cesium3DTileset(options) {
this._shouldDestroyImageBasedLighting = true;
}

this._environmentMapManager = new DynamicEnvironmentMapManager(
options.environmentMapOptions,
);
if (!options.disableDynamicMapManager) {
this._environmentMapManager = new DynamicEnvironmentMapManager(
options.environmentMapOptions,
);
} else {
this._environmentMapManager = undefined;
}

/**
* The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
Expand Down Expand Up @@ -1973,7 +1978,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
* const environmentMapManager = tileset.environmentMapManager;
* environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34");
*
* @type {DynamicEnvironmentMapManager}
* @type {DynamicEnvironmentMapManager|undefined}
*/
environmentMapManager: {
get: function () {
Expand Down Expand Up @@ -3533,10 +3538,12 @@ Cesium3DTileset.prototype.updateForPass = function (

if (passOptions.isRender) {
const environmentMapManager = this._environmentMapManager;
if (defined(this._root)) {
if (defined(environmentMapManager) && defined(this._root)) {
environmentMapManager.position = this.boundingSphere.center;
}
environmentMapManager.update(frameState);
if (defined(environmentMapManager)) {
environmentMapManager.update(frameState);
}
}

// Update clipping polygons
Expand Down Expand Up @@ -3641,7 +3648,7 @@ Cesium3DTileset.prototype.destroy = function () {
}
this._imageBasedLighting = undefined;

if (!this._environmentMapManager.isDestroyed()) {
if (defined(this._environmentMapManager) && !this._environmentMapManager.isDestroyed()) {
this._environmentMapManager.destroy();
}
this._environmentMapManager = undefined;
Expand Down
19 changes: 19 additions & 0 deletions packages/engine/Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,25 @@ describe(
expect(statistics.numberOfCommands).toEqual(0);
});

it("creates environment map manager by default", async function () {
const tileset = await Cesium3DTilesTester.loadTileset(
scene,
tilesetUrl,
);
expect(tileset.environmentMapManager).toBeDefined();
});

it("disables environment map manager when option is true", async function () {
const tileset = await Cesium3DTilesTester.loadTileset(
scene,
tilesetUrl,
{
disableDynamicMapManager: true,
},
);
expect(tileset.environmentMapManager).toBeUndefined();
});

it("additive refinement - selects root when sse is met", function () {
viewRootOnly();
return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(
Expand Down