• Bugs
  • as3 runtime problems

Other problem with new version of Starling runtime (skeleton with meshes).

Scenario:

  1. Open your spine-starling-example project.

  2. Use GoblinsExample.

  3. Add

    _starling.enableErrorChecking = true;

    to Main.as

  4. Run

  5. Crash:

Error: Error #3600: No valid program set.
   at flash.display3D::Context3D/drawTriangles()
   at PolygonBatch/flush()[\spine-starling\src\spine\starling\PolygonBatch.as:222]
   at PolygonBatch/end()[\spine-starling\src\spine\starling\PolygonBatch.as:111]
   at spine.starling::SkeletonSprite/renderMeshes()[\spine-starling\src\spine\starling\SkeletonSprite.as:101]
   at spine.starling::SkeletonSprite/render()\spine-starling\src\spine\starling\SkeletonSprite.as:81]
   at starling.display::DisplayObjectContainer/render()[\Starling-Framework-1.51\starling\src\starling\display\DisplayObjectContainer.as:355]
   at starling.display::Sprite/render()[\Starling-Framework-1.51\starling\src\starling\display\Sprite.as:203]
   at starling.display::DisplayObjectContainer/render()[\Starling-Framework-1.51\starling\src\starling\display\DisplayObjectContainer.as:355]
   at starling.core::Starling/render()[\Starling-Framework-1.51\starling\src\starling\core\Starling.as:502]
   at starling.core::Starling/nextFrame()[\Starling-Framework-1.51\starling\src\starling\core\Starling.as:457]
   at starling.core::Starling/onEnterFrame()[\Starling-Framework-1.51\starling\src\starling\core\Starling.as:660]

I have the same error in my project (even without enableErrorChecking). Will you look on it? Thanks in advance.


Ok, I found a bug:

PolygonBatch.as

Lack of assign a "program" variable (it has null value)

   Starling.current.registerProgramFromSource(name, vertexShader, fragmentShader);
}
context.setProgram(program);
Related Discussions
...
woood написал

It seems that once meshes start working correctly smooth transitions between animations disappear (setMixByName fucntion) . Is this as it should be?

May I get an answer?

Next bugs, StarlingAtlasAttachmentLoader is very buggy, it doesn't work at all.

Ok, let's go:

public function newMeshAttachment (skin:Skin, name:String, path:String) : MeshAttachment {

[…]

attachment.regionV2 = (matrix.tx + subTexture.height) / root.height;

Should be:

attachment.regionV2 = (matrix.ty + subTexture.height) / root.height;

Analogous situation is in newSkinnedMeshAttachment function.

But it still isn't enough.

         attachment.regionU = matrix.tx / root.width;
         attachment.regionV = matrix.ty / root.height;
         attachment.regionU2 = (matrix.tx + subTexture.width) / root.width;
         attachment.regionV2 = (matrix.tx + subTexture.height) / root.height;

It doesn't work, u v u2 v2 are not proper calculated, I think it should be:

            var rectRegion:Rectangle = atlas.getRegion(path);
         attachment.regionU = rectRegion.x / root.width;
         attachment.regionV = rectRegion.y / root.height;
         attachment.regionU2 = (rectRegion.x + subTexture.width) / root.width;
         attachment.regionV2 = (rectRegion.y + subTexture.height) / root.height;

The same for newSkinnedMeshAttachment function. It works for me.

And next I suggest to add below code in newRegionAttachment function:

        var subTexture:SubTexture = texture as SubTexture;
        if (subTexture)
        {
            var root:Texture = subTexture.root;
            var rectRegion:Rectangle = atlas.getRegion(path);
            attachment.regionU = rectRegion.x / root.width;
            attachment.regionV = rectRegion.y / root.height;
            attachment.regionU2 = (rectRegion.x + subTexture.width) / root.width;
            attachment.regionV2 = (rectRegion.y + subTexture.height) / root.height;
            attachment.setUVs(attachment.regionU, attachment.regionV, attachment.regionU2,       attachment.regionV2, atlas.getRotation(path));
        }

We will have more flexible Skeleton class, similar to AtlasAttachmentLoader version.

Thanks for the detailed post. Nate is currently traveling to the US and will reply as soon as he is able to. Sorry for the trouble.

Sorry it's been a while. I haven't forgotten though and will get to this when I'm back from vacation.

No problem, Nate. Have fun and peaceful holidays!

Next issue to reconsider when you come back. I noticed that skeleton with meshes generates quite a lot draw calls (1 draw call per attachment, it doesn't matter that all images are in one atlas). An implementation uses PolygonBatch class, but I don't see too much profit from this way (a similar name to QuadBatch suggests that it will be fast, but it isn't). Any chance for more effecient solution? For example, 1 draw call per atlas, like in version without meshes?

Hello,
I am having a similar problem using Spine Pro and Starling.
The mesh deformation doesn't get rendered at all..

I am attaching you a spine project to check the bug.

Thanks for your help 🙂

Thanks for the attached file, we will look into it when Nate is back from vacation. Will be at least two weeks. Sorry for the wait 🙁

Great! 🙂 glad to hear it. Replied to your email as well but I'll note is as being solved.

месяц спустя

hi, I am sorry for being annoying. But is it possible to have meshes and smooth transition between animations at the same time? I am using starling.

Note the issues with the original post in this thread should be resolved in the latest spine-starling.

@woood, you might want to start a new thread, but yes the transitions will be smooth.

2 года спустя

I'm getting this error again. Maybe it resurfaced?

Mine is PolygonBatch.as line 168 where it's reading from uvs at index 8, but length of uvs is only 8.

I am using Starling 1.7's asset manager to reference the TextureAtlas and json file data as opposed to embeds. I got the raptor example to work the same way, but when my artist exported his project and I put it in the game the same exact way as the raptor example I get this error.

What version of Spine is your artist using for export?