Water effect and DXT1 versus DXT3 compression

Moderators: Uros, OXO, JBr

Post Reply
NickB
Posts: 61
Joined: Mon Oct 25, 2010 4:07 am
Location: Canada

Water effect and DXT1 versus DXT3 compression

Post by NickB » Sun Apr 01, 2018 4:14 pm

I followed the guide to try the 'water' feature and found that the file size of the resulting DDS tiles are twice as large because DXT3 compression is used instead of DXT1. The guide says that DXT1 has only one bit for alpha. DXT3 uses 4 bits for 16 levels of transparency. The source bitmap for water has alpha of 0 or 255 which is alpha on or off and is equivalent to 1 bit, so why try to use 4 bits with DXT3 which doubles the file sizes ?

The resolution of DXT1 with alpha is the same as DXT1 without alpha. However in DXT1 with alpha, 16 pixels are linearly color interpolated with 3 colors, and one transparency, while DXT1 without alpha, has 16 pixels linearly color interpolated with 4 colors and no transparency. There is therefore a slight color loss, but this is very small compared to the color loss of DDS which already has reduced 24 bit color to 16 bit color.

User avatar
JBr
Posts: 498
Joined: Tue Feb 28, 2006 11:33 am

Re: Water effect and DXT1 versus DXT3 compression

Post by JBr » Sun Apr 01, 2018 5:16 pm

Why? Because the alpha can be also grey. If you use DXT1 with 1 bit alpha, your water effect will have jagged edges. DXT3 allows you to have certain level of antialiasing of the water area shape.
Image

NickB
Posts: 61
Joined: Mon Oct 25, 2010 4:07 am
Location: Canada

Re: Water effect and DXT1 versus DXT3 compression

Post by NickB » Sun Apr 01, 2018 7:43 pm

Yes, that is true, and is that what the 'WaterAlpha" tool does ? Does it 'feather' the edges of water bodies with partial alpha, or does it apply a fixed partial alpha ?

User avatar
JBr
Posts: 498
Joined: Tue Feb 28, 2006 11:33 am

Re: Water effect and DXT1 versus DXT3 compression

Post by JBr » Sun Apr 01, 2018 9:52 pm

WaterAlpha itself doesn't do anything with the content of the alpha bitmap, it infuses whatever value you have in the alpha into the texture bitmap. It only discards fully white alpha bitmaps (no water).
Image

Post Reply