Abelius

Hi there,

I'm starting a new game project, and after reviewing the ways I can export images from Photoshop to Spine (watched the nice video tutorial), I've decided to not downscale and don't trim the layers.

That is, I'm gonna export the huge images in PS at canvas size. Every one of them. :rolleyes:

My question is... the fact I'll have big images, that are actually transparent for the most part, will affect memory usage up to the point of getting crashes?

Of course, the first thing I'll do is to mesh them to a tight size around the actual image (for a civilized atlas size), but I don't know if Spine will still allocate memory for the full-sized images, which could result in very poor performance and CTDs.

So that's my million dollar question.

About my reason to do this... it's really long to explain. Just bear with me and my stupid question. ;)

Thanks!
アバター
Abelius
  • 記事: 148

Nate

Spine needs to load the whole image into GPU memory, even if you use meshes to cut away the transparent space. I can't say if it will be a problem, as it is mostly dependent on your GPU hardware. You could do some tests, eg duplicate a big image many times and see how many of those you can have in Spine.
アバター
Nate

Nate
  • 記事: 9642

Abelius

Ah ok. That sounds pretty terrible, indeed. :p

Thank you for your quick response!
アバター
Abelius
  • 記事: 148

Nate

Hard to say how terrible it is. Nearly any modern video card has ~4GB of memory and you get one with 24GB. An RGBA image takes up 4 bytes per pixel, so eg 2048x2048 takes up 16MB. 4GB can fit 250 of those (less since you won't be able to use all the GPU memory just for your images, but you get the point).
アバター
Nate

Nate
  • 記事: 9642

Abelius

Yup, for normal-sized projects it would be fine, but my previous project contained more than 1000 individual images and my artist uses a huge canvas size.

Also, the reason I wanted to do this is probably me doing things the wrong way, so I'll just trim them and use a generous padding size.

Thank you, Nate!
アバター
Abelius
  • 記事: 148

Nate

Sure, no problem. A few more thoughts:

Spine only loads the images that are visible at the same time, or are visible at any time during the active animation. This means you can have many images, but they won't all be loaded at once. I've seen a project with 19,000 images, though if you have so many I would suggest a runtime solution rather than setting all those up in Spine:
Runtime Skins - Spine Runtimes Guide: Creating attachments

You can use smaller images in Spine than you use at runtime. At runtime the images can be larger or smaller, you just set a scale factor when loading the skeleton data:
Loading Skeleton Data - Spine Runtimes Guide: Scaling
アバター
Nate

Nate
  • 記事: 9642


Return to Editor