When I want to use texture atlasing, should I try to place all of my sprites into one single texture atlas? Or are there times when I should have multiple smaller texture atlases?


2 Answers 2


Like many things in software, it's a balancing act. Fewer texture swaps is good, but getting textures that are too large can also hurt performance. Additionally, sprite sheets with a large number of sprites can be difficult to manage logistically.

To help manage larger sprite sheets, it's recommended that you keep your sprites separate, then join them into a sprite sheet for use in your game. You can use tools (both of which have very clever names) like:

Using these tools will allow you to ensure that animations that belong together end up on the same sprite sheet. That way you're not switching between textures mid animation.

Unfortunately there's no universal standard for maximum texture size. Not only that, but it varies from hardware to hardware, not just between graphics platforms. There are maximums that the graphics platforms can support though, but it doesn't mean the hardware supports it. Be sure to create a check with your game to ensure that you won't load a texture that's too large.

  • \$\begingroup\$ I intend to make a cross-platform game (desktops mainly, though possibly iOS). How much should I expect the maximum texture size to vary? \$\endgroup\$
    – Aaron
    Jun 28, 2012 at 22:30
  • 1
    \$\begingroup\$ I don't know much about the mobile limitations. For desktops it really depends on what range of hardware you want to support. I think 2048x2048 is a good middle to high number that most desktops would support. For iOS this thread looks promising. \$\endgroup\$
    – House
    Jun 28, 2012 at 22:44
  • \$\begingroup\$ Why add a unnecessary tool to the content pipeline when you can create the texture atlases just as well at run time via glTexSubImage? \$\endgroup\$
    – API-Beast
    Jun 28, 2012 at 23:46
  • \$\begingroup\$ Not to mention that you can be way more flexible that way because you can query the maximum texture size and don't have to guess. \$\endgroup\$
    – API-Beast
    Jun 28, 2012 at 23:51
  • 4
    \$\begingroup\$ (1) TexSubImage is often hellishly slow at runtime - you need very careful parameter selection; (2) you still need a method of selecting where images go in the atlas which TexSubImage will not give you; (3) TexSubImage will not solve the problem of which sprite sheet to put which image(s) on; (3) TexSubImage does not give you the ability to query the max size - glGet does and can still be used even with an external tool. \$\endgroup\$ Jun 29, 2012 at 0:23

The fewer textures the better. So one big one would be best. However, depending on your platform and language there is a size limit to an image. So if 2048 x 2048 px is the largest your image can be and your texture atlas is bigger than that, it would be best to have two smaller atlases.

  • 4
    \$\begingroup\$ +1, and - if you need more than one atlas - make sure that you group images that are going to be used together into the same atlas, otherwise each draw call may need to switch from one atlas to the other and the whole exercise will gain you nothing. \$\endgroup\$ Jun 28, 2012 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .