In the PVRshell Texture in the trainingcourse 4, the texture is defined as

*TEX_SIZE = 128;*

*GLuint* pTexData1 = new GLuint[TEX_SIZE*TEX_SIZE];*

for (int i=0; i<TEX_SIZE; i++)

for (int j=0; j<TEX_SIZE; j++)

{

GLuint col = (255L<<24) + ((255L-j*2)<<16) + ((255L-i)<<8) + (255L-i*2);

if ( ((i*j)/8) % 2 ) col = (GLuint) (255L<<24) + (255L<<16) + (0L<<8) + (255L);

pTexData1[j*TEX_SIZE+i] = col;

}

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEX_SIZE, TEX_SIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexData1);

delete [] pTexData1;

for (int i=0; i<TEX_SIZE; i++)

for (int j=0; j<TEX_SIZE; j++)

{

GLuint col = (255L<<24) + ((255L-j*2)<<16) + ((255L-i)<<8) + (255L-i*2);

if ( ((i*j)/8) % 2 ) col = (GLuint) (255L<<24) + (255L<<16) + (0L<<8) + (255L);

pTexData1[j*TEX_SIZE+i] = col;

}

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEX_SIZE, TEX_SIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexData1);

delete [] pTexData1;

*TEX_SIZE = 128;*

for i=1:TEX_SIZE

for j=1:TEX_SIZE

R = 255;

G = 255-j*2 ;

B = 255-i;

A = 255-i*2;

if (mod((i*j)/8,2))

R = 255;

G = 255;

B = 0;

A = 255;

end

pTexData(i,j,1)= R;

pTexData(i,j,2)= G;

pTexData(i,j,3)= B;

end

end

pTexData = uint8(pTexData);

imagesc (pTexData); figure(gcf)

for i=1:TEX_SIZE

for j=1:TEX_SIZE

R = 255;

G = 255-j*2 ;

B = 255-i;

A = 255-i*2;

if (mod((i*j)/8,2))

R = 255;

G = 255;

B = 0;

A = 255;

end

pTexData(i,j,1)= R;

pTexData(i,j,2)= G;

pTexData(i,j,3)= B;

end

end

pTexData = uint8(pTexData);

imagesc (pTexData); figure(gcf)