Author Topic: Texture Packing Error  (Read 12343 times)

dereklam0528

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 20
    • View Profile
Texture Packing Error
« on: May 18, 2014, 12:04:05 PM »
Hi,

I have a problem with creating a atlas texture with NGUI. The story starts with I originally create user interface with 2D Toolkit. But then I switched to NGUI. And I was working under Android platform. When I got everything working on Android platform, I switched to iOS. Then all the texture positions are off. See Image:

I did delete the prefab and recreate a new one, and I also delete every texture in the project and import them again. But after I add several sprites into the texture, the whole texture become like this,

I don't know what I can do to fix this. I did try to re-import the package, but it still does it. Can someone explain to me what happen in here? Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Texture Packing Error
« Reply #1 on: May 18, 2014, 04:22:11 PM »
Happens when your texture can't be imported at native dimensions. Check the atlas texture import settings. Force it to be imported at proper size if nothing else.

dereklam0528

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: Texture Packing Error
« Reply #2 on: May 18, 2014, 06:21:40 PM »
So I messed around with the import setting, and it becomes something like this:





Also I keep getting an error: Unsupported texture format - needs to be ARGB32, RGBA32, RGB24 or Alpha8
But I have set everything into those format, I don't know which texture does it referring to.

Update:
I played with it a little bit more, and I found out the following facts:

1. If I create a new Atlas Texture and slowly add my sprites folder by folder, it becomes like my image below when I just finished adding my sprites from fifth or sixth folder (You can also call it 5th or 6th patch).
2. If I move all the necessary sprite into one single folder, and I create a atlas texture by selecting all. It will create a perfect atlas texture which I can see all the individual sprite. But it is still pretty much like this image.
3. When I create a new atlas texture, the import setting of it has became as "Sprite" all the time, which I remember it should be "Advance" instead.
« Last Edit: May 18, 2014, 08:02:39 PM by dereklam0528 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Texture Packing Error
« Reply #3 on: May 18, 2014, 11:28:48 PM »
By the looks of it you need to recreate your atlas using source sprites since a lot of it shows up as just lines / rectangles.

Unity can be odd like that. You have your texture import settings set to "ARGB 32", and yet the texture is imported as RGBA 16 bit. You need to actually override the texture import settings your your target platform.

dereklam0528

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: Texture Packing Error
« Reply #4 on: May 19, 2014, 08:49:56 AM »
Do you mean like set the import setting for iPhone and check the box where it says override for iPhone? I tried, it is still no luck. I notice this is a Unity issue that even if I open a new project, it still does this. And I found out it only does this when the atlas texture become larger than 1024 * 1024. I am not sure if uninstall Unity and reinstall it will help :/

Update: I figured it out. I have some plugin that might cause this problem, I deleted some of them. And that fixed after I switch iOS. I don't know which plugin that makes this issue though. I will find out. Thanks for your help.
« Last Edit: May 19, 2014, 11:32:57 AM by dereklam0528 »