Hi,
I am loading a GLTF but iPhones are having a very bad time with transparencies on both Safari & Chrome, with massive FPS drops and can even crash the both browsers after a time… So I thought I would traverse the mesh and then remove it by uuid or name from the blender mesh name.
However I can get it to remove from view but the object still exists on the var that stores the GLTF and scene.children groups still has it in there also.
How do I delete it from view, reference, render, memory? How do I get rid of it so that three doesn’t even know it existed?
I can’t use visibility, it still crashes safari and chrome on iphones.
this.meshes.gallery.traverse(mesh => {
if (mesh.isMesh) {
let lcMeshName = mesh.name.toLowerCase();
// log(`lcMeshName: ${lcMeshName}`);
if (mesh.name === "Glass_NO_IPHONE") {
console.warn("FOUND")// Finds it
mesh.visible = false; // Hides from view but crashes still on iphone
// BELOW DOES NOTHING
mesh.geometry.dispose();
mesh.material.dispose();
this.scene.remove(mesh)
this.renderer.renderLists.dispose();
// log(mesh.parent)
}
}
//
})
this.logMeshNames(this.meshes.gallery); // Still find mesh with name removed
log(this.scene) // still find mesh in drill down in console
Any ideas?
Also any ideas how I can advise the designer to build better windows that are more optimised for three? I don’t have this problem in babylon.