hasVertexAlpha causes problems when _unIndexed is used directly

Indeed. When a mesh is flagged as transparent, it does not write to the depth buffer when rendering, leading to potential artifacts, depending on your scene and meshes. See https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered for more details.

In your case, the blue cube is rendered first because it is defined first in the vertex data. So, when it is in front of the turquoise cube as in fig 1, the display is wrong because the turquoise cube being rendered second, it overwrites the blue cube (remember that the depth buffer is not written for transparent objects).

You could try to use facet data sorting (see bottom of previous document), but it only works with indexed meshes…

1 Like