hi,
i use multitexture but the result is not i desire, my hud is stack with second texture
here my code :
post render
drawg2d.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
drawg2d.fillRect(0,0,300,30);
drawg2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
drawg2d.setColor(Color.WHITE);
drawg2d.setFont(new Font("Verdana", Font.PLAIN, 20));
drawg2d.drawString("FPS ", 0, 25);
render2D.drawImage(drawIm,0,0,this);
render2D.flush(false);
drawg2d2.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
drawg2d2.fillRect(1024-333,768-151,333,151);
drawg2d2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
render2D.drawImage(drawIm2,1024-333,768-151,this);
render2D.flush(false);
and the multitexture
// load textures
TextureAttributes texAttr1 = new TextureAttributes();
texAttr1.setTextureMode(TextureAttributes.DECAL);
TextureAttributes texAttr2 = new TextureAttributes();
texAttr2.setTextureMode(TextureAttributes.MODULATE);
TextureLoader tex = new TextureLoader(stoneImage, new String("RGB"), this);
if (tex == null)
return null;
stoneTex = tex.getTexture();
tex = new TextureLoader(skyImage, new String("RGB"), this);
if (tex == null)
return null;
skyTex = tex.getTexture();
lightTex = createLightMap();
textureUnitState[0] = new TextureUnitState(stoneTex, texAttr1, null);
textureUnitState[0].setCapability(TextureUnitState.ALLOW_STATE_WRITE);
textureUnitState[1] = new TextureUnitState(lightTex, texAttr2, null);
textureUnitState[1].setCapability(TextureUnitState.ALLOW_STATE_WRITE);
ap.setTextureUnitState(textureUnitState);
http://vandai.info/upload/files/pic1a.JPG
original color in my hud
http://vandai.info/upload/files/pic1b.JPG
my hud is stack with last texture
please help me …