0
\$\begingroup\$

I'm creating a game with pretty basic graphics (numbers, blocks, words, and a few nice design elements for the logo and such). My question is: can I create everything in a very high resolution- say 2048x2048- and just let libGDX scale these depending on the screen size? The reason I ask is because I've seen questions that ask about creating a copy of the assets in various resolutions. What's wrong with just using one asset set that's a very high resolution on all devices?

\$\endgroup\$
  • \$\begingroup\$ It's called mipmapping. It's done for performance reasons. \$\endgroup\$ – LiquidFeline Jan 1 '15 at 6:43
1
\$\begingroup\$

I've never used libGDX but textures Cost a lot of memory in general. Which isn't a big deal on PC but you have to watch out with mobile devices which have limited resources.

Let's say you have a device with 256MB of memory, you have 10 textures in your scene and each texture is about 8MB (assuming we're using 2048x2048 32-bit png). Thats using about 30% of your total ram!

That and some devices have hardware limitation on texture sizes.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

If you let your library scale down the textures and drop the originals from memory then you will not have any problems with memory consumption. Your load times will however increase drastically, along with the download size and storage space needed for your game.

If you are going to ship on phones then you should definitely scale your textures lower than you would for PC, the small phone screens simply don't benefit from very high resolution textures.

Some games have a high and a low resolution texture pack on the same platform, allowing those who don't need or want the high resolution textures to not download them at all. A simpler approach is to have the game generate the low resolution textures if needed, and then store them on disk so that they can be loaded directly next time, thus decreasing loading times.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.