Skip to content

Commit

Permalink
Merge pull request #11843 from CesiumGS/empty-refinement
Browse files Browse the repository at this point in the history
Fixing refinement of mixed empty and non-empty tiles
  • Loading branch information
ggetz committed Feb 23, 2024
2 parents 8ed89db + b4615ec commit 1d0bf7b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js
Expand Up @@ -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;
}

Expand All @@ -295,7 +293,7 @@ function executeEmptyTraversal(root, frameState) {
}
}

return allDescendantsLoaded;
return root.hasEmptyContent || allDescendantsLoaded;
}

export default Cesium3DTilesetBaseTraversal;
24 changes: 0 additions & 24 deletions packages/engine/Specs/Scene/Cesium3DTilesetSpec.js
Expand Up @@ -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
//
Expand All @@ -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(
Expand Down

0 comments on commit 1d0bf7b

Please sign in to comment.