I am creating an OpenGL game that will use texture atlases to load a lot of artwork.
Texture atlases are good because you load your image once and then cut sprites out of it. You save the time that would be necessary to load all files from disk, if they were independent and you save memory to store the images. But in my mind, beyond a certain point this benefit will not be that true, right? My idea is that if the texture atlas is very huge, you will waste a lot of memory to store it and perhaps some of the sprites on it will not be used that frequently.
What is the best approach for that? divide in multiple sprites? a sprite for level or what?
Anyway, my question is this: what is the size in pixels that corresponds the maximum an atlas should have to be considered a benefit?
GL_MAX_TEXTURE_SIZE
xGL_MAX_TEXTURE_SIZE
. A very real problem is that a texture cannot be "partially resident" in OpenGL ES (you tagged this question for the wrong version of GL, BTW), so you don't want to use a MAX SIZE texture and waste 90% of your memory on empty space, or force textures that are almost never referenced to stay resident just because some other much more common texture is always referenced. At that point you start to undo the benefits of individual texture caching. – Andon M. Coleman