• Editor
  • C++ API: newAtlasPage needs a delete hook

Hey,

Using the SFML C++ library as reference, I now have Spine animations playing in my codebase. Here's a Vine:

https://vine.co/v/bglOmF3QAHp

Anyways, I noticed the Atlas has a function newAtlasPage which you overload to load your textures from disk to VRAM, but there's no function/hook I can use to clean up (no deleteAtlasPage).

Great work BTW. Loving Spine. 🙂

PS: The disappearing Torso and Interpolating-to-Red head in the animation file took me a while to track down. Good thing JSON files are so easy to read. 😉

Related Discussions
...
  • Đã chỉnh sửa

Super cool! 🙂

Heh, the torso and head color were for testing, I didn't mean to commit them but have been too busy to fix it. 🙂

Typically all the backing images for the atlas are loaded when it is constructed and unloaded when destructed. I see the SFML runtime isn't unloaded them in the destructor, I'll fix that soon.

PoV đã viết

Hey,

Using the SFML C++ library as reference, I now have Spine animations playing in my codebase. Here's a Vine:

https://vine.co/v/bglOmF3QAHp

Anyways, I noticed the Atlas has a function newAtlasPage which you overload to load your textures from disk to VRAM, but there's no function/hook I can use to clean up (no deleteAtlasPage).

Great work BTW. Loving Spine. 🙂

PS: The disappearing Torso and Interpolating-to-Red head in the animation file took me a while to track down. Good thing JSON files are so easy to read. 😉

Is this the same color of hair you were seeing, or is it different?

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Just wondering if my color mixing is working properly... 😉

  • Đã chỉnh sửa

It was red yes, but in my case it affected the face too... probably more than anything.

Here's a shot from when I was trying to track down the problem.

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Looks like your blending might be off. Yours looks a bit too neon to me (additive?). 🙂

Just in case anybody else is porting Spine to their own SDK (native OpenGL, Direct3D, or whatnot), here's some glitched images and thoughts on what was broken then fixed in the next image.

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

1. No texture
2. I forget exactly, but something with the UVs
3. 4 Vertices are being added, but render mode was Triangle Strips not Quads (which is deprecated in current OpenGL, and unavailable in OpenGL ES and Direct3D FYI)
4. Alpha blending not enabled.
5. Triangle Strips with 6 vertices per sprite, when it should have be Triangles (not strips)

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

6a. Rigid Texture (pixely). Is the texture filtering mode. In OpenGL this is GL_NEAREST, and what you want is GL_LINEAR.
6b. Texture fringe (along edges). Can fix either by modifying the artwork (including color in the 100% alpha areas, even though it's transparent), or by using a pre-multiplied alpha blending mode (and multiplying your RGB channels by the alpha value).
7. (6 not fixed until next image) Test art assets contain 2 glitchy looking transformations (used by Spine devs to test blending features). Edit the JSON animation file if you want to remove them.
8. Done. Spineboy.

Haha, very cool documentary on the evolution of your runtime. 🙂 I also like your background. I'm quite familiar with having everything FUBAR and trying to figure out what transforms are bad, etc. It's all worth it when it comes together in the end! :party:

Nate đã viết

Haha, very cool documentary on the evolution of your runtime. 🙂 I also like your background.

Thanks. My go-to background is usually an off-black (dark red), but I've had this noise shader for a while that's just dying to be used. 😉

Nate đã viết

I'm quite familiar with having everything FUBAR and trying to figure out what transforms are bad, etc. It's all worth it when it comes together in the end! :party:

Indeed. I got to do ports to a lot of different devices, many which don't even exist anymore, and the process is always the same: Get those white boxes up, then get them to draw right. 🙂

And yeah, you get to see interesting glitches along the way. Sometimes, they go disco. :rofl:

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Disco!

Love it 😃

PoV đã viết

It was red yes, but in my case it affected the face too... probably more than anything.

Here's a shot from when I was trying to track down the problem.

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Looks like your blending might be off. Yours looks a bit too neon to me (additive?). 🙂

Can you post an image of what it's actually supposed to look like? 😉

Should look like that except for the fringes around the edges of the images. Spineboy had been wearing sunglasses out in the sun all day and as a result ended up being slightly transparent and very red 😉