()
| 130 | * Call this when loading a new reconstruction. |
| 131 | */ |
| 132 | export function clearFrustumTextureCache(): void { |
| 133 | frustumBitmapCacheGeneration++; |
| 134 | frustumBitmapLoads.clear(); |
| 135 | |
| 136 | // IMPORTANT: Dispose textures BEFORE closing bitmaps to prevent WebGL errors |
| 137 | // When a texture has needsUpdate=true, Three.js will try to upload the bitmap data |
| 138 | // on the next render. If we close the bitmap first, we get "source data detached" errors. |
| 139 | |
| 140 | clearActiveFrustumTextures(activeTextures); |
| 141 | |
| 142 | // Clear high-res selected image texture |
| 143 | clearSelectedImageTextureCache(); |
| 144 | |
| 145 | // NOW safe to close bitmap cache (textures no longer reference them) |
| 146 | clearFrustumBitmapCache(bitmapCache); |
| 147 | notifyFrustumTextureCacheChanged(); |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Pause frustum texture processing (e.g., during camera movement). |
no test coverage detected