Author Topic: Limit to texture size in atlas?  (Read 4768 times)

Alan Gray

  • Guest
Limit to texture size in atlas?
« on: May 23, 2012, 06:15:35 PM »
Any reason this shouldn't work? I'm adding a single 2048x1536 (NPOT) RGBA 32-bit texture to an atlas and it's getting cropped (not scaled) to 1536x1152 (cropped to bottom left). I'm doing exactly the same thing in two other atlases with smaller textures (512x384 and 1024x768) and they are not getting chopped.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Limit to texture size in atlas?
« Reply #1 on: May 23, 2012, 09:02:40 PM »
Well, 2048 on one dimension means it won't fit into a 2048x2048 texture, and Unity clamps textures to 2048x2048 when you're targeting iOS/Android.

I suggest you just use UITexture for this instead of trying to put it in an atlas.

Alan Gray

  • Guest
Re: Limit to texture size in atlas?
« Reply #2 on: May 23, 2012, 09:48:53 PM »
lol. Why doesn't a 2048 wide texture fit into a 2048x2048 atlas? Is it the 1 pixel padding? I thought I tried turning that off and it still got cropped.

The whole point of what I'm doing right now is testing a triple-atlas solution to support 480x360 up to 2048x1536 resolution. We need pixel-perfect at all resolutions - including background textures. If I can't make the 2048 wide background texture work, then atlas swapping won't cover this one texture and it will have to be special cased. Not the end of the world - but kind of a pain.

Thanks!

Alan Gray

  • Guest
Re: Limit to texture size in atlas?
« Reply #3 on: May 23, 2012, 10:01:28 PM »
I set the padding to 0 and it didn't get cropped. Should I expect edge artifacts with no padding? I have it set to clamp.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Limit to texture size in atlas?
« Reply #4 on: May 23, 2012, 10:10:01 PM »
As long as you've clamped it, it should be just fine.