Error creating 4096 Textures

No matter what I do, I can’t seem to get unity to create a 4096 Texture Atlas.

I’ve set Max Size to 4096 or 8192, but always get the same error when trying to pack:
ArgumentException: Atlas “foo” (2048x2048) can’t fit sprite “texture2” (3840x1080).
UnityEditor.Sprites.DefaultPackerPolicy.OnGroupAtlases (BuildTarget target, UnityEditor.Sprites.PackerJob job, System.Int32[ ] textureImporterInstanceIDs) (at C:/buildslave/unity/build/Editor/Mono/Sprites/DefaultSpritePackerPolicy.cs:104)
UnityEditor.Sprites.Packer.ExecuteSelectedPolicy (BuildTarget target, System.Int32[ ] textureImporterInstanceIDs) (at C:/buildslave/unity/build/Editor/Mono/Sprites/SpritePacker.cs:117)
UnityEditor.DockArea:OnGUI()

Any ideas what’s going on?

My sample project has just 2 textures included, each one is 3840x1080, both with a Max Size of 4096, and packing tag of “foo”.

2436321–167013–Test4096Atlas.zip (28.4 KB)

Just a comment… if you’re building for mobile devices, you do not want such a huge atlas. It will be a performance hit on mobile.

check if the Sprite Packer is doing something funny!
Try after disabling it from Edit > Project Settings > Editor > Sprite Packer…

and as @Kurius said, which android on earth are you targeting!!! :face_with_spiral_eyes:
I get a huge impact on performance even if I use several 4k textures on One Plus One :eyes:

We’re targeting PC/Console actually.

The solution, provided by Laurynas from Unity QA(thx!), is to create a custom SpritePacker policy, like so:

According to the docs here: Unity - Manual: Sprite Packer

Just add this class to your project, open Window > Sprite Packer and choose this policy. 4k Textures should now be generated.