PVRTC files

PVRTC files
0.0 0



I’m using lattest version 2 of cocos-2d-x (downloaded yesterday from github) and I have problems using mipmaps and pvrtc files. I used test app to change the example of scaling pvrtc, to play my files… in this case I work with a pvr.ccz file that uses RGBA8888 format (without incrusted mipmaps) and activating mipmaps it works well. When I work with a pvr.ccz file that uses PVRTC4 format (without incrusted mipmaps) It generates wrong mipmaps (showing a lot of color artifacts and transparency) and it works really bad.

this is the modified code I use:

    auto s = Director::getInstance()->getWinSize();

    auto imgMipMap = Sprite::create("Images/tree.pvr.ccz");
    if( imgMipMap )
        imgMipMap->setPosition(Point( s.width/2.0f-100, s.height/2.0f));

        // support mipmap filtering

    auto img = Sprite::create("Images/tree2.pvr.ccz");
    if( img )
        img->setPosition(Point( s.width/2.0f+100, s.height/2.0f));

        auto scale1 = EaseOut::create(ScaleBy::create(4, 0.01f), 3);
        auto sc_back = scale1->reverse();

        auto scale2 = scale1->clone();
        auto sc_back2 = scale2->reverse();
        imgMipMap->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, NULL)));
        img->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, NULL)));
    log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str());

Do you know which can be the problem? It’s a cocos-2d-x problem?


nobody knows what can be happening with PVRTC4 format images and mipmapping?


it works just fine on ios platform


I tested this right now with a file generated with texturepacker and it doesn’t work for me. the image has premultiply alpha disabled and it has no mipmaps generated.

I have tested this in an Iphone4 with software version 6.1.3

I upload the image for testing purposes …


Making some tests, I can see that In ios 6.1 the mipmaps generated are wrong but openGL doesn’t return errors, but with ios7 the glGenerateMipmap(GL_TEXTURE_2D); returns a 1282 error (invalid operation).

Does somebody understand this?


any ideas???


Hi, what is size of your image?
It seems that in openGL ES2.0, some driver do not support mipmap in NPOT Texture. If you want to generate mipmap, please resize your texture to POT


In this post I have included an example image that fails… its POT and I think is 512x512

I think the NPOT isn’t the problem, because if I use a different PVR format (RGBA8888,…) it generates mipmaps correctly


someone knows?


I have just come across this very same problem that @sp_sergio has reported.
I’m using Cocos2dx v2.2.2 with POT textures published from TexturePacker as .pvr.ccz files with PVRTC4 format. The texture has pre-multiplied alpha. Am testing on iOS 6.1.3.
It appears glGenerateMipmap() doesn’t work for compressed formats. See https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGenerateMipmap.xml
So the solution I reckon is to have TexturePacker generate the mip-map chain…
Does anyone know how to enable this??