Hi!
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:
TextureDemo::onEnter();
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));
addChild(imgMipMap);
// support mipmap filtering
imgMipMap->getTexture()->generateMipmap();
Texture2D::TexParams texParams = { GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE };
imgMipMap->getTexture()->setTexParameters(texParams);
}
auto img = Sprite::create("Images/tree2.pvr.ccz");
if( img )
{
img->setPosition(Point( s.width/2.0f+100, s.height/2.0f));
addChild(img);
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?