I tried playing with the import settings (we want it to be GUI), but nothing I tried would fix this. I confirmed that the texture in its native form is 1024x768. The imported version could not be changed from 1024x1024 (stretched). Our player is set to build for iOS.
This texture is intended as a background for our menu system. The stretching not only distorted the image, but caused the bottom of it to be chopped off.
4.1 also broke EZ-GUI, though I was able to fix that.
Use 4.1 at your own risk. IMHO it is NOT ready for primetime. I have reverted to 4.01, and removed my fixes from EZ-GUI.
Is 768 achievable by using the power of two? No, so as expected unity often will (at least try to) resize it. Increase your texture’s canvas to 1024x1024 and size it properly using UVlayouts or script based scaping/transparency.
It is really quite common for unity to behave strangely with non-square textures, especially when not in the order of ^2, thus using 512x1024 is likely to cause less issues.
Set the texture type to advanced and make sure to set the “Non power of 2” setting to “None”. You can also disable mip mapping which should be off in your case since you are saying you want to use it as a GUI.
However, as the other two gentlemen already said, this will break your compression.
I have been working with this texture just fine for the last 8 months. I’m well aware how to coerce Unity versions prior to 4.1 to maintain texture aspect ratio. I’m not a Unity newbie, but I appreciate your responses. This is a problem with 4.1. As for PVRTC compression, yes, it’s true that the textures must be square for use as a texture, but under 4.01 It shows the texture as (1024x768 ) (NPOT) which indicates that it realizes it’s not a power of 2 and it didn’t force it. I’m not sure what it was doing, but it was compressed, and it worked just fine on iOS devices. Now, it gives no option of whether you want the canvas extended with black (or some other color) or you want it stretched. It just stretches it unasked. FAIL!
This is how it was set up originally, though the compression was set to PVRTC. Worked in 4.01, didn’t work in 4.1. Can’t afford the space for it to remain uncompressed.
As for other things to try, I think I will have our team wait for 4.1.1 before we even bother to try again. I just don’t have time to deal with this level of change for a minor release of the system.
I think you miss the point. PVRTC cannot handle npot textures. Most likely it wasnt compressed at all in prev unity versions. Or something like that. Honestly, i have no intention of digging in old version to research, but to restate the obvious - NPOT never worked with PVRTC.
I understand that. My point was that at least it prioritized the NPOT over the PVRTC compression previously (since for iOS that’s seems to be the compression it defaults to). That appears to no longer be the case. I’m not sure how many textures I will have to adjust, and since there are other issues with 4.1, in addition to the noted EZ-GUI problem, I think I will just wait for their next update.
No, you dont understand the whole picture. PVRTC is the only compression available for ios. And this behaviour wont be changed. I dont think this is such a big problem like you describe - have AssetPostProcess script or something like that to fix it for you
Actually I DO understand the whole picture. I KNOW that PVRTC is the only compression available for iOS. And I KNOW that PVRTC forces the image square, power of 2. In 4.0.1, if the compression was set to PVRTC (by default for iOS) AND the texture was set to Advanced, non-power of 2, the import respected the non-power of 2 and did not compress the texture. Under 4.1, not only has that changed so that the PVRTC compression takes precedence over NPOT, forcing the image to a square POT, but worse still it does this by stretching the texture to the nearest square power of 2 instead of padding it. That makes no sense to me.
I dare say I have been at this longer than you have. In this case, I believe you did not understand my post. I do understand the whole pciture.
oh ffs, now i see what you mean. I cant promise it in 4.1.1 but it might be in 4.2
And yeah, no need to be THAT angry (though i am to blame for sounding a bit over the top too).
P.S. just for future, if you would bug report with repro and posted case number in the initial post - we would have more info right away, so it would be easier and faster
No problem, and sorry for the attitude. I know there are a lot of folks using Unity without a lot of other background exp. Sometimes it riels me when I get lumped in that group. Probably my fault for not explaining it better in the first place.
Thanks for the speedy reply and fix on this. I noticed it too and had to roll back to 4.0.1 because it just caused far too many pervasive changes all throughout our 2D UI areas.
Thanks, and looking forward to 4.1.2 or 4.2 for the fix!
Kurt
I have upgraded to Unity 4.1.3 but still getting stretched textures (Which we didn’t have on pre 4.1) . Is there something else I need to do to prevent this?