# Libgdx opacity partial error

My model must support transfer textures but I can't do this using mesh + modelBuilder.part

Opacity is tested correctly on only half of the model.

BlendingAttribute blendingAttribute = new BlendingAttribute();
blendingAttribute.opacity = 1.0f;

modelBuilder = new ModelBuilder();
modelBuilder.begin();
modelInstance = new ModelInstance(modelBuilder.end());

• It looks like you should show us the relevant code to reproduce this problem. – DMGregory Jun 22 '20 at 20:44
• Really .. sorry I went down – Yuu Jun 22 '20 at 21:42
• Looks like you're using alpha blending, without disabling z writes. You more likely want to use alpha testing, so that you abort the transparent fragments before they write to the depth buffer and block the next quad from drawing there. – DMGregory Jun 22 '20 at 21:45
• Yes, the minecraft oak tree should be composed of two planes with transparent pixels – Yuu Jun 22 '20 at 21:49
• I found the solution in a badlogic forum. modelInstance.materials.get(0).set(FloatAttribute.createAlphaTest(0.95f)); – Yuu Jun 23 '20 at 2:42

modelBuilder.part("minecraft:loading_model", mesh, 4, new Material(TextureAttribute.createDiffuse(atlas), blendingAttribute, FloatAttribute.createAlphaTest(0.95f)));

modelInstance.materials.get(0).set(FloatAttribute.createAlphaTest(0.95f));