diff --git a/CHANGES.md b/CHANGES.md index c123ea1c5bca..54174ef97539 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ ##### Fixes :wrench: +- Fixed a bug with where a mix of empty and non-empty tiles were not refining. [#9356](https://github.com/CesiumGS/cesium/issues/9356) - Fixed a bug affecting voxel shader compilation in WebGL1 contexts. [#11798](https://github.com/CesiumGS/cesium/pull/11798) - Fixed a bug where legacy B3DM files that contained glTF 1.0 data that used a `CONSTANT` technique in the `KHR_material_common` extension and only defined ambient- or emissive textures (but no diffuse textures) showed up without any texture [#11825](https://github.com/CesiumGS/cesium/pull/11825) - Fixed an error when the `screenSpaceEventHandler` was destroyed before `Viewer` [#10576](https://github.com/CesiumGS/cesium/issues/10576) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e51dcd1f33b1..8850724dfca6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -163,6 +163,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu - [Mark Dane](https://github.com/angrycat9000) - [jjspace](https://github.com/jjspace) - [Siddhesh Ranade](https://github.com/siddheshranade) + - [Adam Morris](https://github.com/weegeekps) - [Northrop Grumman](http://www.northropgrumman.com) - [Joseph Stein](https://github.com/nahgrin) - [EOX IT Services GmbH](https://eox.at) diff --git a/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js b/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js index df773afbcc11..a3a012d04fae 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js @@ -271,12 +271,10 @@ function executeEmptyTraversal(root, frameState) { // Only traverse if the tile is empty - traversal stops at descendants with content const traverse = !tile.hasRenderableContent && canTraverse(tile); - const emptyLeaf = !tile.hasRenderableContent && tile.children.length === 0; // Traversal stops but the tile does not have content yet // There will be holes if the parent tries to refine to its children, so don't refine - // One exception: a parent may refine even if one of its descendants is an empty leaf - if (!traverse && !tile.contentAvailable && !emptyLeaf) { + if (!traverse && !tile.contentAvailable) { allDescendantsLoaded = false; } @@ -295,7 +293,7 @@ function executeEmptyTraversal(root, frameState) { } } - return allDescendantsLoaded; + return root.hasEmptyContent || allDescendantsLoaded; } export default Cesium3DTilesetBaseTraversal; diff --git a/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js b/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js index 2fddd5b7a6cb..8f5d0c3d7a07 100644 --- a/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js +++ b/packages/engine/Specs/Scene/Cesium3DTilesetSpec.js @@ -1335,29 +1335,6 @@ describe( }); }); - it("replacement refinement - selects upwards when traversal stops at empty tile", function () { - // No children have content, but all grandchildren have content - // - // C - // E E - // C C C C - // - return Cesium3DTilesTester.loadTileset( - scene, - tilesetReplacement1Url - ).then(function (tileset) { - tileset.root.geometricError = 90; - setZoom(80); - scene.renderForSpecs(); - - const statistics = tileset._statistics; - expect(statistics.selected).toEqual(1); - expect(statistics.visited).toEqual(3); - expect(isSelected(tileset, tileset.root)).toBe(true); - return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }); - }); - it("replacement refinement - selects root when sse is not met and subtree is not refinable (1)", function () { // No children have content, but all grandchildren have content // @@ -1379,7 +1356,6 @@ describe( // Even though root's children are loaded, the grandchildren need to be loaded before it becomes refinable expect(numberOfChildrenWithoutContent(root)).toEqual(0); // Children are loaded - expect(statistics.numberOfCommands).toEqual(1); // No stencil or backface commands; no mixed content expect(statistics.numberOfPendingRequests).toEqual(4); // Loading grandchildren return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then(