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

Re-add child frustum check #765

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/base/traverseFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,19 @@ export function markUsedTiles( tile, renderer ) {

// Disabled for now because this will cause otherwise unused children to be added to the lru cache
// if none of the children are in the frustum then this tile shouldn't be displayed
// if ( tile.refine === 'REPLACE' && ! anyChildrenInFrustum && children.length !== 0 ) {
if ( tile.refine === 'REPLACE' && ! anyChildrenInFrustum && children.length !== 0 && ! tile.__hasUnrenderableContent ) {

// tile.__inFrustum = false;
// return;
// TODO: we're not checking tiles with unrenderable content here since external tile sets might look like they're in the frustum,
// load the children, then the children indicate that it's not visible, causing it to be unloaded. Then it will be loaded again.
// The impact when including external tile set roots in the check is more significant but can't be used unless we keep external tile
// sets around even when they're not needed. See issue #741.

// }
// TODO: what if we mark the tile as not in the frustum but we _do_ mark it as used? Then we can stop frustum traversal and at least
// prevent tiles from rendering unless they're needed.
tile.__inFrustum = false;
return;

}

// wait until after the above condition to mark the traversed tile as used or not
markUsed( tile, renderer );
Expand Down
Loading