three.kt icon indicating copy to clipboard operation
three.kt copied to clipboard

all textures dissapear when one mesh gets invsible

Open Displee opened this issue 3 years ago • 2 comments

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: IIuM5R3MZM

This is most likely a threekt bug.

Displee avatar May 10 '21 22:05 Displee

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.

Displee avatar May 10 '21 22:05 Displee