Why DXT5 is default texture format, when DXT1 takes less size?

both are lossless
i dont get it?
is there any unwritten reason?

nvm the answer to this id that dxt1 is rgb only not rgba… but i guess it still may be useful sometimes

dxt1 has 1 bit alpha channel. That is “ouch”.

Also, you’re mistaken. Both of those formats are lossy. They’re not lossless. Compression to dxt produces artifacts.

Technically true, though Unity will never itself compress textures using that encoding. So that only matters if you’re a sadist and want to compress all of your textures in an external application.

But otherwise, yes. On desktop & console, DXT1 is the default for any RGB texture, and DXT5 is the default for RGBA, but the RGB for quality for both is identical as the extra 4 bits per pixel of the DXT5 is used only for the alpha channel separate from the RGB color. Alternatively you can use BC7 which is the same bitrate as DXT5 and can support both RGB and RGBA textures with higher quality than either DXT1 or DXT5. But at the cost of much slower initial import (compression) times. Though they’ve done some work to improve that in 2021.1 on.

1 Like

I just read the description and the implementation is really cool: https://docs.microsoft.com/en-us/windows/win32/direct3d11/bc7-format . If I understand it correctly, each 4x4 block can have a different mode and its own color palette. That’s some piece of engineering, since it allows you to theoretically improve quality by spending more time compressing it, while still allowing constant-time decompression on hardware. Neat!

but will bc7 result in smaller texture size than dxt5?

No.

DXT1 is 4 bits per pixel. DXT5 and BC7 are 8 bits per pixel. There are actually only two formats available for most desktop GPUs that use less than 8 bits per pixel, DXT1 (also called BC1) and BC4. BC4 is a single channel format that is basically the 4 bpp of alpha channel from DXT5 (aka BC3) used to store a single red channel.

So a single 1024x1024 texture imported into Unity and stored as either DXT5 or BC7 will be 1 MB. A 1024x1024 DXT1 or BC4 texture will be 512 KB.

You might be confused by that statement or think my math is wrong as when you look in Unity most 1024x1024 DXT5 textures will show as being 1.3 MB. But that’s because Unity defaults to having mip maps, and mip maps increases the size of the texture’s total memory use by 1/3rd.

4 Likes