I am creating a texture atlas by script. I use 6 images to do that and the code looks like this:
atlasTextures = new Texture2D[6] {frontTexture, topTexture, backTexture, bottomTexture, leftTexture, rightTexture };
Texture2D atlas = new Texture2D(1024, 1024);
Rect[] UVs = atlas.PackTextures(atlasTextures, 2, 1024);
GetComponent<Renderer>().material.mainTexture = atlas;
The result of packing looks like this:
Question is, why this code produces so much empty space? Since I will always use only 6 textures, is it possible to make atlas a bit smaller?