Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android devices GL_MAX_TEXTURE_SIZE limitation, safe texture size

I am working with AndEngine and OpenGL ES 2.0. I keep reading about GL_MAX_TEXTURE_SIZE and how I should keep my texures under 1024x1024. I started wrong before and while using tilesets in TMX extension (doesn't really matter what it is, if you don't know AndEngine) I get to a tileset that makes a texture wider than 1024px. I am thinking of splitting the tileset into two, making them "safe". But I can't find any device released in last couple of years that has this limit set under 2048x2048. Is there any list or website I can use to filter devices by GL_MAX_TEXTURE_SIZE?


I read the following questions:

  • Minimum required Texture Size for compliance with OpenGL-ES 2.0 on Android?
  • Is there any Android device with screen size greater than GL_MAX_TEXTURE_SIZE?

And I used this site to search for devices. But I can't search by/filter by GL_MAX_TEXTURE_SIZE, which makes the search tedious. I am asking mostly because I started wrong, it's a hobby project and the amount of work might be too large compared to the number of possible devices that will be enabled (I expect 0).

like image 635
MartinTeeVarga Avatar asked Jun 05 '13 03:06

MartinTeeVarga


2 Answers

1024x1024 is about the safest you can go on any device, especially on older ones. Newer devices shouldn't have any problem, although I've seen recent devices (I recall a Galaxy Nexus, the newest ICS update fixed that though) render white quads with texture sizes of size 2048x1024.

If you're targeting new devices and want to keep older ones compatible, it shouldn't hurt to split your tilesets. After all, you aren't likely to do too many context switches if you use two or three spritesheets for background, etc.

like image 99
RedOrav Avatar answered Jan 02 '23 08:01

RedOrav


If you still have the individual image files, breaking them into small sized Atlases or custom sized atlases is easy if you use the TexturePacker2 tool from the LibGdx library.

I don't know the exact limitation of devices, but it's always better to take into consideration the lowest end of device you want to support and build upward from there. Using the LibGdx tool, you can easily change your mind later, so it's the most flexible solution.

Look at: LibGdx TexturePacker

like image 27
Umz Games Avatar answered Jan 02 '23 07:01

Umz Games