I’m trying to place a minecraft like door and the windows are showing as grey and not transparent. The mesh is custom and programmatically generated. I have included the code for my mesh and the material.
public class BlockChunk_Material extends Material{
public BlockChunk_Material(AssetManager assetManager, String blockTextureFilePath){
super(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
Texture texture = assetManager.loadTexture(blockTextureFilePath);
texture.setMagFilter(Texture.MagFilter.Nearest);
texture.setMinFilter(Texture.MinFilter.NearestNoMipMaps);
setTexture("ColorMap", texture);
getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
}
}
private static Mesh generateMesh(){
Mesh mesh = new Mesh();
mesh.setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(positions));
mesh.setBuffer(Type.Index, 1, BufferUtils.createShortBuffer(indices));
mesh.setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(normals));
mesh.setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(textureCoordinates));
mesh.updateBound();
return mesh;
}
When generating the geometry there is an opaque and transparent version.
Any help is appreciated.