www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: raft on October 01, 2014, 04:46:49 pm

Title: Texture.overrideTexelData
Post by: raft on October 01, 2014, 04:46:49 pm
* I've noticed that, regardless of Texture is using alpha or not, Texture.overrideTexelData requires 4 bytes per pixel. is this intentional?

* Texture.overrideTexelData requires the given ByteBuffer must be direct and in LITTLE_ENDIAN order. however ByteBuffer.wrap(byte[])  returns an indirect BIG_ENDIAN buffer on my windows 8 machine. is this restriction necessary?

note: this post is intentionally on desktop jPCT board
Title: Re: Texture.overrideTexelData
Post by: EgonOlsen on October 01, 2014, 08:51:38 pm
Yes, these 4 bytes/pixel are intentional because that's the format that the textures internally have. Even textures without an alpha channel defined in the file have one.

And yes, the restriction is necessary or otherwise, it won't work. Any other format would force me to convert it on the fly and that's out of the scope of this method.