Problems using PVRTC on an N95 8GB

This topic contains 5 replies, has 2 voices, and was last updated by  Lichtens 9 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29559

    Lichtens
    Member

    Hallo,

    I’m trying to use PVRTC Textures on an N95 8GB Device. Everything is going fine until the moment, when I try to upload the texture to the opengl server side. Trying to upload the texture data with glCompressedTexImage2D gives me gl error GL_INVALID_ENUM for the texture format: GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG defined with value 0x8C01.

    Checking for the extension says, that the pvrtc extension is available on the device.

    Can you tell me what is happening here?

    Best regards,

    Andi

    #32220

    Lichtens
    Member

    Hi,

    i was wrong. The gl error thrown is GL_INVALID_VALUE not GL_INVALID_ENUM. I found out, that this error is allways thrown, when the PVRTC Texture includes mipmaps. Without mipmaps everything is going fine.

    The Textures are generated with sdk command line tool. Any idea, whats going wrong here?

    Regards, Andi

    #32221

    Xmas
    Member

    What parameters are you passing to glCompressedTexImage2D exactly?

    #32222

    Lichtens
    Member

    Nearly all parameters come from the texture header:

    glCompressedTexImage2D(GL_TEXTURE_2D, levels, format, width, height, 0, size, data);

    levels: in actuall test texture == 6

    format: GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG or               GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG ( it is not working with both formats )

    width and height == 64

    size: dont know exactly, but it is the texture data length field from header

    data: texture data without header

    Any idea, Xmas?

    Best regards,

    Andi

    #32223

    Xmas
    Member

    You have to load each mipmap level individually, with the level parameter going from 0 to 5. It’s slightly complicated by the fact that PVRTC has a minimum size of 8×8 for PVRTC4 and 16×8 for PVRTC2 for the purpose of calculating the data size. This does not affect the width and height parameters.

    I’d recommend using the PVRTools library from our SDK to load PVR files. If you want to see what the library does have a look at the function PVRTLoadPartialTextureFromPointer in ToolsOGLESPVRTTextureAPI.cpp.

    #32224

    Lichtens
    Member

    I had a look in this library before, but I didn’t saw these information in there. So I’ll dig in a bit deeper.

    Thank you very much for this information!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.