From 8ebc082f0fbe7ce2886473304e62c654fb9f6ede Mon Sep 17 00:00:00 2001 From: WilliamLiu-1997 <77861330+WilliamLiu-1997@users.noreply.github.com> Date: Sat, 11 Apr 2026 13:55:49 +1000 Subject: [PATCH 1/2] clear children after dispose in imageFormatPlugin --- src/three/plugins/images/ImageFormatPlugin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/three/plugins/images/ImageFormatPlugin.js b/src/three/plugins/images/ImageFormatPlugin.js index 2f24669be..1efff7bd0 100644 --- a/src/three/plugins/images/ImageFormatPlugin.js +++ b/src/three/plugins/images/ImageFormatPlugin.js @@ -173,6 +173,8 @@ export class ImageFormatPlugin { } + tile.children.length = 0; + } // Local functions From 2b4b2d15f5cbf6cccc8338e2144cbf32d0ea785f Mon Sep 17 00:00:00 2001 From: WilliamLiu-1997 <77861330+WilliamLiu-1997@users.noreply.github.com> Date: Mon, 13 Apr 2026 00:21:34 +1000 Subject: [PATCH 2/2] Fix ImageFormatPlugin child lifecycle on tile reload --- src/three/plugins/images/ImageFormatPlugin.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/three/plugins/images/ImageFormatPlugin.js b/src/three/plugins/images/ImageFormatPlugin.js index 1efff7bd0..0b6308f88 100644 --- a/src/three/plugins/images/ImageFormatPlugin.js +++ b/src/three/plugins/images/ImageFormatPlugin.js @@ -142,22 +142,16 @@ export class ImageFormatPlugin { } - return mesh; - - } - - preprocessNode( tile ) { - - // generate children - const { tiling } = this; - const maxLevel = tiling.maxLevel; - const level = tile[ TILE_LEVEL ]; - if ( level < maxLevel && tile.parent !== null ) { + // Only expose descendants while the tile content is resident so unload can clear the + // branch and a later reload will recreate it symmetrically. + if ( level < tiling.maxLevel && tile.children.length === 0 ) { this.expandChildren( tile ); } + return mesh; + } disposeTile( tile ) { @@ -173,6 +167,12 @@ export class ImageFormatPlugin { } + + tile.children.forEach( child => { + + this.tiles.processNodeQueue.remove( child ); + + } ); tile.children.length = 0; }