three.kt
three.kt copied to clipboard
all textures dissapear when one mesh gets invsible
Currently there's a dirty bug where textured meshes turn black (their texture gets disposed somehow?) when the visibility
of one textured mesh is set to false
:
This is most likely a threekt bug.
I'm currently using the following workaround after setting a mesh to invisible:
(mesh.parent as Scene).children.forEach {
if (it is Mesh) {
val material = it.material
if (material is MeshBasicMaterial) {
material.map?.needsUpdate = true
}
}
}
This will cause all the textures to re-upload, making them visible again.