We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
DrawNode + Sprite produces drawing artefacts
DrawNode + Sprite produces drawing artefacts
- File Screen Shot 2014-06-17 at 15.22.17.png added
Screenshot without the problem.
For completeness - the DrawNode is used this way
void LHWater::setShapeTriangles(__Array* triangles, const Color4F& c4)
{
_drawNode->clear();
for(int i = 0; i < triangles->count(); i+=3) { LHPointValue* valA = (LHPointValue*)triangles->getObjectAtIndex(i); LHPointValue* valB = (LHPointValue*)triangles->getObjectAtIndex(i+1); LHPointValue* valC = (LHPointValue*)triangles->getObjectAtIndex(i+2); Point pA = valA->getValue(); pA.y = -pA.y; Point pB = valB->getValue(); pB.y = -pB.y; Point pC = valC->getValue(); pC.y = -pC.y; _drawNode->drawTriangle(pA, pB, pC, c4); }
}
Hi,
I'm seeing the same problem. DrawNode is important to us because we want to use it for drawing in-game content - not just debug stuff.
Anyway, I've noticed that commenting out the following in onDraw seems to fix the problem for me, but perhaps at a performance cost? (speaking of which - DrawNode is extremely inefficient for some reason).
// if (Configuration::getInstance()->supportsShareableVAO()) // { // GL::bindVAO(_vao); // } // else
Hi Sheado,
This bug has been posted here for a long time and nobody acknowledge it.
For LevelHelper 2 i ended up creating my own draw node (with texture support). Have a look here
https://github.com/vladubogdan/LevelHelper2-Cocos2d-X.v3
You want to look at LHDrawNode - it should be pretty simple to port in order to use it without the LeveHelper2-API code.
@vladu.bogdan @Sheado I guess another expression of the same bug is here: http://stackoverflow.com/questions/25803344/opengl-rotating-triangles-have-some-bad-effects
- Status changed from New to Closed
Migrate to: https://github.com/cocos2d/cocos2d-x/issues/8144
@vladu.bogdan @Sheado @naghekyan
thank you for your feedback, this problem seems to have already fixed in the newest version, the problem maybe caused by the code in DrawNode's drawTriangle function:
unsigned int vertex_count = 2*3
you should change the code to:
unsigned int vertex_count = 3
Hello everybody,
When using a DrawNode together with multiple sprite frame Sprite drawing has bad artefacts.
Most of the time it will work ok but every once in a while artefacts are present. This looks to me that a pointer is not set to NULL in the constructor and gets garbage data.
A simple DrawNode with no sprites added to the scene will not produce the artefacts.
I want to stress out that this does not always reproduce and the user has to launch the app several times.
This happens in both 3.0 and 3.1.1
I have attached a couple of images showing the problem.
Screen Shot 2014-06-17 at 13.30.27.png (65 kB) vladu_bogdan, 2014-06-17 12:21
Screen Shot 2014-06-17 at 14.04.43.png (87.1 kB) vladu_bogdan, 2014-06-17 12:21
Screen Shot 2014-06-17 at 13.58.25.png (71.2 kB) vladu_bogdan, 2014-06-17 12:21
Screen Shot 2014-06-17 at 14.04.14.png (67.5 kB) vladu_bogdan, 2014-06-17 12:21
Screen Shot 2014-06-17 at 14.04.26.png (84.9 kB) vladu_bogdan, 2014-06-17 12:21
Screen Shot 2014-06-17 at 15.22.17.png (83.9 kB) vladu_bogdan, 2014-06-17 12:23