Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Alan Gray on May 23, 2012, 06:15:35 PM

Title: Limit to texture size in atlas?
Post by: Alan Gray 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.
Title: Re: Limit to texture size in atlas?
Post by: ArenMook 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.
Title: Re: Limit to texture size in atlas?
Post by: Alan Gray 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!
Title: Re: Limit to texture size in atlas?
Post by: Alan Gray 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.
Title: Re: Limit to texture size in atlas?
Post by: ArenMook on May 23, 2012, 10:10:01 PM
As long as you've clamped it, it should be just fine.