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

Fix tileset traversal #7011

Merged
merged 3 commits into from
Sep 10, 2018
Merged

Fix tileset traversal #7011

merged 3 commits into from
Sep 10, 2018

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Sep 6, 2018

Fixes CesiumGS/3d-tiles#336

There was a skip-lods bug introduced in the recent update to the 3d tiles traversal code.

If the tileset traversal stops at an empty tile it wasn't loading its nearest loaded ancestor, causing nothing to be drawn in the empty space. This becomes really noticeable when using external tilesets where the tile referring to the .json has a different geometric error than the root tile of that external tileset, but can manifest in other situations involving empty tiles.

Until this fix is in, a workaround is to set tileset.skipLevelOfDetails = false.

To do

  • CHANGES and fix tests

@cesium-concierge
Copy link

Thanks for the pull request @lilleyse!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

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.

🌍 🌎 🌏

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 9, 2018

@ggetz can you please review and test?

Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

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

Other than that, the code looks good. Hopefully we hear back in CesiumGS/3d-tiles#336 soon if it fixes the behavior for that tileset.

selectDesiredTile(tileset, tile, frameState);
}
} else {
// Load tiles that are not skipped or can't refine further. In practice roughly half the tiles stay unloaded.
// Select tiles that can't refine further. If the tile doesn't have loaded content it will try to select an ancestor with loaded content instead.
if (!refines) { // eslint-disable-line
if (stoppedRefining) { // eslint-disable-line
Copy link
Contributor

Choose a reason for hiding this comment

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

You can get rid of the comment disabling eslint if you bring this if statement up a block. I don't think it hurts readability at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know this is all minor but I prefer this organization because it's easier to see the how the base traversal and skip traversal operate when they are separated like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have eslint rules for a reason though, adding disable-line because you don't like a rule is kind of a bad precedent. If code needs clarifying, I would indicate that with a comment, not some layout that only makes sense to people who already know the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, made the change and updated the comments to help clarify the code flow.

@lilleyse
Copy link
Contributor Author

@ggetz Updated.

@jbo023
Copy link
Contributor

jbo023 commented Sep 10, 2018

Hi,
we had the same bug and this PR fixes the problem for our datasets.
Thanks

Cesium 1.49
image

Cesium 1.49 with merged pullrequest
image

@lilleyse
Copy link
Contributor Author

Thanks for the confirmation @jbo023, that's good to hear.

@ggetz
Copy link
Contributor

ggetz commented Sep 10, 2018

Thanks @lilleyse and @jbo023 !

@ggetz ggetz merged commit 798ff75 into master Sep 10, 2018
@ggetz ggetz deleted the refinement-fix branch September 10, 2018 19:59
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.

3d-tiles 1.49 loading issue
6 participants