Created wiki page through web user interface.

This commit is contained in:
castano 2007-10-28 07:30:56 +00:00
parent e4f5392734
commit b10fdc454e

View File

@ -0,0 +1,12 @@
#summary Single Color DXT Compression
[http://www.sjbrown.co.uk/ Simon Brown] describes a [http://www.sjbrown.co.uk/?article=dxt single color compressor] as implemented in the [http://www.sjbrown.co.uk/?code=squish squish library].
[http://www.farbrausch.de/~fg/ ryg]'s [https://mollyrocket.com/forums/viewtopic.php?t=392 fast, decent-quality DXT compressor] also uses a similar algorithm, but more optimized:
[https://mollyrocket.com/forums/viewtopic.php?p=1995#1995 ryg wrote]:
...the code also uses an optimization similar to Simon's optimal single color fit, but with far smaller tables and no searching at all. It's based on two relatively simple observations: first, there's no point in trying out the indices representing the extreme values; even if they turn out to be optimal, you can get the exact same results by setting min=max for that component and using one of the "inbetween" indices. And second, the other two cases are symmetric; you get the same results by swapping min and max and using the opposite index. So if your block contains only one color, you don't need to search at all - just use index 2 (or 3) everywhere and use one table lookup in a 256-entry table to determine the optimal min/max color values to use. (Ok, actually, you need two tables, because R and B use 5 bits and G uses 6; but they're still quite small).
[https://mollyrocket.com/forums/viewtopic.php?p=2000#2000 ryg wrote]:
I originally didn't have it either, but later added it because it turned out to be very useful for textures that contain "vector graphics" where you have lots of single-colored areas with antialiased edges; the blocks with edges in them are tricky to get right, of course, but the solid color areas are easy. However, in the dithering variants, "not quite hitting" the right color is annoying because it generates very visible regular dithering patterns all over the solid areas (without dithering, it just gives you a uniform color that is somewhat off, which is obviously not nearly as bad). Anyway, the point was that I had to detect that case no matter what (to at least turn off dithering if nothing else), so why not do it properly :).