ETC1 textures

Hi!

what is the standard procedure to get ETC1 textures on Android?

I’m been looking at MGCB and I’m unable to understand which is the process which converts a texture into ETC1 (if any)

Thanks!
Kak

Hi!

I found that Mali has an excellent tool to convert JPEG and PNG files to ETC1. When using no mipmaps it just works, but adding mipmaps make all my textures black (even in the first mipmap).

I’ve moved the example to using a Color surface instead of Etc1 and I’m still having the problems with the mipmaps. It works on Windows though!

Is there any example somewhere showing how to create a texture with mipmaps in android?

This is my code:

Color []createColorArray (int width,int height,Color color)
{
    var colorArray=new Color[width*height];
    for (int i=0;i less than colorArray.Length;i++) colorArray[i]=color;
    return colorArray;
}

// test
    Texture2D tex=new Texture2D (g.GraphicsDevice,256,256,true,SurfaceFormat.Color);
    Color []colorArray;

colorArray=createColorArray (256,256,Color.Red);
    tex.SetData (0,null,colorArray,0,colorArray.Length);

colorArray=createColorArray (128,128,Color.Blue);
    tex.SetData (1,null,colorArray,0,colorArray.Length);

colorArray=createColorArray (64,64,Color.Green);
    tex.SetData (2,null,colorArray,0,colorArray.Length);

return tex;

This creates a texture with some mipmaps in Windows. The enemies move from red on close to blue and green as you get far from them.

Is there any reason it shouldn’t work in Android?

Thanks!
Kak