How to keep all mesh faces visible with alpha transparency?

Hi guys,

Greetings everyone!

Is there a way to keep all faces of my mesh being rendered with alpha transparency? I already disabled backface culling, but as you can see in this playground Babylon.js Playground, it is hiding some internal faces depending on the camera angle of view.

Rendering the frontal faces on internal mesh:

image

Not rendering the frontal faces on internal mesh:

image

Is there a way to force rendering all the mesh faces, regardless of the camera angle, if I’m using alpha transparency?

Thanks for helping!!

To me, it looks like you have a z-ordering issue. If each container doesn’t have to be composed of multiple meshes, I’d try merging the meshes to see if that fixes the problem.

https://doc.babylonjs.com/how_to/how_to_merge_meshes#native-babylonjs-function

1 Like

Hi @adam thank you for responsing… unfortunately I need the meshes separated :sweat_smile:

You can try setting the alphaIndex for each mesh.

https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#alpha-index

1 Like

Thanks @adam I’ll try it

It is exactly what separateCullingPass = true; is sorting: Transparency and How Meshes Are Rendered - Babylon.js Documentation

https://www.babylonjs-playground.com/#IXYHWT#1

1 Like

Hi @sebavan thanks for responding! I tried with separateCullingPass, but I had the same issue… as you can see in your playground: https://www.babylonjs-playground.com/#IXYHWT#1

Seeing from top:

image

Seeing from bottom:

image

The frontal faces of the internal mesh is hidden when seeing the scene from the bottom, although these faces come first to the POV, I believe…

Thanks!

could you split the internal mesh as a separate one ? so that you could always render it first solving it all ?

1 Like

@sebavan I think yes, I’ll try splitting these meshes! Thanks bro!!

1 Like