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

External tileset traversal fix #7035

Merged
merged 4 commits into from
Sep 14, 2018
Merged

External tileset traversal fix #7035

merged 4 commits into from
Sep 14, 2018

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Sep 12, 2018

I was starting to notice a common theme from here, here, and here where external tilesets would not refine to their root tile in the same way that they did pre traversal refactor.

In certain cases the traversal would stop at the external tileset and not move along to the tileset's root tile.

|----Tile (b3dm) - traverse
|--------Tile (json) - SSE too small so don't traverse
|------------Root (b3dm) - never visited

This isn't really the correct thing to do. If a tile refines to an external tileset tile we would expect it to refine to the external tileset's root instead of stopping early. The fix is to always traverse to the external tileset root and in general use the SSE of the external tileset root's parent instead of itself.

The linked issues should now work as they did pre traversal. This does not fix the main problem in #7007. I'm not sure if this fixes #7026, as that may just be a duplicate of #7007.

@ggetz can you review?

@cesium-concierge
Copy link

Thanks for the pull request @lilleyse!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@lilleyse
Copy link
Contributor Author

Also opened CesiumGS/3d-tiles-validator#154 with the tileset updates.

@@ -438,6 +438,18 @@ define([
return tile._screenSpaceError > baseScreenSpaceError;
}

function canTraverse(tileset, tile) {
if (tile.children.length === 0) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the consensus from #7007 is not to throw a warning, correct?

It seems like it would be fairly trivial to include here with a one-time warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we should wait and see if it comes up again. But agreed it should be easy to add if we decide to.

@@ -307,7 +307,7 @@ define([

// Use parent's geometric error with child's box to see if the tile already meet the SSE
var parent = tile.parent;
if (defined(parent) && (parent.refine === Cesium3DTileRefine.ADD) && getScreenSpaceError(tileset, parent.geometricError, tile, frameState) <= tileset._maximumScreenSpaceError) {
if (defined(parent) && !parent.hasTilesetContent && (parent.refine === Cesium3DTileRefine.ADD) && getScreenSpaceError(tileset, parent.geometricError, tile, frameState) <= tileset._maximumScreenSpaceError) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is getting a bit unwieldy. Can we account for this in updateVisibility? Or if not just pull out

getScreenSpaceError(tileset, parent.geometricError, tile, frameState)
or
getScreenSpaceError(tileset, parent.geometricError, tile, frameState) <= tileset._maximumScreenSpaceError

into its own var?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to its own function.

Unfortunately it can't be handled in updateVisibility because it shouldn't get run when checking children visibility for the cull-with-children-bounds optimization.

@lilleyse
Copy link
Contributor Author

@ggetz Updated.

@ggetz
Copy link
Contributor

ggetz commented Sep 14, 2018

Looks good! Thanks @lilleyse!

@ggetz ggetz merged commit 32c7098 into master Sep 14, 2018
@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/d/msg/cesium-dev/DBbw-uHNY2k/jmZn9cl-BwAJ

If this issue affects any of these threads, please post a comment like the following:

The issue at #7035 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@ggetz ggetz deleted the force-traversal-external branch September 14, 2018 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot replace the parent level tiles with the children level tiles
3 participants