Multi texture(texture + transparent texture) = blackness?

Well a little problem which is probably easily fixed, but it got me stuck a bit.



First of all I have this little island:


Texture t = TextureManager.loadTexture(ii.getImage(), Texture.MM_LINEAR, Texture.FM_LINEAR, false);
texture.setTexture(t, 0);
t.setWrap(Texture.WM_ECLAMP_S_ECLAMP_T);
      
block.setRenderState(texture);





And I got this grid:

Texture grid = TextureShare.get().getTexture(0);
texture.setTexture(grid, 0);
grid.setWrap(Texture.WM_ECLAMP_S_ECLAMP_T);
      
AlphaState as = DisplaySystem.getDisplaySystem().getRenderer().createAlphaState();
as.setEnabled(true);
as.setSrcFunction(AlphaState.SB_SRC_ALPHA);
as.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);
as.setBlendEnabled(true);
      
setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
      
block.setRenderState(texture);
block.setRenderState(as);





Now I want to combine those two:

this.copyTextureCoords(0, 1);
       
Texture t = TextureManager.loadTexture(ii.getImage(), Texture.MM_LINEAR, Texture.FM_LINEAR, false);
texture.setTexture(t, 0);
t.setWrap(Texture.WM_ECLAMP_S_ECLAMP_T);
      
Texture grid = TextureShare.get().getTexture(0);
texture.setTexture(grid, 1);
grid.setWrap(Texture.WM_ECLAMP_S_ECLAMP_T);
      
AlphaState as = DisplaySystem.getDisplaySystem().getRenderer().createAlphaState();
as.setEnabled(true);
as.setSrcFunction(AlphaState.SB_SRC_ALPHA);
as.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);
as.setBlendEnabled(true);
      
setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
      
block.setRenderState(texture);
block.setRenderState(as);






Well I don't think I have to explain my problem  :)

You don't use AlphaState to blend two textures when multitexturing a single mesh.  Instead you need to set the textures apply modes.  Based on the alphastate you use to show through the mountain in the grid example, you might first try AM_DECAL on the grid texture.  Otherwise, try AM_COMBINE and play with the setCombineXXX methods.

using AM_DECAL produces the same result (the grid is a png with alpha channel).



The combine methods are not really documented in any way…

They are not documented in jME but are your standard opengl combine settings.