I have the following set up for each of my bullets which are textured quads.
SpaceQuadMesh bullet = new SpaceQuadMesh("bullet"+bulletCount,2, 2, 0 );
AlphaState alpha = DisplaySystem.getDisplaySystem().getRenderer().createAlphaState();
alpha.setBlendEnabled(true);
alpha.setSrcFunction(AlphaState.SB_SRC_ALPHA);
alpha.setDstFunction(AlphaState.DB_ONE);
alpha.setTestEnabled(true);
alpha.setTestFunction(AlphaState.TF_GREATER);
alpha.setEnabled(true);
ZBufferState zState = DisplaySystem.getDisplaySystem().getRenderer().createZBufferState();
zState.setWritable(false);
zState.setEnabled(true);
zState.setFunction(ZBufferState.CF_LEQUAL);
TextureState tState = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
tState.setTexture(
TextureManager.loadTexture(
ShipFireWeaponAction.class.getClassLoader().getResource("jmetest/data/texture/flaresmall.jpg"),
Texture.MM_LINEAR_LINEAR,
Texture.FM_LINEAR)
);
tState.setEnabled(true);
bullet.setLocalTranslation(bulletPosition);
bullet.setModelBound(new BoundingBox());
bullet.updateModelBound();
bullet.setLightCombineMode(LightState.OFF);
bullet.setRenderState(tState);
bullet.setRenderState(alpha);
bullet.setRenderState(zState);
bullet.updateRenderState();
I basically copied this verbatim from the code I use for my particle effects. The particle effects show up no problem but I can't see any bullets. If I don't set the Z-Buffer state then the bullet shows up but not blnded with the background. (You can see the entire quad not just the part with the texture).
Anyone know what magic I'm missing?
Thanks!