ByteBuffer to Texture2D ATI problem

Hi,

I have a problem to create an image from bytebuffer. The weird thing is, the code works just fine for my GeForce graphic card but do not work for ATI graphic card.

Texture2D texture = new Texture2D(256, 256, Format.RGBA8);
ByteBuffer byteBuffer =  BufferUtils.createByteBuffer(256 * 256 * 4);
texture.setImage(new Image(Format.RGBA8, 256,
                256, byteBuffer));
texture.setMinFilter(Texture.MinFilter.Trilinear);

After that I fill the bytebuffer with some values.

byteBuffer.put((byte) 164);
this.byteBuffer.put((byte) 206);
this.byteBuffer.put((byte) 255);
this.byteBuffer.put((byte) 255);

That is all. On my Geforce graphic card the resulting Texture is ok but on ATI graphic card is just a dark grey texture.
I tested this issue with two different Geforce and two different ATI graphic cards.

Does anyone has the same problems and can help? There are no errors in log, so it is really difficult to find the root cause.

thx for help!

Are you using jME 3.1 by any chance? Or is this 3.0?

3.0

Can you change the code to this:

ByteBuffer byteBuffer =  BufferUtils.createByteBuffer(256 * 256 * 4);
Image image = new Image(Format.RGBA8, 256, 256, byteBuffer);
Texture2D texture = new Texture2D(image);
texture.setMinFilter(Texture.MinFilter.Trilinear);

The Texture2D(int, int, Format) constructor is intended for framebuffer textures.

1 Like

fuuu…
My mistake. I forgot a config parameter of my game on the other computers. Shame on me!

You can see the result in the lower rigth corner:

anyway…thx!