Android Game Development Blog

A blog on Android game development by Douglas Tanner

Android ATITC (ATC) texture encoding and performance

As I discussed before in my blog post about PVRTC texture encoding and performance, every Android OpenGL ES 2.0 phone supports at least two texture formats: ETC1 and one of the three proprietary formats (PVRTC, ATITC and S3TC). I just got myself a cheap second-hand Nexus One (with an Adreno 200 graphics chip), so I wanted to test out the ATI-specific texture format and see what the trade-offs are vs. ETC1 texture performance.

    Get the Adreno SDK
Get from the Qualcomm developer website. Free registration is required (WARNING: They send you your own password in plaintext). Once installed it will be placed in C:\Program Files (x86)\Qualcomm\AdrenoSDK\.

    Encoding ATC textures

Unlike with PVRTC, the SDK does not contain a stand-alone executable, it contains a library that has to be directly linked into your packing program. The documentation explaining in detail how to do that is located in AdrenoSDK\Tools\Texture Converter\docs. After including the appropriate header file (TextureConverter.h) and linking with the library (TextureConverter.lib), your code will look something like the following (this is directly based on AdrenoSDK\Tools\Texture Converter\samples\Convert.c).

The first step is to initialize the source image (in my case a .tga file):

Then we setup the destination image (either ATITC_RGB or ATITC_RGBA):

Finally we do the actual conversion from .tga to ATC:

    Loading ATC textures

Nothing special needs to be done to load ATC textures, just make a regular call to glCompressedTexImage2D with the right constant (substitute GL_ATC_RGBA_EXPLICIT_ALPHA_AMD for ATC alpha textures).

    ATC texture performance

For my test case setup, read blog post on ETC1 texture performance. The only difference is that these results are from a Nexus One which has an Adreno 200 instead of the PowerVR SGX on my Milestone. These are the results I got:

These results are very interesting, they show that the graphics architecture of the Nexus One is vastly different from that of the Milestone. There is absolutely no performance hit to using uncompressed textures, compared to a setup that was giving me a 13-33 fps difference between compressed and uncompressed on my Milestone. It's definitely worth using compressed textures for the file size difference, but unless your game has some crazy-complex textures you'll probably be fine with the more compatible ETC1 format.

However, one thing I will mention is that the ATC texture format is subjectively 'better looking' than the ETC1 format (to my eyes anyway). This is possibly due to better hardware decoding/interpolation support. When I manage to get my hands on a phone that supports S3TC I think I'll do an in-depth visual quality comparison between the four formats.

Next time I will show you how to find free 2D game art.