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.
Spatial treeSpatial = assetManager.loadModel(
Node treeNode = (Node) treeSpatial;
treeNode.setLocalTranslation(new Vector3f(speed, speed, 50));
Geometry leaves = (Geometry) treeNode.getChildren().get(0);
Geometry trunkNode = (Geometry) treeNode.getChildren().get(1);