1
\$\begingroup\$

So I am using Unity to build a 2D game and one thing that I needed is to be able to render a lot (talking about 10s of thousands) of sprite to the screen so I have a custom solution that basically is a single game object with a script that uses Graphics.DrawMesh() with pretty good results right now. Now I know another way to reduce draw calls is to have a few materials as possible (as I believe a single mesh can only use 1 material) so I was think about using a 8192 x 8192 texture as basically my main (maybe only texture) as with 64 x 64 sprites, I can fit a bit over 16000 sprites which should be more than enough for all the sprites in the game world).

My question is whether or not there is any major downside of using a texture of this size? I am sure there are decides and video cards that would not support this but I am curious as to what those are. Would current gen / next gen consoles support this? At what point would video card not support this? For the game I am working on mobile / VR is not a concern.

If this texture size would restrict support too much, what about 4096 x 4096?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ This questions about a huge sprite atlas might give some hints on potential drawbacks: gamedev.stackexchange.com/questions/73316/… \$\endgroup\$ – Julian Sievers Dec 2 '20 at 11:28
  • \$\begingroup\$ Major draw backs are just transfer rates to GPU, but if you are using materials that can be instanced it is probably no issue for you to send this double 8k image. I can't say for sure what impacts it will have on your performance, but if you only have a single material and are just adjusting UV's then I imagine it should significantly drop your draw calls. Only drawbacks I could think of is if you are using multiple types of shaders since each shader will send the image to the graphics card. But if they are all the same type it shouldn't be an issue. \$\endgroup\$ – Benjamin Danger Johnson Dec 3 '20 at 9:39
0
\$\begingroup\$

The downside is that you will have to load the entire spritesheet.

When you load level 1, you need to load the entire sprite sheet that contains even a single asset on it from level 1. This means you will be loading all of the sprites for level 2, 3, 4, and 5 as well.

If you were to have a separate sprite sheet for each level, you only load the sprites needed for that level. So when you load level 1, you get the sprites for level 1, and levels 2-5 remain unloaded.

(I know this answer is a bit vague - that is because I do not know the specifics of how Unity is loading those sprites. But this should give you a general idea.)

\$\endgroup\$
2
  • 1
    \$\begingroup\$ That is a good point but I think in my use case this is probably not a concern as my game is going to be an open world that dynamically loads / unloads chunks of the map as the player moves (in a similar way that CDDA does it) and any tile position in the map could hold any tile but thanks for the input. \$\endgroup\$ – ryanzec Dec 3 '20 at 1:56
  • \$\begingroup\$ @ryanzec Another thought...I am not an artist, but probably more difficult for them to maintain? It is probably a binary file, so assuming you are using version control, multiple artists cannot work simultaneously. \$\endgroup\$ – Evorlor Dec 7 '20 at 18:48
0
\$\begingroup\$

Most current devices should be able to support an 8192 x 8192 texture, but the possible problem you might run into is how it might slow down the game’s performance significantly. This depends on a few factors. Below I have a list that determines this:

  • GPU limits: some older/weak mobile GPUS limit textures to 512/1024. Most modern ones will handle at least 2048.

  • VRAM limits: this will limit the overall number of textures you can have loaded at once without going out to slower system RAM. If the device supports it, texture streaming can work around it.

I found that article snippet from here: Maximum Texture for Mobile Devices in Unity

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.