I tried to use multi textures, but as soon I add a second texture (paint texture), both textures disappear ?!
PathUtil.locateResource(PathUtil.APPLICATION_DIRECTORY, child.getChild("color").getValue()) --> returns an url path(is working)
public void paintPart(Element child, Node object){
TextureState texture_state = display.getRenderer().createTextureState();
texture_state.setEnabled(true);
Texture baseMap = TextureManager.loadTexture(
PathUtil.locateResource(PathUtil.APPLICATION_DIRECTORY, child.getChild("color").getValue()),
Texture.MinificationFilter.Trilinear, Texture.MagnificationFilter.Bilinear);
//baseMap.setWrap(Texture.WrapMode.Repeat);
//baseMap.setAnisotropicFilterPercent(Cash.ANISOTROPIC);
texture_state.setTexture(baseMap, 0);
if(child.getChild("paint")!= null){
System.out.println("is Loading");
Texture paintMap = TextureManager.loadTexture(
PathUtil.locateResource(PathUtil.APPLICATION_DIRECTORY, child.getChild("paint").getValue()),
Texture.MinificationFilter.Trilinear, Texture.MagnificationFilter.Bilinear);
//paintMap.setWrap(Texture.WrapMode.Repeat);
//paintMap.setAnisotropicFilterPercent(Cash.ANISOTROPIC);
texture_state.setTexture(paintMap, 1);
}
object.setRenderState(texture_state);
/*BlendState alpha = display.getRenderer().createBlendState();
alpha.setBlendEnabled(true);
alpha.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
alpha.setDestinationFunction(BlendState.DestinationFunction.One);
alpha.setTestEnabled(true);
alpha.setTestFunction(BlendState.TestFunction.GreaterThan);
alpha.setEnabled(true);*/
BlendState as = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
as.setBlendEnabled(false);
as.setTestEnabled(true);
as.setTestFunction(BlendState.TestFunction.GreaterThan);
as.setReference(0.5f);
as.setEnabled(true);
object.setRenderState(as);
}