ImageGraphics vs. Textures

Hi,

i'm developing a 3d gui and i've finished with the basic stuff…

I use an ImageGraphics to render my gui on a 3d QUAD. The problem is, that

updating the image needs more than 30 ms… I use semi transparent bufferedimages

as background…



Could it be faster if i use for each window a texture and render these textures via multitexturing

on a single quad ? I think it could be possible to render my gui window to a texture once and translate

the texture only…



GReetings,



Chris



PS: The program runs without a frame limiter… without updating it runs with more tha 2,4k frames…

ok, i've tried multitexturing to speed up the gui…

But i've got another question:



I have two RGB images without an alpha channel. How can i render both textures on a quad ?



I tried this code, but the second image has a black background… When i use a png with an transparent alpha channel as second image, the first image is visible…


            //set up a basic box
            box = new Quad("Box", 10, 10);
            box.setModelBound(new BoundingSphere());
            box.updateModelBound();
           
            //Util.makeTransparent(box);
            box.copyTextureCoordinates(0, 1, 1);

            //Set up a texture coordinates buffer for the second unit
            rootNode.attachChild(box);

            TextureState ts = display.getRenderer().createTextureState();
            Texture t1 = TextureManager.loadTexture(new URL("file:res/startup.png"),
                Texture.MinificationFilter.BilinearNoMipMaps,
                Texture.MagnificationFilter.Bilinear);

            //put it in the first unit
            ts.setTexture(t1, 0);
           
            Texture t2 = TextureManager.loadTexture(new URL("file:res/parkett.jpg"),
                Texture.MinificationFilter.BilinearNoMipMaps,
                Texture.MagnificationFilter.Bilinear);
           
            t2.setApply(Texture.ApplyMode.Decal);
            t2.setWrap(Texture.WrapMode.BorderClamp);
            t2.setTranslation(new Vector3f(-0.5f, -0.5f, 0));
            t2.setScale(new Vector3f(2, 2, 0));
            //place in the second unit.
            ts.setTexture(t2, 1);
           

            box.setRenderState(ts);
            box.updateRenderState();



How can i make the first texture visible ?

You want to draw 2 Textures on a Quad without an alpha channel.

I guess you still want to have some part of one of the textures transparent?



Did you check out jmetest.renderer.TestMultitexture ?