Forums - Use ATITC Texture Mipmap Failed

4 posts / 0 new
Last post
Use ATITC Texture Mipmap Failed
648179967
Join Date: 12 Dec 13
Posts: 4
Posted: Thu, 2014-06-26 03:52

Hi all

    I use QCompress.exe generate dds with mipmap,format is Q_FORMAT_ATITC_RGBA.And use glCompressedTexImage2D generate mipmap,but the mipmap is error.How to use dds generate compress texture mipmap? 

 code:

 

GLuint * textures = new GLuint[1];
glGenTextures(1, textures);    
int currTextureId=textures[0];    
glBindTexture(GL_TEXTURE_2D, currTextureId);
 
 
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);  
 
int width,height;
width = height = 1024;
 
int size = (((width + 3) >> 2) * ((height + 3) >> 2))*16;
int offset = 0;
 
for(int i = 0; i < 11;i++)
{
LOGI("offset          : %d\n",(int)offset);
LOGI("size            : %d\n",(int)size);
glCompressedTexImage2D( GL_TEXTURE_2D, i, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, width,  height,  0, size ,  texturebuffer + offset );
checkGlError("glCompressedTexImage2D");
width /=2; 
height /=2; 
offset += size;
size = (((width + 3) >> 2) * ((height + 3) >> 2))*16;
 

   

Thanks ALL

  • Up0
  • Down0
mtrusten
Join Date: 24 Jun 14
Posts: 1
Posted: Thu, 2014-06-26 09:03

Thanks for posting the code. This helps a lot. One question I have still is what error are you receiving from GL?

? = checkGlError("glCompressedTexImage2D");

This will greatly help in being able to quickly find the issue.

  • Up0
  • Down0
648179967
Join Date: 12 Dec 13
Posts: 4
Posted: Thu, 2014-06-26 18:29

Thanks for reply

static void checkGlError(const char* op)
{
    for (GLint error = glGetError(); error; error = glGetError())
    {
        LOGI("after %s() glError (0x%x)\n", op, error);
    }
}
 
glGetError return nothing.But i use Adreno Profiler,capture frame ,the texture mipmap is not correct.The GL_ATC_RGBA_EXPLICIT_ALPHA_AMD is not generate mipmap?
 
Thanks!
  • Up0
  • Down0
Dave Astle
Profile picture
Join Date: 19 Oct 12
Location: San Diego, CA
Posts: 99
Posted: Mon, 2014-07-07 09:55

It looks like there may be an issue with Qcompress correctly generating DDS files. Are you able to try using KTX instead to see if you still experience this problem?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.