- Home /
multiple Texture2D.PackTextures, same rects?
Hi,
if i have for example two similar sequences of textures (same count, same resolutions) and i PackTextures() them,
can i be sure that the resulting rects will be the same too? I need it for my character customization, which i want to extend.
It seems to be that way, i just need to be sure, so that it doesn't break accidentaly later on.
Answer by FrimaMickD · Sep 04, 2013 at 03:05 PM
For someone to really be able to answer you this, they would need access to the source code, which I don't. I believe that if you have your texture always the same size and always in the same order, the PackTextures() function will always return the same result.
If later on you add a new texture to Pack that is not of the same size, than I think it's possible this texture will be accounted for first. I base my answer on the fact I did write a custom Atlas function that was first sorting the texture by size before packing them in the atlas.
Hope this helps!
Could you tell me, what functions you used for your self programmed atlasing? I thought about program$$anonymous$$g it myself too, just to be in control of its inner workings.
Ok, looking at SetPixels, it's fairly trivial. I'll roll my own.
You can use SetPixels and Apply() to do that but be aware that it is VERY slow and need you to have your texture in a certain format and the "Read/Write Enabled" flag on. Just so you know! :)
Your answer