This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
Parents
  • Note: This was originally posted on 23rd March 2013 at http://forums.arm.com

    Hi,

    sounds like good progress! If the rest of the code is running without errors but you aren't seeing textures then my next guess is that OpenGL ES does not believe the texture is "complete". For instance, OpenGL ES defaults to using a minifying texture filtering mode using mipmaps. If you upload only the original base level of the texture, OpenGL ES will believe the other levels are missing, and refuse to render anything.

    There are 2 ways to solve this. The quickest and easiest is probably to change the filtering mode so OpenGL ES does not expect to find mipmap levels:


    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);


    though you should note that if you display many of your textures on geometry smaller than the original texture size this will mean less efficient usage of the texture cache and may be sub optimal.

    The alternative (which makes better use of the texture cache) is to ask the Mali Texture Compression Tool to generate compressed textures for each mipmap level (e.g. 8x8, 4x4, 2x2 and 1x1) and load each one into the appropriate mipmap level:


    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES, 8, 8, 0, 32, pMipmapLevel0);
    glCompressedTexImage2D(GL_TEXTURE_2D, 1, GL_ETC1_RGB8_OES, 4, 4, 0,  8, pMipmapLevel1);
    glCompressedTexImage2D(GL_TEXTURE_2D, 2, GL_ETC1_RGB8_OES, 2, 2, 0,  2, pMipmapLevel2);
    glCompressedTexImage2D(GL_TEXTURE_2D, 3, GL_ETC1_RGB8_OES, 1, 1, 0,  1, pMipmapLevel3);


    Then OpenGL ES will select the most appropriate mipmap level for the size of the textured triangle on screen, and not waste space in the texture cache loading lots of texel data that will never be sampled.

    HTH, Pete
Reply
  • Note: This was originally posted on 23rd March 2013 at http://forums.arm.com

    Hi,

    sounds like good progress! If the rest of the code is running without errors but you aren't seeing textures then my next guess is that OpenGL ES does not believe the texture is "complete". For instance, OpenGL ES defaults to using a minifying texture filtering mode using mipmaps. If you upload only the original base level of the texture, OpenGL ES will believe the other levels are missing, and refuse to render anything.

    There are 2 ways to solve this. The quickest and easiest is probably to change the filtering mode so OpenGL ES does not expect to find mipmap levels:


    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);


    though you should note that if you display many of your textures on geometry smaller than the original texture size this will mean less efficient usage of the texture cache and may be sub optimal.

    The alternative (which makes better use of the texture cache) is to ask the Mali Texture Compression Tool to generate compressed textures for each mipmap level (e.g. 8x8, 4x4, 2x2 and 1x1) and load each one into the appropriate mipmap level:


    glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES, 8, 8, 0, 32, pMipmapLevel0);
    glCompressedTexImage2D(GL_TEXTURE_2D, 1, GL_ETC1_RGB8_OES, 4, 4, 0,  8, pMipmapLevel1);
    glCompressedTexImage2D(GL_TEXTURE_2D, 2, GL_ETC1_RGB8_OES, 2, 2, 0,  2, pMipmapLevel2);
    glCompressedTexImage2D(GL_TEXTURE_2D, 3, GL_ETC1_RGB8_OES, 1, 1, 0,  1, pMipmapLevel3);


    Then OpenGL ES will select the most appropriate mipmap level for the size of the textured triangle on screen, and not waste space in the texture cache loading lots of texel data that will never be sampled.

    HTH, Pete
Children
No data