0

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?

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Sergey Emeliyanov
  • 5,158
  • 6
  • 29
  • 52
  • See: [Multiple textures/texture atlas](https://gamedev.stackexchange.com/q/137225/6883) and [One single texture atlas?](https://gamedev.stackexchange.com/q/31315/6883) – Morrison Chang Jul 06 '19 at 23:44
  • @MorrisonChang Thank you, btw I've read those already. Still unsure in case of Android, maybe a person with specific Android/GLSurfaceView experience would provide a more precise answer.. – Sergey Emeliyanov Jul 06 '19 at 23:48
  • If you are trying to optimize your graphics then you may want to provide more info about how you've implemented your game. Did you use OpenGL ES 1.x/ 2.x or 3.x, did you use [VBOs](https://www.youtube.com/watch?v=U4Bk5rmIpic&t=2660s), did you use any [Texture Compression](https://stackoverflow.com/q/9148795/295004)? And what is your minimum hardware / target hardware? – Morrison Chang Jul 07 '19 at 00:35
  • @MorrisonChang, OpenGL ES 1.0, I'm targeting all Android devices, the app is public in store, it runs without any problem on all devices I might need, I just want to select a better approach with sprite-sheet sizes. – Sergey Emeliyanov Jul 07 '19 at 08:51
  • OpenGL ES 1.x is basically obsolete - no new game should be targeting it. Nearly all Android devices on the market support OpenGL ES 2.0, so that is a reasonable lowest bar (and much more future-proof than ES 1.x, as 3.x is basically just a super-set of 2.0). – solidpixel Jul 08 '19 at 13:54
  • @solidpixel I'm perfectly happy with functionality of OpenGl 1.x, but thank you for suggestion. – Sergey Emeliyanov Jul 09 '19 at 08:24
  • Just to add, the best way to know if it will be faster/slower, is to try both approaches and profile them. – Reaper Jul 12 '19 at 08:25

1 Answers1

1

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 ;)

solidpixel
  • 10,688
  • 1
  • 20
  • 33