I've looked everywhere and I can't seem to find the answer.

How can I use glTexStorage2D with PVRCT textures? I've done this:


glTexStorage2D(GL_TEXTURE_2D, 1, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, m_uPixelsWide, m_uPixelsHigh );

Where the GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG internal format works for glTexImage2D, but when I run that Tex Storage command, my pvr textures come out black. There are no errors posted, and when I query glGetTexParameteriv, my texture is indeed set to Immutable.

Does PVRCT not work for opengl 3.0?


Have you checked the Opengl ES 3.0 documentation on glTexStorage2D?

According to the docs:

internalformat must be one of the sized internal formats given in Table 1,
or one of the compressed internal formats given in Table 2 below.
Upon success, the value of GL_TEXTURE_IMMUTABLE_FORMAT becomes GL_TRUE.

There is no macro for PVRCT in table 1 or 2.

Also have a look at the Apple documentation on PVRCT compression.

According to the docs, the PVRCT format you've cited is used with the
following two Opengl ES functions:
- glTexImage2D
- glCompressedTexImage2D

Both of these functions are used to specify a two-dimensional texture image.
(where as glTexStorage2D specifies the storage for all levels)

Another note from the Apple documentation:

PVRTC textures must be square. The width/height must be a power of two.

Might be a good idea to check that your textures match this requirement.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.