Set the alpha discard threshold on the Material, I guess.
Are you using an alpha Map? If so you can also try to merge it with the diffuse Map. If not try the opposite
How can I set the alpha threshold for this one? I didn’t use any material as the texture was loaded by the mtl file. I can’t set the texture on the program because the tree came with 3 texture files for its different parts. Thanks in advance!
The material (j3m) should also have BlendMode.Alpha. In code: treeGeo.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
If treeGeo in this case is a Node, it won’t work. You need to apply this to the Geometry
Thanks for the reply. How can I set the blendmode alpha for a spatial? I tried casting it to a geometry but I get an error. It seems that I can’t cast a spatial loaded from a model to a geometry. The problem is I can’t set a material for this tree because the textures are loaded from a dds file.
As an alternative: You also can edit your model over the SDK. You can create material files for your tree and directly add those to your model in the scene composer. Material files have the ending .j3m.
To do so you just have to open your .j3o file / model, click on the leave geometry and add the right material by using the properties window on the right.
I have another problem though. Even though the background of the leaves have become transparent, they seem to affect the shadow cast on the house; they actually remove the shadow cast on the house.Also, I have set the shadow mode of the leaves and the trunk to ShadowMode.Cast but the leaves seem to have some shadows. My light sources are only ambient and directional light.