Author Topic: Atlas corruption when adding 1024 texture  (Read 2969 times)

nopecio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
Atlas corruption when adding 1024 texture
« on: October 04, 2012, 01:42:21 PM »
Hi,
I couldn't find anything related, but sorry if already reported.
I have an atlas 1024x1024, and when i add a large texture (1024x1024) instead of expanding the atlas size if completely destroys it, removing all the atlas info, forcing me to re create it.

I found the only solution was recreate the atlas, and manually (and painfully) re assign every texture again to each UI element.
I would be great if this could be fixed.

All the best

nopecio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
Re: Atlas corruption when adding 1024 texture
« Reply #1 on: October 04, 2012, 06:20:06 PM »
Ok seriously, this is terrible, this is the 5th time i have to re do my all GUI!!!
it happens randomly, not only with 1024 textures (in size)

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
Re: Atlas corruption when adding 1024 texture
« Reply #2 on: October 05, 2012, 03:00:44 AM »
you are using the texture packer come with the NGUI ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas corruption when adding 1024 texture
« Reply #3 on: October 05, 2012, 08:54:37 AM »
1024 +1024 requires a 4096 texture, which is not supported on mobile, so it gets shrunk by Unity.

In case you're wondering why, it's because there is 1 pixel of padding, so 1024+1024 means you need 2049 pixels, which requires the next power-of-two dimension, so 4096.

nopecio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
Re: Atlas corruption when adding 1024 texture
« Reply #4 on: October 05, 2012, 01:44:07 PM »
Thank you for your answers, all good :)
Having this in mind will easy my UI pains.
It could be great if some mechanism could warn the user :) (i know this might be out of NGUI's control)

BTW, is the new Packer better thank unity's built in one?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas corruption when adding 1024 texture
« Reply #5 on: October 05, 2012, 06:13:40 PM »
I have no idea. :) It's just an alternate algorithm requested by people here.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Atlas corruption when adding 1024 texture
« Reply #6 on: October 10, 2012, 06:02:25 AM »
+1 for warning that the atlas is going to be destroyed (and prevent this from happening). I know that ex2D does that, sending you an error : "the sprite can't fit in the atlas". So that might be possible ?

@nopecio : If you want to use a huge sprite that is 1024x1024, do not put it in an atlas, instead, use a "Simple Texture" to display it.