Hi,
I try to create an Image out of a ByteBuffer. I can't use the TextureManager direct because the Texture Format is ".ACE" (Microsoft Train Simulator Texture).
I managed to read out the Infos in a ByteBuffer and I tested it directly in OpenGL. It works there so i assume that the ByteBuffer is set up correctly.
But now I like to do the same thing in JME. The first attempt ended in a white Texture and the following to. So I decided to try with a very simple ByteBuffer. Here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| ACETexture ace = new ACETexture(); ACELoader.loadACE(ace, file); ByteBuffer buf = BufferUtils.createByteBuffer(ace.width*ace.height*3);
for(int j=0; j<ace.width*ace.height; j++) { buf.put((byte) 255); buf.put((byte) 0); buf.put((byte) 0); } Image img; img = new Image(Format.RGB16, ace.width, ace.height, buf); img.setData(ace.imageData); Texture tex = new Texture2D(); tex.setMinificationFilter(Texture.MinificationFilter.BilinearNoMipMaps); tex.setMagnificationFilter(Texture.MagnificationFilter.Bilinear); tex.setImage(img); textures_jme.add(tex); |
But when I do it like this, the result is a white plane to. Can anyone tell me, what I'm doing wrong?
Regards
David