-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 replacement refinement with empty tiles #3456
Conversation
Thanks @lilleyse, this approach is good with me - and sounds cleaner. @e-andersson do you want to do an initial review? |
Also just a note for reviewing, it's a lot clearer to look at 3cf51b5 alone. |
@@ -367,13 +403,14 @@ define([ | |||
// zoomed into a neighborhood and can cull the skyscrapers in the root node. | |||
// | |||
// Don't select if the tile is being loaded to refine another tile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment can be removed now, doesn't apply anymore
This looks pretty good. No particular comments except for the those two comments above. The approach seems sound, but I haven't tried running it yet. (Will try it, but may not be able to get to it today.) |
Thanks for the reivew, @e-andersson! |
* @type {Array} | ||
* @readonly | ||
*/ | ||
this.descendantsWithContent = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps mention in the comment that this is computed at runtime, not loaded from tileset.json.
Also, as we discussed before, but now that you have more context, would it be useful for tileset.json to have any metadata for this, e.g., number of descendants with content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any metadata would help right now, unless it could link to those descendants directly, which doesn't seem possible.
Do all the tests pass for you in this branch? They don't for me, but the failures are inconsistent. I think it is timing or my machine. |
That's all my comments. |
There were some failing tests that I just fixed, and one or two tests that don't seem related. The |
We should fix these tests before merging. Perhaps instead of using a |
I organized it differently such that |
JSHint fails:
|
Oops. Fixed that. |
Looks good. Will also merge this into the doc branch now. |
Fix replacement refinement with empty tiles
@lilleyse Have you tested this in the viewer with some data, and if so, what data? It seems to me that we're back at the problem where blank space is shown when the tileset content tile is selected and has not yet loaded the json data. Have any other important changes to how the tileset metadata is handled been made? Perhaps I've missed something else, though looking at the spec I think our datasets are compliant. On a side note, it seems the data ( |
For #3241
I tried another approach at solving replacement refinement when empty tiles are involved.
selectTiles
is now back to its original state for the most part. The new idea is to find the descendant tiles as a pre-process inloadTileset
. Then at the end ofselectTiles
the refining tiles check if all their descendant tiles were actually selected this frame. If not, the refining tile is selected and its descendants are deselected. So it's more of a reactive approach, which is actually safer because I noticed some edge cases with the previous approach.The main drawback is in order to "deselect" a tile, I added a boolean in
Cesium3DTile
calledselected
. There's probably a better way to do this, but I was worried that modifying theselectedTiles
array would cause a performance hit.One final thing, I experimented with removing the
tilesetContent
flag because it doesn't serve much of a purpose anymore, except to speed up traversal slightly for those nodes. It works with or without it, but I kept it in for now.