- Home /
image stretched when packing textures in large size
I was using UIToolkit from Prime31 and Texture Packer to pack a group of my textures. The image is 1024x2048 after packing, and it doesn't display correctly in Unity3D. Actually it's kinda like being stretched or something.
It's not the issue of the UIToolkit, for there's no errors nor exceptions. And I didn't change the script a thing.
It might not be the issue of TexturePacker, for I've checked the published image in Mac Finder, and it's okay.
Things are not right when I'm checking the preview in Unity3D. The preview in Unity3D is Stretched. And the GUI in gameplay is stretched,too, as I described in the beginning. But I've set the image type as GUI. And I've tried to set the image's size from 1024 to 4096. They all act not-normal.
My questions are, Have you tried to pack images in large size like me? You have the same issue? Unity3D cannot handle this size of texture? Kinda unbelievable. I'm using Unity3D 3.5.
Thank you guys!
Obviously Unity can handle textures of that size. Texture packing requires the UV coordinates on the objects to be changed. I suspect something has gone wrong there.
As you can see above, my image is actually in the dimension of 1024*2048. But when exported, it's stretched into a square. If I simply pack 2 images together, that's no problem.
Answer by Van Zeng · Apr 02, 2013 at 03:12 AM
It seems that I set the format as 16bit or true color, rather than compressed, there will be no problem then.
But I still don't understand very well. In the Unity3D Documents, The Compressed Format is described like, Compressed RGB texture. This is the most common format for diffuse textures. 4 bits per pixel (32 $$anonymous$$B for a 256x256 texture).
It didn't say it would stretch the image and force it in a shape of a square.
Besides, this is not the first time I use non-square image for GUI. I didn't see any issue before.
Your answer
Follow this Question
Related Questions
Packing unity textures into atlases 0 Answers
Texture-Atlas Modifying Mesh UVs 2 Answers
What's the benefit to use texture atlas after Unity3D released 2D sprite support? 1 Answer
Sprite Rendering Cost Calculation 1 Answer
Does Prime31's textureFromFileAtPath require specific plane settings? 1 Answer