From e6ca1bf9477ced788163a4f78dd34febf7280100 Mon Sep 17 00:00:00 2001 From: "James Croney (on Framework Laptop)" Date: Thu, 4 Dec 2025 10:18:12 -0500 Subject: [PATCH 1/4] created option disableDynamicMapManager --- .../engine/Source/Scene/Cesium3DTileset.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/engine/Source/Scene/Cesium3DTileset.js b/packages/engine/Source/Scene/Cesium3DTileset.js index 4a72983b483..26ab481489a 100644 --- a/packages/engine/Source/Scene/Cesium3DTileset.js +++ b/packages/engine/Source/Scene/Cesium3DTileset.js @@ -109,6 +109,7 @@ import ImageryLayerCollection from "./ImageryLayerCollection.js"; * @property {Cartesian3} [lightColor] The light color when shading models. When undefined 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. @@ -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 undefined the scene's light color is used instead. @@ -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 () { @@ -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 @@ -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; From 0215ca7a5c161a6ee9b74d97ef475ce23c52b77b Mon Sep 17 00:00:00 2001 From: "James Croney (on Framework Laptop)" Date: Thu, 4 Dec 2025 10:24:35 -0500 Subject: [PATCH 2/4] Adding self to contributors.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7de84032cb0..54b6645e1bb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -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) From 10859bccd623e9aa3ce73f7f1ebc9330a1575565 Mon Sep 17 00:00:00 2001 From: "James Croney (on Framework Laptop)" Date: Thu, 4 Dec 2025 10:33:32 -0500 Subject: [PATCH 3/4] adding changes to change log --- CHANGES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index a066c4bad50..17b5555aa15 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 From e5c62aa84eb3eadec78f0ef54181582a8a554591 Mon Sep 17 00:00:00 2001 From: "James Croney (on Framework Laptop)" Date: Thu, 4 Dec 2025 10:40:27 -0500 Subject: [PATCH 4/4] unit test --- .../engine/Specs/Scene/Cesium3DTilesetSpec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js index e4421659576..80b06bf8665 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js @@ -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(