From 99d80ad42740c5e8c745a0254a96b5491bfe6843 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Mon, 25 Dec 2023 12:47:11 +0900 Subject: [PATCH] Ensure tiles outside the visible area are not visible / rendered on a frame --- example/src/FadeTilesRenderer.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/example/src/FadeTilesRenderer.js b/example/src/FadeTilesRenderer.js index 8bc7495ff..7746c1606 100644 --- a/example/src/FadeTilesRenderer.js +++ b/example/src/FadeTilesRenderer.js @@ -4,6 +4,8 @@ import { FadeManager } from './FadeManager.js'; function onTileVisibilityChange( scene, tile, visible ) { + scene.visible = true; + if ( ! visible ) { this._fadeGroup.add( scene ); @@ -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; + + } ); + + } }