When format GL_RGB5_A1 is used with unsigned_byte texture data (no mipmap), the applied texture is blocky with min/mag filters GL_NEAREST. When same code used for format GL_RGBA8, the applied texture is smooth. My assumption was that for RGBA8 too using GL_NEAREST filters the texture image should be blocky as attached. OPGNELES 3.0 supports this format and type for textures. Its a 3D texture of size 256x256x256 applied using glTexImage3D and viewport is set for 640x480. Texture is generated as below
for(k = 0; k < 256; k++) for(j = 0; j < 256; j++) for(i = 0; i < 256; i++)
{
pUBPointer[0] = 255-i;
pUBPointer[1] = 255-j;
pUBPointer[2] = 255-k;
pUBPointer[3] = 0xFF;
pUBPointer += 4;
}
Is it expected?
- Image for format RGB5_A1
- Image for format RGBA8