Alright, so this is my first post on the Unity forums. So excuse my ignorance of any unwritten rules.
I have built an automatic sprite atlas generator, that searches my project for specific scripts and constructs an atlas from them. This all works fairly well, I have even been able to make use of this for my 3D game objects, by setting the UVs accordingly.
However, I am running into a bit of an issue. Its not major but I am trying to clean up my tool for quicker use. Essentially, I use PackTextures to build the texture, convert it to ARGB32 and then into my desired format (be it DXT or PVRTC etc). This however, seems only to work correctly when my build settings are set to PC Standalone, not Android or iOS.
Texture2D newTexture = new Texture2D(maxSize
, maxSize
, format
, enableMipMapping);
_TextureRects = newTexture.PackTextures(textures.ToArray()
, padding
, maxSize
, makeNoLongerReadable);
Texture2D correctedTexture = new Texture2D(newTexture.width
, newTexture.height
, TextureFormat.ARGB32
, enableMipMapping);
correctedTexture.SetPixels(newTexture.GetPixels());
EditorUtility.CompressTexture(correctedTexture
, format
, TextureCompressionQuality.Normal);
The UVs seem to be remapping correctly regardless of platform. It seems to be the generated texture that is causing the issue. As shown below:
(As seen on PC)
(As seen on Android)
Any help, would be greatly appreciated. Thanks in advance!