I need prevent add opacities in a complex mesh

Is there a way to apply the same transparency to a mesh even if several faces of the mesh overlap in front of the camera.

In the image, the red boxes have a different transparency, I want the transparency to be the same regardless of the rotation/position of the mesh

  • i tested with material alpha mode.


I would try with a prepass renderer


so only the closest pixels to the camera will be visible. No overdraw.

1 Like

May I ask you if this technique also doubles the drawcalls (like a depth renderer)? What’s the impact on perf?… Just being curious here.

it depends on the number of drawcalls, and the target device. Before checking the perf, make sure it’s valid for fixing the issue. if it’s not, then no need to worry about the perf :slight_smile:

1 Like

I would use the stencil and configure it to not write where the mesh has already written:


I wonder if setting the mesh to use depthPrepass could also solve it

sphere.material.needDepthPrePass = true;

Yes, that can work. Funny that I didn’t think of it as I’m using this a lot in my scene.