CCClippingNode pixelated borders

Hi everyone, I’m experiencing some issues while using CCClippingNode. The problem is that when a texture is used as a stencil, the borders where the image is clipping are looking blurry/pixelated. Please take a look at the attached image


What I’m doing is using the white image, as the stencil. Here’s how it looks in code

CCSprite whiteSprite = CCSprite::create;
CCSprite
stencil = CCSprite::create(“path/to/white.png”);
stencil~~>setScale;
stencil~~>setVisible(true);
mClippingNode~~>setStencil;
mClippingNode~~>addChild(stencil);
mClippingNode->addChild(whiteSprite);

Is this wrong? Sorry, I’m following the code examples of Cocos2d-x since there are not much examples on CCClippingNode usage.

Could you show / simulate the desired result? Also you could try setting

mClippingNode->setAlphaThreshold(0.05f);

Just experiment a little with the values there and see if it helps/changes anything.

Hi, attached the image of the problem. As you can see the borders are jagged and it occurs only on the part where clipping is done. I already tried mClippingNode->setAlphaThreshold(0.05f); it makes no difference. The expected results would be the white part to be a perfect circle clipping the green part that goes below.

Perhaps something related to the OpenGL procedures? , I already corrected a bug on Cocos2d-x from the Cocos2d code in order for clipping to work correctly (http://hyponymo.us/cocos2d-quirks/)

Hi, I am on cocosdx 3.10 and am facing the exact same issue. Does anyone have a solution?