Link to channel packing. Minor formatting changes. |
size comparison, assorted tweaks |
||
| (One intermediate revision by one other user not shown) | |||
| Line 9: | Line 9: | ||
BCn formats are a method of compression optimized for GPUs, not file size. Additional compression is applied on top of BCn compressed textures to save on file size. | BCn formats are a method of compression optimized for GPUs, not file size. Additional compression is applied on top of BCn compressed textures to save on file size. | ||
Crunch compression is a lossy format that discards data to reduce the file size of textures with a trade off of visual quality. The Non Perceptual variants are compressed without considering sRGB color space information. | Crunch compression is a lossy format that discards data to reduce the file size of textures (but not their VRAM usage) with a trade off of visual quality. The Non Perceptual variants are compressed without considering sRGB color space information. | ||
LZMA compression is a lossless format, meaning no data is discarded during compression. The result is less file size reduction but visual quality is retained. Even though LZMA is lossless, BCn is lossy, so switching a texture to LZMA can only prevent quality loss caused by crunch compression. | LZMA compression is a lossless format, meaning no data is discarded during compression. The result is less file size reduction but visual quality is retained. Even though LZMA is lossless, BCn is lossy, so switching a texture to LZMA can only prevent quality loss caused by crunch compression. | ||
== Size comparison == | |||
The following table lists how many bits each format dedicates per pixel, as well as how much VRAM a 1024x1024 texture using it would take up. Note that the actual size will be about 36% larger by default due to [[mipmap]]s (smaller versions of the texture for smoother rendering from far away). | |||
{| class="wikitable" | |||
! Format !! Bits per pixel !! MB per 1K texture | |||
|- | |||
| RawRGBA || 32 || 4 | |||
|- | |||
| RawRGBAHalf || 64 || 8 | |||
|- | |||
| BC1 || 4 || 0.5 | |||
|- | |||
| BC3 || 8 || 1 | |||
|- | |||
| BC3nm || 8 || 1 | |||
|- | |||
| BC4 || 4 || 0.5 | |||
|- | |||
| BC6H || 8 || 1 | |||
|- | |||
| BC7 || 8 || 1 | |||
|} | |||
== RawRGBA == | == RawRGBA == | ||
Uncompressed RGBA with 8 | Uncompressed RGBA with 8 bits per channel. | ||
=== Use cases === | |||
Best when compression significantly diminishes the quality of a texture (such as low-resolution images or very gradual gradients), but at a massive increase to file size and memory usage. RawRGBA should generally be avoided in favor of formats like BC7 for high quality compression. | |||
Images imported with the Pixel Art option have the Uncompressed checkbox toggled on in the texture component, which is equivalent to selecting this format. | |||
== RawRGBAHalf == | == RawRGBAHalf == | ||
| Line 25: | Line 51: | ||
Uncompressed RGBA with a Half Precision Float per channel. | Uncompressed RGBA with a Half Precision Float per channel. | ||
=== Use | === Use cases === | ||
High precision textures, such as Normal Maps or Light Cookies. This format should not be used unless a texture is encoded with a higher bit depth. | High precision textures, such as Normal Maps or Light Cookies. This format should not be used unless a texture is encoded with a higher bit depth. | ||
| Line 31: | Line 57: | ||
== BC1 == | == BC1 == | ||
Compressed RGB with 8 | Compressed RGB with 8 bits per channel. | ||
=== Use | === Use cases === | ||
Generic textures that do not require the Alpha channel. This is the default format | Generic textures that do not require the Alpha channel. This is the default format for textures without Alpha data. | ||
== BC3 == | == BC3 == | ||
Compressed RGBA with 8 | Compressed RGBA with 8 bits per channel. | ||
=== Use | === Use cases === | ||
Generic textures that utilize the Alpha channel. This is the default format | Generic textures that utilize the Alpha channel, such as transparent images or [[Channel packing|channel-packed]] masks. This is the default format for textures with Alpha data. | ||
Although BC3 contains only 1 more channel than BC1, the memory usage will be double that of BC1. If a texture is BC3 but you are sure that it does not require the Alpha channel, you can use the "Remove Alpha" option on the StaticTexture2D component. | Although BC3 contains only 1 more channel than BC1, the memory usage will be double that of BC1. If a texture is BC3 but you are sure that it does not require the Alpha channel, you can use the "Remove Alpha" option on the StaticTexture2D component. | ||
| Line 49: | Line 75: | ||
== BC3nm == | == BC3nm == | ||
Compressed RGBA with 8 | Compressed RGBA with 8 bits per channel. The Red and Green channel are swapped to the Green and Alpha channel respectively. | ||
=== Use | === Use cases === | ||
Normal Maps exclusively. Textures added to the NormalMap field on a material will automatically convert to BC3nm. | Normal Maps exclusively. Textures added to the NormalMap field on a material will automatically convert to BC3nm. | ||
| Line 59: | Line 85: | ||
== BC4 == | == BC4 == | ||
Compressed Red channel with 16 | Compressed Red channel with 16 bits. | ||
=== Use | === Use cases === | ||
Due to limitations with the existing shaders, BC4 is rarely practical. A shader would need texture fields that exclusively read data from the Red channel, which currently only exists in [[:Category:Materials:PBS|PBS variants]] and [[XiexeToonMaterial (Component)|Xiexe Toon]] due to inconsistencies in [[Channel packing]]. See: [https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2218 Github bug #2218.] | Due to limitations with the existing shaders, BC4 is rarely practical. A shader would need texture fields that exclusively read data from the Red channel, which currently only exists in [[:Category:Materials:PBS|PBS variants]] and [[XiexeToonMaterial (Component)|Xiexe Toon]] due to inconsistencies in [[Channel packing]]. See: [https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2218 Github bug #2218.] | ||
| Line 69: | Line 95: | ||
Compressed RGB with a Half Precision Float per channel. Can contain HDR data. | Compressed RGB with a Half Precision Float per channel. Can contain HDR data. | ||
=== Use | === Use cases === | ||
HDR textures, reflection probes with HDR, Light Cookies, and high precision textures that do not require the Alpha channel. Reflection probes with HDR enabled will bake textures into BC6H by default, but they may still be compressed to BC1 in darker scenes [https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1851 due to a bug.] | HDR textures, reflection probes with HDR, Light Cookies, and high precision textures that do not require the Alpha channel. Reflection probes with HDR enabled will bake textures into BC6H by default, but they may still be compressed to BC1 in darker scenes [https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1851 due to a bug.] | ||
| Line 75: | Line 101: | ||
== BC7 == | == BC7 == | ||
Compressed RGBA with 8 | Compressed RGBA with 8 bits per channel. Very high quality compression. | ||
=== Use | === Use cases === | ||
Generic textures. BC7 is visually | Generic textures. BC7 is visually closer to an uncompressed texture while matching BC3 in memory usage, but it takes significantly longer to encode. | ||
== ETC2 & ASTC == | == ETC2 & ASTC == | ||
Latest revision as of 15:45, 10 November 2025
Textures imported into Resonite will have BCn compression to them applied by default. While the defaults are fine in most cases, understanding each format can help you determine a better format for specific situations.
Every compression format here can be found through the PreferredFormat option on StaticTexture2D.
Difference between BCn_Crunched, BCn_Crunched_Non_Perceptual, and BCn_LZMA
Formats may be listed as BC3_Crunched or BC3_LZMA, this is a difference in the storage compression method.
BCn formats are a method of compression optimized for GPUs, not file size. Additional compression is applied on top of BCn compressed textures to save on file size.
Crunch compression is a lossy format that discards data to reduce the file size of textures (but not their VRAM usage) with a trade off of visual quality. The Non Perceptual variants are compressed without considering sRGB color space information.
LZMA compression is a lossless format, meaning no data is discarded during compression. The result is less file size reduction but visual quality is retained. Even though LZMA is lossless, BCn is lossy, so switching a texture to LZMA can only prevent quality loss caused by crunch compression.
Size comparison
The following table lists how many bits each format dedicates per pixel, as well as how much VRAM a 1024x1024 texture using it would take up. Note that the actual size will be about 36% larger by default due to mipmaps (smaller versions of the texture for smoother rendering from far away).
| Format | Bits per pixel | MB per 1K texture |
|---|---|---|
| RawRGBA | 32 | 4 |
| RawRGBAHalf | 64 | 8 |
| BC1 | 4 | 0.5 |
| BC3 | 8 | 1 |
| BC3nm | 8 | 1 |
| BC4 | 4 | 0.5 |
| BC6H | 8 | 1 |
| BC7 | 8 | 1 |
RawRGBA
Uncompressed RGBA with 8 bits per channel.
Use cases
Best when compression significantly diminishes the quality of a texture (such as low-resolution images or very gradual gradients), but at a massive increase to file size and memory usage. RawRGBA should generally be avoided in favor of formats like BC7 for high quality compression.
Images imported with the Pixel Art option have the Uncompressed checkbox toggled on in the texture component, which is equivalent to selecting this format.
RawRGBAHalf
Uncompressed RGBA with a Half Precision Float per channel.
Use cases
High precision textures, such as Normal Maps or Light Cookies. This format should not be used unless a texture is encoded with a higher bit depth.
BC1
Compressed RGB with 8 bits per channel.
Use cases
Generic textures that do not require the Alpha channel. This is the default format for textures without Alpha data.
BC3
Compressed RGBA with 8 bits per channel.
Use cases
Generic textures that utilize the Alpha channel, such as transparent images or channel-packed masks. This is the default format for textures with Alpha data.
Although BC3 contains only 1 more channel than BC1, the memory usage will be double that of BC1. If a texture is BC3 but you are sure that it does not require the Alpha channel, you can use the "Remove Alpha" option on the StaticTexture2D component.
BC3nm
Compressed RGBA with 8 bits per channel. The Red and Green channel are swapped to the Green and Alpha channel respectively.
Use cases
Normal Maps exclusively. Textures added to the NormalMap field on a material will automatically convert to BC3nm.
Normal Maps are more prone to visual artifacts caused by compression, this format helps to minimize that by shifting the data to the Green and Alpha channel, which are less compressed than the Red and Blue channel.
BC4
Compressed Red channel with 16 bits.
Use cases
Due to limitations with the existing shaders, BC4 is rarely practical. A shader would need texture fields that exclusively read data from the Red channel, which currently only exists in PBS variants and Xiexe Toon due to inconsistencies in Channel packing. See: Github bug #2218.
BC6H
Compressed RGB with a Half Precision Float per channel. Can contain HDR data.
Use cases
HDR textures, reflection probes with HDR, Light Cookies, and high precision textures that do not require the Alpha channel. Reflection probes with HDR enabled will bake textures into BC6H by default, but they may still be compressed to BC1 in darker scenes due to a bug.
BC7
Compressed RGBA with 8 bits per channel. Very high quality compression.
Use cases
Generic textures. BC7 is visually closer to an uncompressed texture while matching BC3 in memory usage, but it takes significantly longer to encode.
ETC2 & ASTC
Formats intended for mobile devices. While the option is available, these formats cannot be utilized as mobile platforms are not supported by Resonite currently.
Sources
- https://docs.unity3d.com/2020.1/Documentation/Manual/texture-compression-formats.html
- https://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/
- https://en.wikipedia.org/wiki/S3_Texture_Compression
- https://en.wikipedia.org/wiki/Ericsson_Texture_Compression
- https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression