Due to app size reduction, have tried to use webP format instead of png images. cwebp by google was used for converting images from png to wepb.
It was working correct when cocos2d-x 3.0alpha0-pre was used.
But in cocos2d-x 3.3 rc0 WebP images have strange artifacts, even when same images are using.
left sprite loads png file, right one - webp image. Some images are displayed with less artifacts, some with more. Problem images have transparency (alpha-chanel). Sprites wasn’t resized or etc. Just create and display.
This problem appears in project on windows (win7), macos 10.10 and on ios simulator (unfortunately is not possible to test it on ios or android devices).
Thanks for reading. All thoughts and suggestions about such problem are welcome.
Here is some more investigation about this problem:
first of all we’ve tried to change images – got simple firefox icon 128x128 (you can get it here http://findicons.com/icon/102069/mozilla_firefox). This image was converted using libwebp-0.4.2-windows-x86 with different params and using online webP converter (cloudconvert.org)
Here is code for testing:
left one is PNG and right one is WebP
Please don’t pay attention about background image shifting, it’s just because different device sizes and orientations.
and results WITH artifacts cocos2d-x v3.3rc0 win32
cocos2d-x v3.3rc0 Mac
cocos2d-x v3.3rc0 iOS sim
results WITHOUT artifacts cocos2d-x v3.0 alpha0-pre Mac
cocos2d-x v3.0 alpha0-pre iOS sim
So… something was definitely changed from cocos2d-x v3.0 alpha0-pre to cocos2d-x v3.3rc0
Unfortunately our skills isn’t good enough to compare Texture2D or Image manually to see where the problem is (on decoding, on rendering or etc.)