Skip to content

Commit

Permalink
Re-add child frustum check (#765)
Browse files Browse the repository at this point in the history
* Re add frustum test

* Add TODO
  • Loading branch information
gkjohnson committed Sep 29, 2024
1 parent 1d43b20 commit 695eb69
Showing 1 changed file with 11 additions and 4 deletions.
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

0 comments on commit 695eb69

Please sign in to comment.