We are trying to make something like XTrans (more or less) and we paint component in BufferedImage we then want to display
as textures on a GLCanvas. We use the Texture / TextureIO objects but we have very different performances according to the
BufferedImage type (we have it on MacOSx and windows on 3 different computers). With a TYPE_3BYTE_BGR we have something
incredibly fast (75 frames per seconds and more) but as soon as we add the alpha channel to have transparent BufferedImage
(for instance TYPE_4BYTE_ABGR ), performances fall to 15fps. What we do is very simple :
BufferedImage frimg = fr.getFrontImage();
TextureData frTextureData = TextureIO.newTextureData(frimg, false);
frtex[i].updateImage(frTextureData);
TextureCoords coords2 = frtex[i].getImageTexCoords();
frtex[i].enable();
frtex[i].bind();
gl.glBegin(GL.GL_QUADS);
gl.glTexCoord2f(coords2.right(), coords2.top());
gl.glVertex2i(0, 0);
gl.glTexCoord2f(coords2.left(), coords2.top());
gl.glVertex2i(fr.getWidth(), 0);
gl.glTexCoord2f(coords2.left(), coords2.bottom());
gl.glVertex2i(fr.getWidth(), fr.getHeight());
gl.glTexCoord2f(coords2.right(), coords2.bottom());
gl.glVertex2i(0, fr.getHeight());
gl.glEnd();
does somenone has an idea why alpha channel slow the update process so much ? can we do something ?
Fred