Search code examples
androidgraphicsopengl-estextures

Loading more smaller textures vs. loading few large textures in OpenGL Android


I'm developing a 2-D Android game lately and I'm using GLSurafaceView (OpenGL ES) to render textures. I combine graphics into sprite-sheets and load them into device memory (GPU). Recently the amount of graphics grew by quite a bit..

I need to make a decision regarding which approach is better and why. Hence, should I load 2-3 large 2048x2048 sprite-sheets, or 8-12 smaller 1024x1024 sprite-sheets?

How would each of these approaches affect performance, loading time of the game, memory consumption?


Solution

  • Fewer larger sprite sheets will generally be better, because of:

    • Fewer state changes needed.
    • Easier to batch draw calls.

    That said, 8-12 sheets doesn't count as a lot in my book. If you have a few hundred then I'll start getting worried ;)