We are developing a 4k shooter game that contains lots of handmade animations. We built 4096x4096 atlases and in the first level, we use around 60 sprite atlases of this size, though not at the same time.
Configuration: i9, Nvidia GeForce GTX 1080, 16 GB RAM
Unity: 2021.1.28f1
Sprite Atlas settings: Include In Build - yes, Packing - Allow Rotation - yes, padding 4, Filter Mode - Bilinear, Format: Automatic, Compression - High Quality. Everything else is turned off, but I attached a screenshot below. Just a few atlases have multiple pages.
I got a few questions, I hope someone can help:
In the example below, the crew sprites are not all active at the same time, but they sometimes become active, would it be more optimized to split this 4096x4096 atlas into multiple?
While running the gameplay, not all enemy types, weapons and bullets are present all the time, but this changes constantly. Would it make sense to somehow offload the textures that are not currently present and what would be the best way to do this? Is there any difference between setting the GameObject to not being active and using Destroy on it when it comes to freeing the memory from the texture it uses?
Is there any other Unity version that’s more optimized for 4k 2D?
Anything else we can do to make the Memory usage lower?
Thanks in advance, and I promise I’ll credit you for any help, this is really crucial for us as we need to decide about pursuing the 4k dream. <3
True, but when I increase the resolution, both are affected. Also optimizing the sprite atlas total size did reduce the GPU usage, but in returned it increased the Memory.
What I do find a bit strange is that GPU is at 50% while the cutscene/movie is playing.
As for the Memory, looking at the profiler, all references textures loaded, and even though for example boss is not active, all the animations of him are affecting the Texture Memory.
In profiler, Texture Memory is at 17GB. Task Manager shows that Memory consumption is around 8 GB, if I switch the resolution to 2k, the memory jumps to 9 GB.
One more thing, the Sprite Atlas referencing the boss intro is 20 MB big, while the texture itself is 300 MB big. In profiler, boss intro takes 580 MB. What’s going on here exactly? (testing this in editor)
EDIT:
We changed the texture to be power of 2 in size, so 8096x8096 instead of 8096x7000 as it was before. Now the texture size is 340 MB, the atlas is still 20 MB, and the Memory in Profiler shows it’s taking 670 MB so more than before.
the atlas wont decrease the size of your textures, if you are using even 1 pixel of a texture the whole texture is loaded and it will consume as much ram as the size of the texture
if you increase the resolution of the textures the gpu has to render more pixels therefore it will cost more to render larger res