Hi Irfan,I don't think it will make any difference moving to OpenGL ES 3.0 unless you *need* to use ETC2 since OpenGL ES 2.0 only supports ETC1.I suspect the problem must be in the texture loader code, not recognizing the output file from the Mali Texture Compression Tool.Can you tell us more about what engine or library code you are calling to load the textures? If I were investigating this I would try and debug the code to step through and find where the error message is generated, and which test is performed just before the error message is reported - this should narrow down which part of the file format the loader thinks is wrong.HTH, Pete
Hi Irfan,I didn't spot you posted about the same issue twice - I've merged the threads and deleted the duplicate post without the code.You are right that the ETC1 format used by OpenGL ES 2.0 doesn't contain an alpha channel, but plenty of OpenGL ES 2.0 games and examples manage translucent water effects, so you don't need to move to OpenGL ES 3.0 just for that reason. Since there are not many commercial devices supporting OpenGL ES 3.0 yet perhaps aim to do the effect under OpenGL ES 2.0 to maximise the target market?There are a few ways to use both ETC1 and have an alpha channel, essentially it comes down to 2 choices.1) you could double the height of the texture, and keep only RGB color data in the top half, and put the alpha channel in the bottom half in grayscale. Then, your fragment shader changes to sample the top half of the texture to get the color data and samples the same texel in the bottom half to read the alpha value.2) you could have 2 ETC1 textures, one holding color data and one holding alpha data coded as grayscale. You sample both textures in your fragment shader to form the complete RGBA texture data.We have some sample code and a document that goes into more depth on these techniques here:http://malideveloper...alpha-channels/From the code posted, it looks like if you see the message "Unable to read PKM file header" then the code wasn't able to read even the ETC1 header bytes. Could it be a problem with the InputStream itself? You could try changing the code to print how many bytes were able to be read (we only know it's not the number that are in an ETC1 header). If for instance it comes back zero then something has gone wrong trying to read the stream at all. If it reads some but not enough for an ETC1 header then perhaps the file has become corrupt and truncated somehow.HTH, Pete
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
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);
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