so for each subblock, there's 64 bits.
The first half is two 16-bit values, c0 and c1. Their numeric value is important, as they're compared, and mean different things which one is bigger.
Top-level
so for each subblock, there's 64 bits. 10 comments
if c0 is bigger than c1, then: but if c1 is bigger than c0, then: so now you have 4 colors, c0 through c3. The final 32 bits of the subblock is an index into this palette, with two bits per pixel. so yeah. dxt1 works by having you define two colors, they get an extra bit of metadata by making the order of the colors important, then generate 2 more colors based on those colors + metadata. ugh it turns out it's hard to decode 0-width fonts, thanks to divisions. I'm now mass-converting all the textures. |
so the two numbers are compared, and either way, c0 and c1 are RGB 5:6:5 colors.
Then, depending on which is bigger, c2 and c3 get calculated.