Sprite border looks like not anti-aliased after rotation or downscaling

Hello,

I have problem with sprite borders, they are looking like they are not anti-aliased when sprite is rotated or scaled. I’m using spritesheets created by TexturePacker Pro 3.2.1

I attached picture, which illustrates what I mean. I put there fragments from game’s screenshots and then 2x scaled the picture to make sure that artifacts is well visible. The main character (zombie) consists of lots of small sprites, like eyebrows, hair, mouth etc. As you may see on pictures 1-3, sprite rotation causes problems on their border. Picture 4 contains some character’s parts (eyebrow, leg, mouth, pupils). As you may see, some sprites are quite small (they are 2x scaled on the example).

I searched the problem and tried several possible solutions, like changing spritesheet settings, setting projection to kCCDirectorProjection2D and setting CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL to 1, but nothing helped.

Is there any way to fix artifacts? Could you suggest what causes this?
When I used separate sprites, without spritesheet, I had no such problem.

Here are my spritesheet settings:
Texture format: pvr.czz Premultiply alpha: true Scale mode: smooth Extrude; border, shape paddings: 2 Inner padding: 0 (tried to change it but nothing happened) Reduce border artifact: false Allow rotation: true Trim mode: trim Trim threshold: 1 Enable auto alias: true Clean transparent pixels: true

Thanks,
Andriy


artifacts.png (174.2 KB)

Hey, did you find any solution for this?
I am having same problem with sprites after down scaling.

i’m also having the same problem.

Unfortunately, I didn’t manage to find a solution and still looking for it :frowning:
There are weird artifacts at the opacity borders (places where opacity is decreasing to zero).
Would be appreciated for any suggestios how to fix a problem.

[UPD] It seems that mipmapping considerably improves a situation

This issues still exists, mipmapping doesn’t help much either. It looks like the anti-aliasing parameters of the Texture2D is ignored.

To remove aliasing from a texture when rotating or scaling down

sprite->getTexture()->generateMipmap();
cocos2d::Texture2D::TexParams texParams = { GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE };
sprite->getTexture()->setTexParameters(texParams);

It helps to solve aliasing but also makes sprite little bit blurry.
How do i make it sharp enough like using with correct file size and scale factor?