I Tried "Mali GPU Texture Compression Tool" for converrting my images from jpeg to etc1.
I Use the Following Params to achieve Pefect results with Jpeg Texture
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
I user Follwoing Params with Etc1
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameterf(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);
Hi subrhmanyam,
Thanks for posting. Can you give us any more information about the issue that you have encountered? Where are you seeing the corruption - is it visible within the texture compression tool or only after it is displayed by GLES? In what way is the image not as expected?
Ta,
Mark
I have seen the Texture in the Tool it looks fine, The Problem is with Displaying on OpenglSide.
Am reading the PKM file from Compression tool .
Chopping the header (16 bytes) & reading the data the size am giving to the Opengl is - > (w * h) /2 and the data buffer .
Agree with Mark, need a bit more information to go on, preferably an image of the corruption and a picture of the expected output?
Also why are you using different texture parameters in either case? Is this an attempt to solve the issue? Filtering rather than taking the nearest texel will cause different rendering results, as will the clamp if you are specifying coordinates outside the 0.0 -> 1.0 range.
Thanks,
Chris
Yes Chris,
I tried with Nearest it didnot work i was Thinking Linear would Do better Interpolation .
glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES, imagePtr->getWidth(), imagePtr->getHeight(), 0, (imagePtr->getWidth() * imagePtr->getHeight())/2, imagePtr->getData());
If it looks ok in the tool then it must be the way you're specifying the data. What is the format, RGB565? How many bits per pixel? Are you specifying that the texture is ETC compressed or is it still expecting uncompressed data? For example you should switch to calling glCompressedTexImage2D, with the internal format of ETC1_RGB8_OES if it's RGB888 data.
Interesting, nothing obvious then. Could you provide some images of the corruption and the expected output?
i would try to get some data but may take time , may b couple hours . I would make this answered and would upload the details later