Objects dissappearing

It is alpha sorting problem you have here.

Alpha blended entities will be sorted based on Z distance of their AABB to camera. It is not reliable way to sort, as it does not takes complexity of geometry in account. But alpha sorting is generally tough question out there.

So one way is to give developer a control over it, and there is few ways.

For example with blue circles you simply want to disable depth test all together. So they always drawn on top of everything else.

With different parts, you need to change drawOrder on meshes, so you could say what order they should be drawn. In most cases that is enough to control it. Make sure camera orientation and order will provide desirable results.
Other thing, is to do more mesh splitting, to clearly separate meshes of different walls for example. So their bounding boxes are more relevant to actually their location so sorting can be better here.

Then with geometry that shall not be sorted, do make sure you disable blending. Only blended geometry will be conflicting with other blended geometry. So in this case clearly your bolts shall not have any blending on them, as they don’t fade.
If you do need to fade, then simply switch the right blending, fade, and then hide or switch back to none blended.

2 Likes