Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing refinement of mixed empty and non-empty tiles #11843

Merged
merged 8 commits into from Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -6,6 +6,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)

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