Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are mainly four texture compression types supported on Android:</p> <ul> <li><strong>ETC1 (Ericsson texture compression)</strong>. This format is supported by all Android phones. But, it doesn't support an alpha channel, so can only be used for opaque textures.</li> <li><strong>PVRTC (PowerVR texture compression)</strong>. Supported by devices with PowerVR GPUs (Nexus S, Kindle fire, etc.).</li> <li><strong>ATITC (ATI texture compression)</strong>. Used in devices with Adreno GPU from Qualcomm (Nexus One, etc.).</li> <li><strong>S3TC (S3 texture compression)</strong>. This texture compression is used in the NVIDIA chipset integrated devices (Motorola Xoom, etc.)</li> </ul> <p>More detailed information <a href="http://developer.motorola.com/docstools/library/understanding-texture-compression/" rel="noreferrer">here</a> and <a href="http://developer.android.com/guide/topics/graphics/opengl.html#textures" rel="noreferrer">here</a>.</p> <p>In short, if your textures don't have alpha, you can use ETC1. If they do have alpha, and you want to support all devices, you must have your textures compressed in the other three types and load them according to the device. </p> <p>How to use:</p> <ol> <li><p>Compress your png files (You can use a tool like <a href="http://devtools.ericsson.com/etc" rel="noreferrer">ETC-Pack</a>, <a href="http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp" rel="noreferrer">PVRTexTool</a>, <a href="http://developer.amd.com/tools/compressonator/Pages/default.aspx" rel="noreferrer">ATI Compressonator</a>, <a href="http://developer.nvidia.com/gpu-accelerated-texture-compression" rel="noreferrer">Nvidia Texure Tools</a> according to the type of texture) and add to your project assets.</p></li> <li><p>Determine which extensions are available in the device, if you're not using ETC1:</p> <pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig config) { String s = gl.glGetString(GL10.GL_EXTENSIONS); if (s.contains("GL_IMG_texture_compression_pvrtc")){ //Use PVR compressed textures }else if (s.contains("GL_AMD_compressed_ATC_texture") || s.contains("GL_ATI_texture_compression_atitc")){ //Load ATI Textures }else if (s.contains("GL_OES_texture_compression_S3TC") || s.contains("GL_EXT_texture_compression_s3tc")){ //Use DTX Textures }else{ //Handle no texture compression founded. } } </code></pre></li> <li><p>Load compressed texture as raw data.</p></li> <li><p>Use glCompressedTexImage2D instead of glTexImage2D:</p> <pre><code>public void onDrawFrame(GL10 gl) { .... gl.glCompressedTexImage2D(GL10.GL_TEXTURE_2D, level, internalformat, width, height, border, imageSize, data); } </code></pre></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload