What is the purpose of texture compression?

Started by
6 comments, last by Dredge-Master 19 years, 8 months ago
What is the purpose of texture compression? Memory saving or speed? Or both?
Advertisement
compression is always for memory savings at the sacrifice of some speed, assuming you will eventually need to decompress it to use it. the decompression always takes more time than not decompressing. :)

-me
Actually, modern graphics cards can do DXT decompression with ~0 overhead. It's a space savings, and it comes more or less for free, not counting the drop in quality.
also, afaik the decompression is done on the gpu so you even save some on ram bandwidth for fetching the thing in the first place
S3TC is implemented in hardware for years (since NVidia's RivaTNT
card) and will
<code>
a) speed up loading and displaying:
- 512x512x32 textures will be 1mb uncompressed and only
128kb to 256kb (depending on compression method) when
stored as S3TC texture
- displaying is faster as S3TC uses 4x4 pixel blocks so
less data needs to be passed through the bus and pipelines
b) save a lot of texture memory:
- "DXT1" textures only take up 4 bits per pixel, while
"DXT3" and "DXT5" textures (4 bit explicit and interpolated alpha values) will use 8 bits per pixel
</code>
The quality tradeoff differs with the compression algorithm used.
NVidia cards were known to have a bug resulting in very poor rendering quality with S3TC textures.
(I don't know if this issue has been resolved yet)
Due to the 16 bit color quantisation and the block compression nature of the algorithm, you may experience banding artifacts with compressed textures, too.
Generally the output quality is acceptable (sometimes even very good). Since the algorithm is available you can in certain cases
even implement your own compression tool that can produce better
results than Nvidia's or Microsoft's tools (e.g. my tool produces
way better results in many cases than Microsoft's DxTex tool).

[edit]
This thread contains some sample images so you can judge the quality yourself [smile]
[/edit]

Cheers,
Pat
>> Memory saving or speed?
Or both?<<

both, ie it uses less memory and is normally quicker (the drawback though is the less quality)
Quote:Original post by Sneftel
Actually, modern graphics cards can do DXT decompression with ~0 overhead. It's a space savings, and it comes more or less for free, not counting the drop in quality.

Using compressed textures is often faster than using regular ones, due to the more efficient cache usage and the decreased memory bandwidth requirements. This is especially noticeable on large textures (512+).
the speed increase goes for both the hardware based compression, and also in general decompression in files such as in the PNG format (zlib) with lossless compression.
In the case of the later, it's quicker to copy a compressed file and decompressing on the fly, than reading the whole file from the hard drive. This is due to hard drive read speeds.
It's a very similar reason to inside your graphics card, except your video card probably doesn't have a hard drive attached to it. :)
Beer - the love catalystgood ol' homepage

This topic is closed to new replies.

Advertisement