I'm making a 2D game with OpenGL. In order to avoid changing the state machine and binding at runtime, I want to make consolidate my textures into bigger textures,

for example, taking 4 128x128 textures and making 1 big 512x512. I could then just render part of the texture rather than binding a new one.

Is this a good idea? Could my newly created texture get lost, or are there major faults in doing this?


  • \$\begingroup\$ it really depends on the case you are using, for example to create a tilemap, it's much more efficient to use single texture from begining. or character animations are usually stored as spreadsheet. \$\endgroup\$
    – Ali1S232
    Jun 11, 2011 at 4:32
  • 3
    \$\begingroup\$ Did you identify this as a major performance problem in your project? If not, then this falls into the category premature optimizations and that in fact is a major fault. \$\endgroup\$ Jun 11, 2011 at 9:06

1 Answer 1


Yes, in general, to it being a good idea. OpenGL generally has transparent loss mechanisms, that is, if a texture is lost, you won't notice it.

The idea of making multiple textures into one large texture has been explored. This is called "Texture Atlasing". There are faults with it if you try to make an atlas that is greater than the maximum texture size of the graphics card (which on modern cards is quite large, 8Kx8K or so).

There are pathological cases where texture atlasing will not improve performance, but with discrete graphics cards offering >> 512MB of video memory on low end cards, I don't think you'll run into any of these type problems. I wouldn't concern yourself too much with performance optimizations if you are developing for the desktop systems until it is clear that they are needed -- and what an epic title it must be then! ;)


You must log in to answer this question.

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