Bad texture on android devices with lower GL_MAX_TEXTURE_SIZE

I recently tested one of my games on multiple Android devices. During this I came across a strange encounter with the Galaxy S2. When I launched the game, the whole game was working fine except for the background. The background of the game looked black instead of the intended texture. While searching the internet, I came across this forum and realized that it was a bad texture problem on the Galaxy S2, because the background image for the game was contained in a separate and very large sprite sheet (4096), while the rest of the game was contained in less. From this I figured it was related to GL_MAX_TEXTURE_SIZE.

Now my question is, is it possible for a device with a large display like Google Nexus 10 (2560 width) to have GL_MAX_TEXTURE_SIZE, maybe 2048?

Also, what is the most common GL_MAX_TEXTURE_SIZE on Android devices, and how to deal with such problems if you also want your application to serve very high resolution devices?

+3


source to share


1 answer


Yes, perhaps unfortunately.

Mobile devices may differ from one another. The OpenGL ES 2.0 specification says that the minimum GL_MAX_TEXTURE_SIZE is only 64! Therefore, it is a good habit to check the hardware caps in your game. Vendors only need to maintain the minimum specification and the rest is their choice.

see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml for some information on the minimum limits of opengl ES 2.0.

here: http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/DeterminingOpenGLESCapabilities/DeterminingOpenGLESCapabilities.html there is information that:

PowerVR MBX supports graphics texture support up to 1024 x 1024 in size, while PowerVR SGX software supports textures up to 2048 x 2048; both are well over 64 x 64, which is the minimum size required by the OpenGL ES specification. If your applications need exceeds the minimum capabilities required by the OpenGL ES specification, it should request an implementation to test hardware capabilities and finesse; you can load less texture or choose a different rendering strategy.



It's from the iPhone ... but the same hardware can be found on Android devices as well.

In OpenGL ES 3.0, the minimum GL_MAX_TEXTURE_SIZE is 2048 http://www.khronos.org/opengles/sdk/docs/man3/xhtml/glGet.xml

what to do? OpenGL provides a decent and unified programming layer that you can use to build your applications. But there are still some differences between platforms and hardware. Usually in the game engine we test this feature and then do a rollback to make sure it works even with the minimum requirements. There is no single answer to your question. It depends on the problem.

for texture size I think you can cut a large texture into several smaller chunks and then display it with a few rectangles / squares

+3


source







All Articles