I have a script with this
public Texture2D[] World_Textures;
public Texture2D WorldTextureAtlas;
private Rect[] m_WorldTextureAtlasUvs;
Later, I do this for the atlas generatio:
WorldTextureAtlas = new Texture2D(2048, 2048);
m_WorldTextureAtlasUvs = WorldTextureAtlas.PackTextures(World_Textures, 0);
Debug.Log(WorldTextureAtlasUvs[0]);
Now, I currently only have two textures in Texture2D[] World_Textures , both are 256x256.
However, the atlas I get back stretches them to an atlas of 512x512...effectively doubling the height of my textures and their uvs. The debug statement shows this:
(left:0.00, top:0.00, width:0.50, height:1.00) UnityEngine.Debug:Log(Object)
World:InitializeTextures() (at Assets/Scripts/World.cs:58)
World:Start() (at Assets/Scripts/World.cs:41)
Any idea why this is?