Mario from Spine here. I'm trying to track down an issue I've discovered yesterday, losing my last hair
The effect and mesh style are used in a custom DisplayObject's render method (SkeletonSprite.as). The method iterates through the Spine skeleton, and for each part of the skeleton, gathers vertex positions, uvs, colors and triangle indices. These are then set on a Mesh object that is supposed to use our custom mesh style. The mesh is then submitted for batching through Starling's Painter.
The first problem I encounter is that I have to set the mesh style on the meshes each time the render method is called. We cash the meshes per "attachment" (== a part of a Spine skeleton). Originally, I thought setting it once after the creation of a mesh should suffice, but it does not.
The second problem is much more peculiar and turned up when implementing software clipping yesterday. When calling render for the first time, the rendered skeleton has white artifacts like in the following screenshot:
When i call render again, the artifacts are gone:
My first instinct was that I didn't submit the same mesh data the second time. However, I've traced and diffed the data (vertex positions, uvs, colors, texture, mesh style, triangle indices) that's being submitted to the Painter, and it's the exact same for both frames.
The render function of the SkeletonSprite is not called continuously in my reproduction case, but only on mouse click by calling setRequiresRedraw(). This means that whatever I submitted in a frame will be cached and used for drawing the SkeletonSprite, until I resubmit batch(es), e.g. manually or by using the juggler. Could it be that this cache mechanism has a problem?
You can reproduce this issue by getting the spine-runtimes repository 3.6-beta branch, then running the RaptorExample from the spine-starling/spine-starling-example project. I've added the SkeletonSprite class directly to the examples sources with some modifications that trace the data that's being submitted to the Painter.
I know it's a tall order to ask you to look into this using the repro case. But I'd be super greatful for any hints, e.g. if I use effects/styles/meshes/batching incorrectly.