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

3d Tile mixed refinement not completing, causing face culling #7084

Closed
ghost opened this issue Sep 27, 2018 · 5 comments · Fixed by #7099
Closed

3d Tile mixed refinement not completing, causing face culling #7084

ghost opened this issue Sep 27, 2018 · 5 comments · Fixed by #7099

Comments

@ghost
Copy link

ghost commented Sep 27, 2018

I'm trying out the current master, was previously working well on 1.48 and below. With skip lods turned on I'm finding the parent tile is never disabled even once loading completes. This normally has the culling effect only while loading as detailed in #6415 since the parent and child tiles are mixed.

This is a view from inside an object after tiles are done loading. Everything in the distance on the left half being culled because it intersects with the parent tile (the right side of the object is outside this parent tile and shows through correctly)
cesium_view

Freezing the render to get a top view with bounding boxes on, shows the parent tile in yellow indicating its still refining:
cesiumyellowbounding

This is how it should look, with the red parent tile gone and not causing culling. Interestingly moving the camera around very slightly can get the correct result depending on the direction.
cesium_goodview

@mramato
Copy link
Member

mramato commented Sep 27, 2018

Thanks for the report @Stuv42

@lilleyse any ideas here? Does anyone else know the tile refinement code as well as you that could look at this while you're finishing up the sample PR? This sounds like a regression that we would need to fix before the next release. I'll tag it, but feel free to remove the label once triaged.

@lilleyse
Copy link
Contributor

There's one commit I'd want to try reverting: 4fc6f7e

I haven't been able to trigger this problem in other tilesets yet. @Stuv42 is there a chance you could send over the tileset for testing? My email is sean@cesium.com if you don't want to share it publicly.

@lilleyse
Copy link
Contributor

lilleyse commented Oct 1, 2018

Thanks for sending over the tileset @Stuv42. I opened a fix here: #7099.

@ghost
Copy link
Author

ghost commented Oct 4, 2018

Thanks for the update @lilleyse, it seems to have fixed the issue in 99% of cases. I've found it was still occurring in the spot above and taking a closer look its because some json files have no content, but have children. This is happens here due to small floating artifacts in quadrants that don't have a model at medium detail, but still require a json file for that quadrant since zooming further will bring their children into view.

floating
Floating polygons in our data set (example only, doesn't cause an issue here but easier to see)

lods
The topleft of lod 2 only has a json with no model, but its children can have models as shown in lod 3

@lilleyse
Copy link
Contributor

lilleyse commented Oct 4, 2018

I see why that would be happening. Technically the behavior right now is expected, the external tileset root (empty) meets the screen space error and doesn't traverse to its children, but since it's empty it selects back up. I'll have to recheck what the old traversal did, but to avoid those sorts of issues I'm starting to think empty tiles should always traverse even if they meet screen space error.

Was that section part of the tileset you originally sent over? If not could you send those tiles over too?

I think the fix would be:

    function canTraverse(tileset, tile) {
        if (tile.children.length === 0) {
            return false;
        }
        if (tile.hasTilesetContent) {
            // Traverse external tileset to visit its root tile
            // Don't traverse if the subtree is expired because it will be destroyed
            return !tile.contentExpired;
        }
        return tile._screenSpaceError > tileset._maximumScreenSpaceError;
    }

to

    function canTraverse(tileset, tile) {
        if (tile.children.length === 0) {
            return false;
        }
        if (tile.hasEmptyContent) {
            return true;
        }
        if (tile.hasTilesetContent) {
            // Traverse external tileset to visit its root tile
            // Don't traverse if the subtree is expired because it will be destroyed
            return !tile.contentExpired;
        }
        return tile._screenSpaceError > tileset._maximumScreenSpaceError;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants