Spine tilemap support

I believe that only one drawTriangles will perform very well, but I have tried to integrate their data into an array, and the rendering is messy. Maybe I don’t understand the conversion relationship between their vertex data. In my Sprite renderer, I can now access all the vertices, but I don’t know how to render them correctly in one go.

%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_5c7226cf-4dbc-4641-8a7e-5ec44f155b4e

allVerticesArray = allVerticesArray.concat(ofArrayFloat(_tempVerticesArray));
allTriangles = allTriangles.concat(ofArrayInt(triangles));
allUvs = allUvs.concat(ofArrayFloat(uvs));
this.graphics.drawTriangles(allVerticesArray,allTriangles,allUvs,TriangleCulling.NONE);
this.graphics.endFill();

I did this with ordinary stitching, which seems to be not feasible.

Great, I have successfully rendered all the triangles with 1draw, which is great. Update a copy to githup later! :grinning:

The performance of the Sprite renderer has been improved!

1 Like

I have updated the new SpriteRender! :wink:

1 Like

@singmajesty erformance has improved, but if you use this, can you achieve the color of a single bone / BlendMode implementation?

haxelib install openfl-spine

Already uploaded to haxelib, it can be installed directly.

2 Likes

Currently, no, blendMode is supported once per draw, and requires multiple sprites.

There might be a way to simulate it (or do even more) using a custom shader, though, plus per-vertex attributes

@rainy is there any listener for animation complete on spine?

Yes:

var event:AnimationEvent = new AnimationEvent();
var spine:SkeletonAnimation;
spine.state.addListener(event);
event.addEventListener(SpineEvent.COMPLETE,(event:SpineEvent)->{
    
});

Great! Thanks.
Anyway, I noticed that Sprite renderer doesn’t support color transform (blending, etc.), and Tilemap renderer doesn’t support mesh animation. Any suggestion how to have color transform and mesh in one animation?

Under SpriteSpine, there will be a support for openflSprite.isNative = true;, but it should be noted that this will treat each bone as a drawcall, which will have a certain performance impact.

I have not yet mastered how to use the shader to achieve SpriteSpine’s transparency support, :thinking:

1 Like

OK, I’ll avoid mesh animation, that’s OK for now.

I happen to be learning GLSL recently, so it is very possible to enhance the transparency and BlendMode rendering of SpriteSpine :grinning:

1 Like

Well, that will be great :grin:

I think I understand how to deal with it, but it’s just a simple example. I also need to use Spine as an example to implement it.

I recently completed SpriteSpine’s transparency, color modification, and BlendMode.ADD support. I will re-release an openfl-spine version these days.

1 Like

Now, !isNaitve support:

openfl-spine Update to 1.6.0

haxelib update openfl-spine
haxelib install openfl-glsl
haxelib install vector-math

1、Deprecated: The isNative rendering support of SpriteSpine is no longer supported, and it is invalid by default; if there is still a need, please refer to multipleTextureRender multi-texture rendering support.
2、Improvement: Added the SpineRenderShader shader, improved the SpriteSpine rendering, and now has added support for transparency, BlendMode.ADD, color modification, etc. (mesh supports at the same time).
3、Dependency: Need to depend on the openfl-glsl library.

@gonzos

1 Like

I’m trying to check this new feature but get error: type not found: openfl.shader.SpineRenderShader;
What kind of version openfl do you use?

I found this problem and it has been synchronized to the repair version: 1.6.2.

New issue is:openfl-glsl/0,0,8/Source/glsl/GLSL.hx:3: characters 1-9 : Unexpected function

You may want to use Haxe 4.2.0+ version