diff --git a/src/plugins/three/fade/TilesFadePlugin.js b/src/plugins/three/fade/TilesFadePlugin.js index e39e78fe5..c18c0a131 100644 --- a/src/plugins/three/fade/TilesFadePlugin.js +++ b/src/plugins/three/fade/TilesFadePlugin.js @@ -147,27 +147,22 @@ function onUpdateAfter() { // TODO const scene = t.cached.scene; - if ( ! scene ) { - - return; - - } // if a tile is fading out then it may not be traversed and thus will not have // the frustum flag set correctly. - if ( fadeManager.isFadingOut( t ) ) { - - scene.visible = true; + const isFadingOut = fadeManager.isFadingOut( t ); + if ( scene ) { - } else { + scene.visible = isFadingOut || t.__inFrustum; - if ( scene ) { + } - scene.visible = t.__inFrustum; + this.forEachBatchIds( ( id, batchedMesh, plugin ) => { - } + batchedMesh.setVisibleAt( id, isFadingOut || t.__inFrustum ); + plugin.batchedMesh.setVisibleAt( id, t.__inFrustum ); - } + } ); } );