glTF model transparent

When working with the export format gltf to do on the model transparency using the texture in a photo png.

Attached all the sources below, the tree in place of branches displays a black plane with a photo png, how to make the black plane transparent?


end result what i want

Try to set Material.alphaTest to a value of maybe 0.5 and see if the result is okay for you.

gltf.scene.traverse( function ( child ) {

    if ( child.isMesh ) { 

        child.material.alphaTest = 0.5;


}  );

In this way the model is not transparent. Instead you just discard the transparent parts of a texture. This effect is called “alpha cutout” and often used for rendering vegetation or hair.