Sign in to follow this  
dpadam450

DXT normal map compression

Recommended Posts

dpadam450    2357

Excellent tutorial about normal map compression as DXT5.

http://www.ozone3d.net/tutorials/bump_map_compression.php

My question about it is DXT5 = [5][6][5][Alpha]

Is the internal ATI/NVIDIA format adding Green channel bytes and how many? Because it is the same Green/Alpha packing the only difference could be that they do something like DTXNormal = [4][8][4][Alpha].

 

Anyone know what the internal format looks like?

Share this post


Link to post
Share on other sites
Matias Goldberg    9576

You should read Understanding BCn Texture Compression Formats from Nathan Reed.

 

It should clear your questions. The only thing to add is that, before we had BC5 (which was only introduced in DX10; unless you used the ATI hacks); we used the technique you linked above: DXT5 and store the components in the green and alpha channel.

The alpha channel in DXT5 is encoded exactly the way BC5 does for its components. However the RGB components are not. They're encoded like in BC1, which delivers lower quality for our purposes. The Green channel is used over the Red and Blue because it has one more bit of precision.

 

This means BC5 beats DXT5 in terms of quality because the latter wastes precision on unused Red & Blue channels.

Edited by Matias Goldberg

Share this post


Link to post
Share on other sites
Hodgman    51226

Is the internal ATI/NVIDIA format adding Green channel bytes and how many? Because it is the same Green/Alpha packing the only difference could be that they do something like DTXNormal = [4][8][4][Alpha].

Are you taking about the end of the tutorial where they mention ATI2/3DC? As posted above, this format is also known as BC5 - so you'll be able to find info on it under that name.
It doesn't store 4 channels, only 2!
So you get 8bit green & 8bit alpha, without wasting bits on red/blue like you do with the DXT5 trick.

The way this works with the shader is, the channels are called Luminace and Alpha (not green and alpha). When you sample from the texture, the shader receives float4(L,L,L,A) - Luminace is copied into R, G & B, which is handy because as mentioned in the tutorial, it's then compatible with he same shader code as "DXT5-swizzle" normal maps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this