TextureFormat
EditDifferent 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.
Value | Description |
r8 | One 8-bit channel. 1 byte per pixel. |
rg8 | Two 8-bit channels. 2 bytes per pixel. |
rgba8 | Four 8-bit channels. 4 bytes per pixel. |
r16 | One 16-bit channel. 2 bytes per pixel. |
rg16 | Two 16-bit channels. 4 bytes per pixel. |
rgba16 | Four 16-bit channels. 8 bytes per pixel. |
r16f | One 16-bit floating point channel. 2 bytes per pixel. |
rg16f | Two 16-bit floating point channels. 4 bytes per pixel. |
rgba16f | Four 16-bit floating point channels. 8 bytes per pixel. |
r32f | One 32-bit floating point channel. 4 bytes per pixel. |
rg32f | Two 32-bit floating point channels. 8 bytes per pixel. |
rgba32f | Four 32-bit floating point channels. 16 bytes per pixel. |
rgb565 | Packs three channels into 16 bits. 2 bytes per pixel. |
rgb5a1 | Packs four channels into 16 bits, with "cutout" alpha. 2 bytes per pixel. |
rgb10a2 | Packs four channels into 32 bits. 4 bytes per pixel. |
rg11b10f | Packs three unsigned floating point channels into 32 bits. 4 bytes per pixel. |
d16 | One 16-bit depth channel. 2 bytes per pixel. |
d24 | One 24-bit depth channel. 4 bytes per pixel. |
d24s8 | One 24-bit depth channel and one 8-bit stencil channel. 4 bytes per pixel. |
d32f | One 32-bit floating point depth channel. 4 bytes per pixel. |
d32fs8 | One 32-bit floating point depth channel and one 8-bit stencil channel. 5 bytes per pixel. |
bc1 | 3 channels. 8 bytes per 4x4 block, or 0.5 bytes per pixel. Good for opaque images. |
bc2 | Four channels. 16 bytes per 4x4 block or 1 byte per pixel. Not good for anything, because it only has 16 distinct levels of alpha. |
bc3 | Four channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for color images with transparency. |
bc4u | One unsigned normalized channel. 8 bytes per 4x4 block or 0.5 bytes per pixel. Good for grayscale images, like heightmaps. |
bc4s | One 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. |
bc5u | Two unsigned normalized channels. 16 bytes per 4x4 block, or 1 byte per pixel. Good for normal maps. |
bc5s | Two signed normalized channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for normal maps. |
bc6uf | Three unsigned floating point channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for HDR images. |
bc6sf | Three floating point channels. 16 bytes per 4x4 block or 1 byte per pixel. Good for HDR images. |
bc7 | Four channels. 16 bytes per 4x4 block or 1 byte per pixel. High quality. Good for most color images, including transparency. |
astc4x4 | Four channels, 16 bytes per 4x4 block or 1 byte per pixel. |
astc5x4 | Four channels, 16 bytes per 5x4 block or 0.80 bytes per pixel. |
astc5x5 | Four channels, 16 bytes per 5x5 block or 0.64 bytes per pixel. |
astc6x5 | Four channels, 16 bytes per 6x5 block or 0.53 bytes per pixel. |
astc6x6 | Four channels, 16 bytes per 6x6 block or 0.44 bytes per pixel. |
astc8x5 | Four channels, 16 bytes per 8x5 block or 0.40 bytes per pixel. |
astc8x6 | Four channels, 16 bytes per 8x6 block or 0.33 bytes per pixel. |
astc8x8 | Four channels, 16 bytes per 8x8 block or 0.25 bytes per pixel. |
astc10x5 | Four channels, 16 bytes per 10x5 block or 0.32 bytes per pixel. |
astc10x6 | Four channels, 16 bytes per 10x6 block or 0.27 bytes per pixel. |
astc10x8 | Four channels, 16 bytes per 10x8 block or 0.20 bytes per pixel. |
astc10x10 | Four channels, 16 bytes per 10x10 block or 0.16 bytes per pixel. |
astc12x10 | Four channels, 16 bytes per 12x10 block or 0.13 bytes per pixel. |
astc12x12 | Four channels, 16 bytes per 12x12 block or 0.11 bytes per pixel. |