# LibGDX - How do you load huge spritesheets?

As we know, there is a GL_MAX_TEXTURE_SIZE on each mobile phone which makes things really hard. I write an app for all mobile devices and I need to load some huge spritesheets combined with 64 frames when each of them has 512x1024 dimensions.

As I tested and read, I should load spritesheets <= 1024 so it will work on all mobile devices including IPhone3 and some old Androids.

If I have a spritesheet 512x1024 with 64 frames, it's dimensions are really, really large - for ex. if the spritesheet has 64 columns, it's with is ~61000 px.

Of course, I can cut it, but it gives me 64 images and I have no idea if this if efiicient of not.

How do you handle things like this? Scaling the graphics down is not an option - it lowers the quality and my game IS QUALITY.

If someone has any experience I would be grateful!

• Take a look at array textures in OpenGL. I don't know how the support for them is however with the platforms you want to support. – cozmic Jul 31 '16 at 9:10
• Is your situation similar to this? - stackoverflow.com/questions/21278675/… – WeirdElfB0y Aug 3 '16 at 10:33

I never tested it before on Android ... But on Desktop im doing it like following :

First I create a big spritesheet using a TexturePacker . I put those files into the project Folder .

Then I use the libgdx AssetManager to load those SpriteSheet ( TextureAtlas ) dynamicly.

I haven't tested it yet but I think it should also work on Android if you Pack your spritesheet into a textureAtlas and load it via AssetManager into your game :)

Going to test that tommorow, hope I helped ya a little bit =)

• is your spritesheet bigger than 4096x4096? – Jacob Aug 3 '16 at 6:11
• On Desktop ... Ya it is – genaray Aug 3 '16 at 7:25
• But OP has 64 frames each of which is 1024 pixels in width. So even by using Texture Packer, it will be a large atlas. – WeirdElfB0y Aug 3 '16 at 10:21
• it doesn't matter if it's large. Desktop allows to use max 4096 graphics, so texture atlas somehow overrules this and you can load bigger. I will test tomorrow :) – Jacob Aug 3 '16 at 21:11