From c91f28b6be9926e433ddcbeef7ff74e921d7d2ef Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 7 Dec 2021 14:48:40 -0800 Subject: [PATCH] fix remote UI when dropping a new .hdr ibl file - the ibl wasn't updated in internal structures - the previous ibl was leaked --- .../java/com/google/android/filament/gltf/MainActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/samples/sample-gltf-viewer/src/main/java/com/google/android/filament/gltf/MainActivity.kt b/android/samples/sample-gltf-viewer/src/main/java/com/google/android/filament/gltf/MainActivity.kt index 89dd2191eb..c2b00094a4 100644 --- a/android/samples/sample-gltf-viewer/src/main/java/com/google/android/filament/gltf/MainActivity.kt +++ b/android/samples/sample-gltf-viewer/src/main/java/com/google/android/filament/gltf/MainActivity.kt @@ -221,8 +221,13 @@ class MainActivity : Activity() { equirectToCubemap.destroy(); context.destroy(); + // destroy the previous IBl + engine.destroyIndirectLight(modelViewer.scene.indirectLight!!); + engine.destroySkybox(modelViewer.scene.skybox!!); + modelViewer.scene.skybox = sky modelViewer.scene.indirectLight = ibl + viewerContent.indirectLight = ibl } } }