Reputation: 91
When performance are kept in mind, we (unwillingly) use texture compression. The artefacts introduced by the compression may be more or less acceptable. what are the different possibilities, workarrounds that can be applied on the original image level to minimize the artefacts introduced by the compression algorithm. In my current situation, most of the artefacts are seen when using gradients.
Upvotes: 1
Views: 994
Reputation: 70126
DXT compression is all about interpolation, or gradients if you will. However, you must understand well what exactly it does. DXT compression is a compromise, it offers pretty bad quality at pretty bad compression, but it does offer some compression and is almost trivial to implement in hardware and runs at practically zero cost. That's why it is used.
There are a few means to improve quality, but if the quality issues are not not acceptable, the only solution is to not use DXT. (Besides, DXT4 which you have in your question's title is not very widely used, this is DXT5-premultiplied)
First of all, note that:
This means that DXT can in principle (more or less) perfectly reproduce many horizontal, vertical, or diagonal 1D gradients that do not have too harsh changes, but it is entirely unable to reproduce most other patterns (though it can usually reproduce something close).
For example, if you have a 2D gradient or a rotated gradient, there is no way (except by sheer coincidence!) that there exists a pair of two colors which will allow the entire 4x4 block to interpolate nicely. Also, since the interpolation is quantized to only 4 choices, the vast majority of "odd rotations" simply cannot be encoded, nor can many combinations of colors. However, for most "kind of natural" textures, this is acceptable.
The DXT compressor will usually make an attempt at finding a best possible fit within the 4x4 cell (though some compressors will/may do something else). This can lead to stepping in gradients even if the gradient inside the cell is represented well.
What you can do about DXT is:
Upvotes: 4