Author Topic: bug deleting an image out of an atlas  (Read 7260 times)

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
bug deleting an image out of an atlas
« on: January 30, 2013, 06:18:58 PM »
I have an Assets/UI folder.  Within the UI folder I have Assets/UI/Fonts where two font textures live.  They are added to my atlas with UIFontMaker along with other UI images that live in Assets/UI.

I still haven't figured out how to delete/remove an image from the Atlas with the X button without blowing away every other image in the atlas.  Very frustrating because that always erases all the padding settings for any sliced sprites as well as requires me to go into just about every widget and set the sprites again

What am I doing wrong or is this a bug?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #1 on: January 30, 2013, 08:20:34 PM »
Eh? Are you forgetting to save your atlas after every modification or something? I use the atlas and font tools on daily basis and never have such issues.

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #2 on: January 31, 2013, 12:32:23 AM »
I save all the time.  In fact I just updated a sprite (it was a larger image size), and the atlas lost the font textures.  I add them back and the atlas is just hosed.  It seems that any time the atlas goes to a non-square size, all the uvs are screwed up.
« Last Edit: January 31, 2013, 12:39:04 AM by andrew »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #3 on: January 31, 2013, 12:58:26 AM »
Are you exceeding the maximum texture size here or something? Mobile platforms targeting ARMv6 / GLES 1.1 limits to 1024x1024 size. ARMv7 / GLES 2.0 limits to 2048x2048. Only newest generation devices (last year's) support 4096x4096.

Try using the non-Unity's texture packing as well. it's a toggle on the atlas maker.

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #4 on: February 10, 2013, 12:55:29 PM »
Not exceeding maximum texture sizes.  It's only a 1024x1024 unless it spills over to a 2048x1024 ( at which point all the UVs in the UI elements are jacked ).  Interesting, the "Texture" size in the Atlas Maker says 1024x512 at that point.  The other custom packer doesn't make any changes.

I do have a custom tool that responds to EditorApplication.projectWindowItemOnGUI.  It doesn't change selections, but it draws additional items onto the Project tree items.

Just now again, I highlight one sprite image in the project tree, I have the atlas maker open, it lists all the images, I clicked the 'X', then 'Delete' and all other sprites are deleted.

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #5 on: February 10, 2013, 06:11:42 PM »
I really need to figure out what I'm doing wrong or what bugs are in the atlas generation because this is destroying a lot of work and completely frustrating.  Attached is an example where simply updating a font texture (increasing the size of the image exported by glyph designer) with Font Maker blew away all the rest of the sprites in the atlas.  It's random.  It works one time and fails the next.  Each time this happens I have to redo all the sliced sprite borders and and sprite assignments for all the widgets.



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #6 on: February 10, 2013, 11:11:17 PM »
I have been working with a non-square atlas targeting Android for the past few weeks. Width 512 height 1024. No issues...

P.S. I am not using compression. The atlas is truecolor.
« Last Edit: February 10, 2013, 11:13:14 PM by ArenMook »

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #7 on: February 11, 2013, 12:08:16 PM »
Click the Override for iOS/Android button on the texture import settings.  If you enable compression, that's when it stops working.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: bug deleting an image out of an atlas
« Reply #8 on: February 12, 2013, 10:20:30 AM »
Right, do not use compression. Forcing compression on an android device force-resizes the texture to be power-of-two, regardless of its actual size. So even if you have 512x1024, it will actually be 1024x1024, which obviously breaks NGUI because the atlas is configured in pixels.

You can change the "coordinates" field on the atlas to be "Tex Coords" instead of "Pixels", and it will work as you expect.

moffeur

  • Guest
Re: bug deleting an image out of an atlas
« Reply #9 on: April 24, 2013, 01:22:47 PM »
Hi, the same exact thing is happening to us, and I've run out of ideas for how to fix it.

We have a 2048x2048 UI atlas that includes two fonts. Our artist has modified the source texture for one of our fonts to include some gradients and outlines, so I want to replace that font in our existing UI atlas. I've made sure that every texture's import settings are set to 2048/truecolor (no compression).

I go through the Replace Font process by using the font maker tool and pointing it to the revised source assets, and to the UI atlas. When I click replace, it annihilates the UI atlas.

I've tried deleting the font texture from the UI atlas, in the hope that I can add it "cleanly". However, just the act of deleting the font texture results in complete corruption of the rest of the UI atlas. Every other button and sprite is now broken.