PDA

View Full Version : Android, ES1.1, ETC1, Mipmaping



MagicPockets
08-19-2011, 04:19 AM
When I activate the mipmaping on uncompressed texture, all is working perfectly.

When I do it on ETC1 texture, the texture is blank, certainly because the complete set of mipmaps was not given.

The code is very simple and works on iPhone (with PVR compression, of course).

It doesn't work on Android. The mipmap was build with an external tool on PC, and past together to an unique file containing all the plan, untill size of 4x4.

I stop making mipmap at the size of 4, because glCompressedTexImage2D return an opengl error if try using mipmap lower.

the code is here:

for(u32 i=0; i<=levels; i++)
{
size = KC_TexByte(pagex, pagey, tex_type);
glCompressedTexImage2D(GL_TEXTURE_2D, i, type, pagex, pagey, 0, size, ptr);
pagex = MAX(pagex/2, 4);
pagey = MAX(pagey/2, 4);
ptr += size;
KC_Error(); // test openGL error
}

dorbie
08-29-2011, 11:22 AM
You are supposed to send a 4x4 tile for the smallest MIP LODS.

Make sure size is correct for the tile you send.