What are the DXT compression levels?

Posts

[Unknown user]'s Avatar
stfas
Advanced Member
Advanced Member
Progress to next rank:
 
85%
 
Posts: 277
Joined: 03 Jul 2007, 10:17

What are the DXT compression levels?

Postby stfas at 22 Feb 2008, 15:20

as of lately i've been wondering whats the difference between the different dxts?

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Skinning Questions - Post here

Postby IBBoard at 22 Feb 2008, 19:40

Wikipedia has more detail (and the maths) but in summary:

DXT1 allows 1-bit alpha and uses 8 bytes to store data about a 4x4 block (16 bits each for two colours plus two bits for each pixel where they map to colour one and colour two with the other two values being either 50:50 mix and transparent or 1:2 and 2:1 mix)

DXT3 has 16 bytes per 4x4 block (4 bytes for alpha channel - 4 bits per pixel, or 16 levels - and then the colour is stored the same as the 1:2/2:1 mix DXT1)

DXT5 also has 16 bytes per 4x4 block (two 8-bit alpha levels and a lookup table for one of eight levels of alpha, including a fixed 0 and 255, plus colour stored the same as DXT3).

Basically, DXT1 is good if you have no transparency or on/off transparency and want tiny file sizes, DXT3 is good for when you have sudden transparency transitions and DXT5 is good for gradient transparency. Most of the DoW (nearly all) RSH files use DXT1.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
stfas
Advanced Member
Advanced Member
Progress to next rank:
 
85%
 
Posts: 277
Joined: 03 Jul 2007, 10:17

Re: Skinning Questions - Post here

Postby stfas at 22 Feb 2008, 19:56

i remember you saying in the texture tool that DoW don't use dxt3, well the victory/defeat screens uses dxt3

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Skinning Questions - Post here

Postby IBBoard at 23 Feb 2008, 08:49

I said in the texture tool not to use the TGA->DDS conversion, but that was back when it was experimental. It is now using the Squish compression library and so it should be almost as good quality as Photoshop.

I don't know why the victory/defeat screens would use DXT3, though. AFAIK they don't include any transparency and so DXT1 would halve the file size.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
stfas
Advanced Member
Advanced Member
Progress to next rank:
 
85%
 
Posts: 277
Joined: 03 Jul 2007, 10:17

Re: What are the DXT compression levels?

Postby stfas at 23 Feb 2008, 10:53

actually, alot of the screen is black, as theres two parts of the screens

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: What are the DXT compression levels?

Postby IBBoard at 23 Feb 2008, 10:56

Okay, I hadn't actually looked at them. I guess if they wanted some gradient to the transparency but it wasn't a subtle gradient then DXT3 would be the better choice than DXT5.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
stfas
Advanced Member
Advanced Member
Progress to next rank:
 
85%
 
Posts: 277
Joined: 03 Jul 2007, 10:17

Re: What are the DXT compression levels?

Postby stfas at 23 Feb 2008, 13:38

i got on it was dxt3 by looking on the size when i converted it back from editing it a little... and it was wrong size with dxt1 so it needed to be dxt3