Symptom: mesh invisible even though enabled and visible. Mesh.renderingGroupId is increased. It is not backface culling. Bounding box renders fine. Using “BackgroundMaterial”.
Solution: Material.opacityFresnel = false
Sorry for the terribly vague description but I can’t even reproduce this potential bug reliably in my local project.
I use “cover plates” to indicate whether a wall or an obstacle gives an actor full or only half cover. There are four plates on a tile I switch on or off depending on cover in that direction. I use two BackgroundMaterials (for full cover and half cover) and re-assign on demand. Here is the setup I use: Babylon.js Playground (the playground does NOT reproduce the bug).
Sometimes cover plates become invisible even though they are enabled. So far switching materials is required for the potential bug to occur. But after that I do not know: I randomly move the mouse from cover the cover until it happens. To get the cover plate visible again, I need to move the mouse randomly again AND need to rotate the camera.
Its noteworthy that if you rotate the invisble plate so that its frontface starts looking into the sky, while it rotates, it is fading from invisible to fully visible.
Anyway, thanks to the Inspector, it seems if you set Material.opacityFresnel to false (or Inspector->Material->Rendering->Opacity fresnel), it fixes the potential bug.
Took me a while to figure this out because initially I though the plate was still visible and just rendered inside the obstacle. Hope this post saves someone some time