TextureFormat

Different data layouts for pixels in Image and Texture objects.

Formats starting with d are depth formats, used for depth/stencil render targets.

Formats starting with bc and astc are compressed formats. Compressed formats have better performance since they stay compressed on the CPU and GPU, reducing the amount of memory bandwidth required to look up all the pixels needed for shading.

Formats without the f suffix are unsigned normalized formats, which store values in the range [0,1]. The f suffix indicates a floating point format which can store values outside this range, and is used for HDR rendering or storing data in a texture.

ValueDescription
r8One 8-bit channel. 1 byte per pixel.
rg8Two 8-bit channels. 2 bytes per pixel.
rgba8Four 8-bit channels. 4 bytes per pixel.
r16One 16-bit channel. 2 bytes per pixel.
rg16Two 16-bit channels. 4 bytes per pixel.
rgba16Four 16-bit channels. 8 bytes per pixel.
r16fOne 16-bit floating point channel. 2 bytes per pixel.
rg16fTwo 16-bit floating point channels. 4 bytes per pixel.
rgba16fFour 16-bit floating point channels. 8 bytes per pixel.
r32fOne 32-bit floating point channel. 4 bytes per pixel.
rg32fTwo 32-bit floating point channels. 8 bytes per pixel.
rgba32fFour 32-bit floating point channels. 16 bytes per pixel.
rgb565Packs three channels into 16 bits. 2 bytes per pixel.
rgb5a1Packs four channels into 16 bits, with "cutout" alpha. 2 bytes per pixel.
rgb10a2Packs four channels into 32 bits. 4 bytes per pixel.
rg11b10fPacks three unsigned floating point channels into 32 bits. 4 bytes per pixel.
d16One 16-bit depth channel. 2 bytes per pixel.
d24s8One 24-bit depth channel and one 8-bit stencil channel. 4 bytes per pixel.
d32fOne 32-bit floating point depth channel. 4 bytes per pixel.
d32fs8One 32-bit floating point depth channel and one 8-bit stencil channel. 5 bytes per pixel.
bc13 channels. 8 bytes per 4x4 block, or 0.5 bytes per pixel. Good for opaque images.
bc2Four channels. 16 bytes per 4x4 block or 1 byte per pixel. Not good for anything, because it only has 16 distinct levels of alpha.
bc3Four channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for color images with transparency.
bc4uOne unsigned normalized channel. 8 bytes per 4x4 block or 0.5 bytes per pixel. Good for grayscale images, like heightmaps.
bc4sOne signed normalized channel. 8 bytes per 4x4 block or 0.5 bytes per pixel. Similar to bc4u but has a range of -1 to 1.
bc5uTwo unsigned normalized channels. 16 bytes per 4x4 block, or 1 byte per pixel. Good for normal maps.
bc5sTwo signed normalized channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for normal maps.
bc6ufThree unsigned floating point channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for HDR images.
bc6sfThree floating point channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for HDR images.
bc7Four channels. 16 bytes per 4x4 block or 1 byte per pixel. High quality. Good for most color images, including transparency.
astc4x4Four channels, 16 bytes per 4x4 block or 1 byte per pixel.
astc5x4Four channels, 16 bytes per 5x4 block or 0.80 bytes per pixel.
astc5x5Four channels, 16 bytes per 5x5 block or 0.64 bytes per pixel.
astc6x5Four channels, 16 bytes per 6x5 block or 0.53 bytes per pixel.
astc6x6Four channels, 16 bytes per 6x6 block or 0.44 bytes per pixel.
astc8x5Four channels, 16 bytes per 8x5 block or 0.40 bytes per pixel.
astc8x6Four channels, 16 bytes per 8x6 block or 0.33 bytes per pixel.
astc8x8Four channels, 16 bytes per 8x8 block or 0.25 bytes per pixel.
astc10x5Four channels, 16 bytes per 10x5 block or 0.32 bytes per pixel.
astc10x6Four channels, 16 bytes per 10x6 block or 0.27 bytes per pixel.
astc10x8Four channels, 16 bytes per 10x8 block or 0.20 bytes per pixel.
astc10x10Four channels, 16 bytes per 10x10 block or 0.16 bytes per pixel.
astc12x10Four channels, 16 bytes per 12x10 block or 0.13 bytes per pixel.
astc12x12Four channels, 16 bytes per 12x12 block or 0.11 bytes per pixel.

See also