Skip to content

Commit

Permalink
Ensure tiles outside the visible area are not visible / rendered on a…
Browse files Browse the repository at this point in the history
… frame
  • Loading branch information
gkjohnson committed Dec 25, 2023
1 parent aa07425 commit 99d80ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions example/src/FadeTilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { FadeManager } from './FadeManager.js';

function onTileVisibilityChange( scene, tile, visible ) {

scene.visible = true;

if ( ! visible ) {

this._fadeGroup.add( scene );
Expand Down Expand Up @@ -103,6 +105,19 @@ export const FadeTilesRendererMixin = base => class extends base {

super.update( ...args );
this._fadeManager.update();
this.displayActiveTiles = displayActiveTiles;

if ( ! displayActiveTiles ) {

// update the visibility of tiles based on visibility since we must use
// the active tiles for rendering fade
this.visibleTiles.forEach( t => {

t.cached.scene.visible = t.__inFrustum;

} );

}

}

Expand Down

0 comments on commit 99d80ad

Please sign in to comment.