Unwanted transparency

When I click on the wheels they turn green. But there is an element of unwanted transparency there when they overlap by moving the camera after both wheels are clicked to green. I tried adding greenMat.diffuseColor.hasAlpha = false; but this hasn’t helped. I’ve tried other colour types (specular, emissive, ambient) and they haven’t helped either.

https://www.babylonjs-playground.com/#YIU90M#68

Cheers!

There are indeed some faces with transparency. Add this line after creating the greenMat material to disable transparency:

greenMat.alphaMode = BABYLON.Engine.ALPHA_DISABLE;
2 Likes

Awesome, thanks Evgeni.

I had just found greenMat.needDepthPrePass = true; which also worked, I’m assuming your solution would use less resource though.

https://www.babylonjs-playground.com/#YIU90M#69