• RuntimesUnity
  • Downscaling when repacking

Hey everyone!
I'm facing a weird issue that happens sometimes after repacking skins.

It seems that the repack method is downscaling textures if I don't have enough space for all of them (max size is 2k), which is understandable, but I do have some questions about it:

  • Is there a way to avoid downscaling without increasing the max size to 4k nor reducing texture quality?
  • Why is it downscaling when it seems to still have a lot of space in the texture?

Aside from that, once it marks a texture to be downscaled it seems to downscale it indefinitely.
(eg: if I switch the clothes on the avatar, the hair texture gets downscaled once. If I keep switching the clothes, the hair texture gets downscaled more and more, even tho the atlas should have enough space after the first downscale).

I've made a post about it on discord too: https://discord.com/channels/200921117320282122/583925448665202721/1269018638476775608

Any help would be greatly appreciated.
Thanks!

    Related Discussions
    ...

    luchopb It sounds weird that just doing a texture repack causes the textures to downscale more and more. Do you have some kind of script in your Unity project that works on all images? For example, is it possible that there is something working against all textures to reduce their weight and that this is affecting them?
    If this problem is not reproduced when you create a new Unity project and try to repack the textures into it, then there must be a problem in your Unity project.

      luchopb Is there a way to avoid downscaling without increasing the max size to 4k nor reducing texture quality?

      I'm afraid no.

      Why is it downscaling when it seems to still have a lot of space in the texture?

      Unfortunately the actual texture repacking operation is just using Unity's Texture2D.PackTextures function (here in code), which unfortuantely provides just a minimal input parameter set. We would love to control downscaling during packing, but unfortunately it's out of our hands. We can't really answer why it does what it does unfortunately. Perhaps you could get some answers on the Unity forums, but I'm afraid it will likely be "you can't avoid that".

        Misaki Hey! As far as I know there is nothing working against all textures once they are loaded, I just change equipments and use the GetRepackedSkin method again. I should clarify that this issue does not happen 100% of the times tho, so it's very weird.

        Harald Hey! I was afraid that was the case, but thanks for the answers anyways.
        I'll try my luck in the Unity forums if I can't fix it on my own. Thanks again!