Problem with transparent png and two side planes

I am trying to get transparent masked png textures for a tree. I have set AlphaState for the rootNode and the children too to be sure, but finally i got that the planes are only transparent from certain angles, and only from one direction. I have two sided planes with transparent texture.



as_global = DisplaySystem.getDisplaySystem().getRenderer().createAlphaState();

as_global.setEnabled(true);

as_global.setBlendEnabled(true);

as_global.setSrcFunction(AlphaState.SB_SRC_ALPHA);

as_global.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);

as_global.setReference(0.0f);

as_global.setTestEnabled(true);

as_global.setTestFunction(AlphaState.TF_GEQUAL);

rootNode.setRenderState(as_global);





It's weird, I see blackness around the texture, but on some parts it is really transparent.



Any ideas what might be wrong?



http://bp2.blogger.com/_f57_nB05Gno/RozP_wTVxkI/AAAAAAAAAHk/matmVv6Y4nw/s1600-h/transBUG.JPG

this is the screenshot for the thing, maybe that gives an idea..

It seems that this is problem with how my scenario is built up. All nodes are added to the rootNode, and it seems that the order counts. If one node is added earlier, it wont fade through the later added object… What exactly is to be done to have all other objects to fade through? Is there a single trick which I miss?

as_global.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);



changed to



as_global.setDstFunction(AlphaState.SB_ONE_MINUS_SRC_ALPHA); (SB instead of DB)



solved the problem!!!

Non, it was not that one,

the solution was:



as_global.setTestFunction(AlphaState.TF_GREATER);  not GEQUAL

great you already solved it yourself  (just wanted to reply, as you were the only one posting in this thread so far :))