Reputation: 6515
I'm building an OpenGL app with many small textures. I estimate that I will have a few hundred textures on the screen at any given moment.
Can anyone recommend best practices for storing all these textures in memory so as to avoid potential performance issues?
I'm also interested in understanding how OpenGL manages textures. Will OpenGL try to store them into GPU memory? If so, how much GPU memory can I count on? If not, how often does OpenGL pass the textures from application memory to the GPU, and should I be worried about latency when this happens?
I'm working with OpenGL 3.3. I intend to use only modern features, i.e. no immediate mode stuff.
Upvotes: 2
Views: 1552
Reputation: 2852
GL_COMPRESSED_RGBA
to your call to glTexImage2D
, see the man page for more details.Of course, as always, your best bet will be to test these things yourself in a situation close to your expected use case. OpenGL provides a good number of guarantees, but much will vary depending on the particular implementation.
Upvotes: 8