Re: PVRTC textures in JOGL2?
Posted by
Sven Gothel on
Oct 17, 2013; 9:14pm
URL: https://forum.jogamp.org/PVRTC-textures-in-JOGL2-tp4030250p4030297.html
On 10/16/2013 03:04 PM, asambol [via jogamp] wrote:
> Here's what I tried:
>
> public class PVRTCTextureProvider implements TextureProvider {
>
> @Override
> public TextureData newTextureData(GLProfile glp, File file,
> int internalFormat, int pixelFormat, boolean mipmap,
> String fileSuffix) throws IOException {
>
> boolean compressed = true;
> mipmap = false;
> boolean mustFlipVertically = false;
> Flusher flusher = null;
> // internalFormat = 0x8C02; // GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
> internalFormat = 0x9138; // GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG
> pixelFormat = GL.GL_RGBA;
> int pixelType = GL.GL_UNSIGNED_BYTE;
> int border = 0;
> int width = 512;
> int height = 512;
>
> if (!fileSuffix.equals("pvr")) {
> return null;
> }
> ByteBuffer buffer = getBytesFromFile(file); // file as bytes
> TextureData textureData = new TextureData(glp, internalFormat, width, height, border, pixelFormat, pixelType, mipmap, compressed, mustFlipVertically, buffer, flusher);
> return textureData;
> }
> ...
> }
>
>
> However, it doesn't work. I have tried all possible combinations for
> pixelType, pixelFormat and internalFormat.
>
> On non PowerVR I get transparent object, on PowerVR hardware I get black square.
>
> I guess the problem is that the PVRTC format is compressed 4bpp, and I'm using
> GL_UNSIGNED_BYTE. I also tried PVR RGBA8888 uncompressed format with no success.
>
Never tried .. hmm, but I have a PVR here to test.
Shouldn't there be a simple demo from them ?
If you like to add a bug report for this one .. and attach a simple
test application (or better unit test git pull req.) .. we can work
on this ..
> Any hints?
Haven't dealed w/ this format yet.
I agree .. might has something to do w/ the data format .. hmm
~Sven