I have modified the technique slightly see the new modified vertex controller code.
depth is just an index to which texture you want to apply to the polygon.
Each texture is 32*32 if you want to use more just reduce the multiplier to 16 to give 16*16 textures or make the main 256*256 texture larger.
# 256 is the texture size
# 32 is the size of each subtexture
/**
* this is the fraction of the texture that represents 1 sub texture
*/
public static float SUBTEXTURE = (float) ((1.0 / 256.0) * 32);
/**
* this is the fraction of the texture that represents the inside of sub texture take away half a
* pixel from the edge of the texture
*/
public static float INTERNALSUBTEXTURE = (float) ((1.0 / 256.0) * 32 - (1 / 256));
depth is just an index to which texture you want to apply to the polygon.
Each texture is 32*32 if you want to use more just reduce the multiplier to 16 to give 16*16 textures or make the main 256*256 texture larger.
# 256 is the texture size
# 32 is the size of each subtexture
/**
* this is the fraction of the texture that represents 1 sub texture
*/
public static float SUBTEXTURE = (float) ((1.0 / 256.0) * 32);
/**
* this is the fraction of the texture that represents the inside of sub texture take away half a
* pixel from the edge of the texture
*/
public static float INTERNALSUBTEXTURE = (float) ((1.0 / 256.0) * 32 - (1 / 256));