How can I use render to texture to create two textures, and then apply those two textures in a texturestate onto a quad?
The first one grabs background, (a terrain) the second grabs some quads in various positions around the terrain. I'd like to regenerate the texture without redrawing the terrain. This is for a minimap by the way.
When I attempt to render the second texture, the background is solid black, so my attempt to decal blend them just overwrites the first texture.
tRenderer.render(fakeScene.getChild(0), fakeTex); //render the terrain object to fakeTex
tRenderer.render(fakeScene.getChild(2), fakeTex2); //render the green quad objects to fakeTex2, hopefully without the background
fakeTex2.setApply(Texture.AM_DECAL); //decal type should ignore the alpha=0 pixels
TextureState ts2 = display.getRenderer().createTextureState();
ts2.setEnabled(true);
ts2.setTexture(fakeTex,0);
ts2.setTexture(fakeTex2,1);
miniMapQuad.copyTextureCoords(0, 1);
miniMapQuad.setRenderState(ts2);
I also tried to set the background of tRenderer to 0 alpha,
tRenderer.setBackgroundColor(new ColorRGBA(0,0,0,0f));
thinking that might do the trick, but it still captures solid (0,0,0,1) as the background.
Anyone have any idea what I'm doing wrong?