cc.Drawnode flicker when moving slowly

Environment :

cocos2d-x 3.14.1
cocos2d-x 3.15
Mac OSX 10.11.1
Version 57.0.2987.133 (64-bit)

How to reproduce the issue :

  1. Simply draw a segment in the scene
var draw = new cc.DrawNode();
draw.drawSegment(cc.p(200, 200), cc.p(200, 400), 1, cc.color.YELLOW);
this.addChild(draw);
  1. Move it use a cc.MoveBy action
draw.runAction(cc.MoveBy.create(2.0, cc.p(400, 0)));

When moving at a fast speed the issue won’t be that obviously.

  1. Change the speed to a lower one:
draw.runAction(cc.MoveBy.create(100.0, cc.p(400, 0)));

Now the flicker happens :

I tried the cc.DrawNode + cc.RenderTexture solution which fixed the issue but I would like to know how to fix it without using cc.RenderTexture.

I searched on the forum and find some posts on flicker issues and tried the setDepthTest as well but in vain.

Any suggestion will be appreciated, thanks :slight_smile:

1 Like

Does it flicker if you make it 2 px wide? or 4? Curious if it’s some sort of off-pixel coordinate aliasing issue.

I tried with 0.5, 2, 4, 8 and the same result …