NicolaSirago

Hi everyone!

I've some trouble understanding how polygon packing works for the texture generation. I see that the way the spine user generates meshes affect also the size of the texture.

The question I have it's related to the LibGDX format itself, actually, it seems that the "Spine TexturePacker" works differently from "CodeAndWeb TexurePacker", while the embedded one allows generating atlases with polygon division (while not saving vertex info) the CodeAndWeb one doesn't permit to check the option.

The reasons why I would like to use the "code and web" one are two:
1. because we use an automated solution to parse and generate all the game assets
2. because the way elements are arranged in the atlas by the embedded txpkr it's a bit crazy. I've attached an example to explain what I mean saying "crazy".

I hope you understood me,

thanks in advance for the help,

Nic.
У вас нет необходимых прав для просмотра вложений в этом сообщении.
NicolaSirago
  • Сообщения: 16

Nate

I think you forgot to ask a question? :)

The arrangement of regions within the image is not important. The important thing is that the packer tries to optimize for the smallest size image. Many settings can affect that, eg checking power of two will prevent the packer from using the smallest size it otherwise can use. That said, it's not clear from your images why it looks that way (maybe you use power of two, don't use whitespace stripping, or the cause could be other settings).

The CodeAndWeb packer needs to know about the mesh vertices to be able to pack polygons. The mesh vertices come from the JSON or binary skeleton data. You'd have to ask Andreas, the CodeAndWeb author, to implement that feature. He'll need to keep in mind that multiple meshes can use the same image file, so the maximal bounds must be used.
Аватара пользователя
Nate

Nate
  • Сообщения: 9288

NicolaSirago

Thanks Nate!
Yes, you answered the question (ho does it works?) without I asking it.
So if I understand correctly, the atlas with polygon division can work just in combination with skeleton data. If this is the case I think it will be really difficult to generate the atlas outside the spine authoring tool.
Anyway thanks for the clarification.
NicolaSirago
  • Сообщения: 16

Nate

Yep, that's correct. The CodeAndWeb packer could work by taking the vertices from the skeleton JSON.
Аватара пользователя
Nate

Nate
  • Сообщения: 9288


Вернуться в Runtimes