Home Technical Talk

Making simpler dxt texture makes it higher quality?

polycounter lvl 14
Offline / Send Message
Axcel polycounter lvl 14
Hello,
I started wondering. Textures compressed by dxt1, dxt5,... always has the same file size if resolution is the same. Isn't that the more detail on the texture, the bigger loss of data (higher compression)?
My assumption is straight from jpg compression, where making big parts of texture highly simplified (i.e. flat colors), the final size is much smaller with the same compression level (Photoshop)/percentage(irfanview). So... keeping constant file size and by simplifying texture of unsubstantial parts (i.e. space between uv islands) we can get lower compression of substantial parts. Are the same rules apply to DXT?

Replies

  • Farfarer
    Not quite... the texture gets chunked up into small grids. There's an algorithm that then tries to preserve the gradient of colours across that grid (and at the same time, it compresses the depth of those colours down - red and blue more so than green because the human eye is apparently more finely tuned to green light and so notices smaller differences in the amount of green more easily - so that they fit into 16 bits of data, as a result the final texture slots very nicely into blocks of memory without any wasted space, assuming it's a power of 2 in dimension).

    So yeah, fine detail will often get more noticeable artifacts than medium detail due to the limitations on the gradient of colours across the chunk, but at the same time, any large or subtle gradients or details also get more noticeably compressed due to the lowering of the bit depth.

    The chunks all store the same volume of data regardless of what's there in the texture, which is why the textures don't get smaller as there is less information in the texture to encode. Ultimately the texture is uncompressed by graphics card anyway, so the size on disk is really only really beneficial for storing and sending the textures around (less data = more things sent faster).

    Also, if you start to introduce more complex encoding algorithms (variable compression based on how detailed the texture is, etc - like PNG) then you also have to make the decoding process more complex and take longer (loading times increase/streaming issues). And you have to have the hardware support those methods, too (more standards to adhere to).
  • Avvi
    Offline / Send Message
    Avvi polycounter lvl 3
    Farafer's totally right.

    The final size is always the same.
    Subtle gradients get compressed badly. It's better to decrease normal map's intensity in material's settings instead of making it almost flat on the texture.

    Compare gradients here:
    http://www.reedbeta.com/blog/2012/02/12/understanding-bcn-texture-compression-formats/
    BC1 = the most common DXT type
  • Axcel
    Offline / Send Message
    Axcel polycounter lvl 14
    I just grow wiser. :) Thank you
Sign In or Register to comment.