Performance of Textures

Started by Cornix, March 24, 2013, 22:29:35

Previous topic - Next topic

Cornix

Hi,
I have a theoretical question, out of curiousity you could say.

If i have several textures which are used in an application, what would be the most efficient/fastest way to use them:
(We assume all sprites are sorted by their texture so that glBindTexture is only called once for each texture we use.)
(Also, every texture is bound every frame.)

1). Only few textures which are very big but compine several otherwise smaller textures as sub-images. (atlas)

2). Having a single, big texture array with all used textures.

3). Having many rather small textures

Right now i always went with 1). but i really havent needed many textures anyway. In the future that might change though.

Thanks for your answers.

quew8

OpenGl implementations have a maximum texture size. Provided that your one texture to rule them all is not bigger than this then I would have to say option 2. Purely because this means you only have to bind the one texture at the start of the program. Although the difference between options 1 and 2 would likely be minuscule as well as being dependent on the particular implementation and size / number of textures.
Just had a thought though.You could have several different large textures bound to different texture units to augment option 1.
In conclusion:
Option 3 is slowest.
Options 1 and 2, your guess is as good as mine.