-
Notifications
You must be signed in to change notification settings - Fork 3.9k
3d tile traversal fix #13710
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
Open
mzschwartz5
wants to merge
7
commits into
main
Choose a base branch
from
3d-tile-traversal-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
3d tile traversal fix #13710
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
956e788
Fixes bug in 3D tile traversal
mzschwartz5 bbcd600
Changelog entry
mzschwartz5 412aef6
Adds regression spec
mzschwartz5 af1e5d2
Gates traversal changes on vector data extension
mzschwartz5 5b1e84c
Update changelog entry
mzschwartz5 48ca46f
Update test data
mzschwartz5 3d13ce9
Update comment
mzschwartz5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyExternal/external.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "asset": { | ||
| "version": "1.1" | ||
| }, | ||
| "geometricError": 10, | ||
| "root": { | ||
| "boundingVolume": { | ||
| "region": [ | ||
| -1.3197209591796106, | ||
| 0.6988424218, | ||
| -1.3196390408203893, | ||
| 0.6989055782, | ||
| 0, | ||
| 88 | ||
| ] | ||
| }, | ||
| "geometricError": 10, | ||
| "refine": "REPLACE", | ||
| "children": [ | ||
| { | ||
| "boundingVolume": { | ||
| "region": [ | ||
| -1.3197209591796106, | ||
| 0.6988424218, | ||
| -1.3196390408203893, | ||
| 0.6989055782, | ||
| 0, | ||
| 88 | ||
| ] | ||
| }, | ||
| "geometricError": 0, | ||
| "refine": "REPLACE", | ||
| "content": { | ||
| "uri": "ur.b3dm" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
Binary file not shown.
Binary file not shown.
60 changes: 60 additions & 0 deletions
60
Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyExternal/tileset.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| { | ||
| "asset": { | ||
| "version": "1.1" | ||
| }, | ||
| "extensionsUsed": ["3DTILES_content_gltf_vector"], | ||
| "geometricError": 200000, | ||
| "root": { | ||
| "boundingVolume": { | ||
| "region": [ | ||
| -1.3197209591796106, | ||
| 0.6988424218, | ||
| -1.3196390408203893, | ||
| 0.6989055782, | ||
| 0, | ||
| 88 | ||
| ] | ||
| }, | ||
| "geometricError": 100000, | ||
| "refine": "REPLACE", | ||
| "content": { | ||
| "uri": "parent.b3dm" | ||
| }, | ||
| "children": [ | ||
| { | ||
| "boundingVolume": { | ||
| "region": [ | ||
| -1.3197209591796106, | ||
| 0.6988424218, | ||
| -1.3196390408203893, | ||
| 0.6989055782, | ||
| 0, | ||
| 88 | ||
| ] | ||
| }, | ||
| "geometricError": 0, | ||
| "refine": "REPLACE", | ||
| "content": { | ||
| "uri": "ll.b3dm" | ||
| } | ||
| }, | ||
| { | ||
| "boundingVolume": { | ||
| "region": [ | ||
| -1.3197209591796106, | ||
| 0.6988424218, | ||
| -1.3196390408203893, | ||
| 0.6989055782, | ||
| 0, | ||
| 88 | ||
| ] | ||
| }, | ||
| "geometricError": 10, | ||
| "refine": "REPLACE", | ||
| "content": { | ||
| "uri": "external.json" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,6 +247,13 @@ function executeTraversal(root, frameState) { | |
| function executeEmptyTraversal(root, frameState) { | ||
| const { canTraverse, updateTile, loadTile, touchTile } = | ||
| Cesium3DTilesetTraversal; | ||
| // Vector tilesets opt into relaxed empty-tile refinement so empty regions reached | ||
| // through implicit or external placeholders do not block their content siblings. | ||
| // Note: it's likely we don't need to limit this behavior to vector tilesets. However, | ||
| // we are being cautious of breaking changes to existing tilesets. | ||
| const isVectorTileset = root.tileset.hasExtension( | ||
| "3DTILES_content_gltf_vector", | ||
| ); | ||
| let allDescendantsLoaded = true; | ||
| const stack = emptyTraversal.stack; | ||
| stack.push(root); | ||
|
|
@@ -264,9 +271,14 @@ function executeEmptyTraversal(root, frameState) { | |
| // Only traverse if the tile is empty - traversal stops at descendants with content | ||
| const traverse = !tile.hasRenderableContent && canTraverse(tile); | ||
|
|
||
| // 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 | ||
| if (!traverse && !tile.contentAvailable) { | ||
| // For vector tilesets only unloaded renderable content blocks refinement, so an empty | ||
| // tile at its resolved level of detail does not hold back its content siblings, | ||
| // including across implicit or external placeholders. All other tilesets keep the | ||
| // original behavior of blocking whenever traversal stops without content available. | ||
|
Comment on lines
+274
to
+277
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIUC, this is "unconditional refinement" as described in https://github.com/CesiumGS/glTF/tree/3d-tiles-2.0/extensions/2.1/Vendor/3DTILES_tileset#unconditional-refinement. Maybe we should link to this directly for context. |
||
| const blocksRefinement = isVectorTileset | ||
| ? tile.hasRenderableContent | ||
| : !traverse; | ||
| if (blocksRefinement && !tile.contentAvailable) { | ||
| allDescendantsLoaded = false; | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We'll want to confirm and likely extend this behavior to all 3D Tiles 2.0 tilesets, when we have them. Could you open a dedicated issue?