jpoag identified the issue. The problem is called "z-fighting". You need to modify SkeletonRenderer to offset each attachment that is being rendered slightly on the z-axis.
In each iteration of this loop, one attachment is rendered: spine-runtimes/SkeletonRenderer.cpp at master
The z-coordinate for each attachment is set to 0 by default. You need to modify this loop within the outer loop to set the vertex.z position to something else spine-runtimes/SkeletonRenderer.cpp at master
Pseudo code:
float depthOffset = 0;
for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) {
...
for (int v = 0, w = 0, vn = attachmentVertices->_triangles->vertCount; v < vn; ++v, w += 2) {
V3F_C4B_T2F* vertex = attachmentVertices->_triangles->verts + v;
vertex->vertices.x = _worldVertices[w];
vertex->vertices.y = _worldVertices[w + 1];
vertex->vertices.z = depthOffset;
}
depthOffset += 0.1f; // or whatever other offset you need
}
The second issue you see is that the full polygon is written to the depth buffer. You need to enable an alpha test to discard parts of the polygons that are transparent in the texture. Please refer to the cocos2d-x documentation on how to do this with their API.