Objects showing through other objects

I have bullets setup as quads attached to billboards attached to a regular node. Now here's the problem. I have these bullets attached to a main bulletNode that keeps track of all the bullets flying around. I've noticed that if I attach this node after say a ship, the bullets will render in front of the ship always, if I attach the bulletNode before the ship, the bullets will always appear behind the ship. I've tried attaching both to the rootNode, but the bullets still appear in front of the ship no matter their distance. What am I missing?



The bullets have an alpha state as follows:



AlphaState as2 = DisplaySystem.getDisplaySystem().getRenderer().createAlphaState();

as2.setBlendEnabled(true);

as2.setSrcFunction(AlphaState.SB_SRC_ALPHA);

as2.setDstFunction(AlphaState.DB_ONE);

as2.setTestEnabled(true);

as2.setTestFunction(AlphaState.TF_GREATER);

as2.setEnabled(true);



Could the fact that the bullets are somewhat transparent be causing the problem? I'm at a loss. BTW, yes, I have a ZBufferState setup as follows and I'm not setting forceView on the objects in question:



       

        ZBufferState buf = DisplaySystem.getDisplaySystem().getRenderer().createZBufferState();

        buf.setEnabled(true);

        buf.setFunction(ZBufferState.CF_LEQUAL);

        rootNode.setRenderState(buf);



Any help would be greatly appreciated.


Hmmmm, are you putting the bullets in the transparent render queue?



bulletNode.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);

Also try removing the AlphaState just for fun.  If you have a small test case, send that across.

Nope. Not putting it in the transparent render queue and also I did try removing the alphaState and it had the same effect. Not easy to send over a test case, but I'll see what I can do.