2

I'm trying to lower my memory usage by using RGBA4444_COMPRESSED format for SpriteKit atlas folders (not asset catalogs).

Using Allocation tool in Instruments shows that the 2048x2048 atlas texture still take ~16MB of memory when I preload the atlas.

I assumed that RGBA4444 should only consume half the amount of memory compared to RGBA8888.

I testing with iPad Air and iOS9.0.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Min Tsai
  • 2,139
  • 21
  • 17

1 Answers1

0

I attempted to load different kinds of textures into SpriteKit, but it seems that everything including 24BPP pixels is represented as 1 word (32BPP) for each pixel. It is possible to load smaller pixel formats directly into OpenGL, but it seems that the OpenGL and Metal compat stuff in SpriteKit means that 32BPP is the common pixel format that is used for all textures. If you want to have a look at a form of texture compression built on top of SKTexture, take a look at this SO answer which can save about 75% of memory in the best case.

Community
  • 1
  • 1
MoDJ
  • 4,309
  • 2
  • 30
  • 65