Difference between revisions of "Choose the right DXTC compression algorithm"

Byline removed
imported>Dev akm
(→‎Preface.: grammer)
imported>QQuix
(Byline removed)
 
(17 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Modeling_and_Texturing_Tutorials]]
--[[User:Blade9722|Blade9722]] 07:33, 23 November 2006 (EST)


[[Category:Texturing_Tutorials]]
[[Category:Tutorials]]
{{Tools|req0=(re)texture tools}}


=Preface.=
=Preface.=
Line 7: Line 9:
Altough most of what I'm describing should appear obvious and trivial to those skilled in the arts, I noticed there are some common mistakes which regularly appears also in the work coming from well-experienced texturers, so I think there's a need for some clarifications.
Altough most of what I'm describing should appear obvious and trivial to those skilled in the arts, I noticed there are some common mistakes which regularly appears also in the work coming from well-experienced texturers, so I think there's a need for some clarifications.


=Brief description of most common DXTC compression formats.=
=Common DXTC compression formats.=
Here's a brief description of the most common DXTC compression formats.


'''DXT1C/DXT1A.'''
==DXT1C/DXT1A==


Channels bit depth: 8:8:8:1 RGBA.
Channels bit depth: 8:8:8:1 RGBA.
Line 18: Line 21:
if the alpha channel is set to 1 (white), RGB channels store usual color info. Instead if the alpha channel is set to 0 (black), upon saving the texture RGB channel are set to 0 as well. In other words, each pixel could contain color info only if the alpha channel is set to white.  
if the alpha channel is set to 1 (white), RGB channels store usual color info. Instead if the alpha channel is set to 0 (black), upon saving the texture RGB channel are set to 0 as well. In other words, each pixel could contain color info only if the alpha channel is set to white.  
This makes a sense, as a black alpha channel usually means that the pixel is completely transparent (invisible), so there's no need to store color info.
This makes a sense, as a black alpha channel usually means that the pixel is completely transparent (invisible), so there's no need to store color info.
This algorithm is tipically used for icons, decals, blood, tatoos, i.e. texture with a completely transparent part.
This algorithm is typically used for icons, decals, blood, tatoos, i.e. texture with a completely transparent part.


Instead, DXT1C is often described as "RGB texture withouth alpha channel". This is not true: the alpha channel is still present, but is completely white. Actually, there's no physical distinction between this and DXT1A, simply upon choosing DXT1C as compression algorithm the alpha channel is set to be completely white just before saving. This is tipically used for common completely opaque textures.
Instead, DXT1C is often described as "RGB texture withouth alpha channel". This is not true: the alpha channel is still present, but is completely white. Actually, there's no physical distinction between this and DXT1A, simply upon choosing DXT1C as compression algorithm the alpha channel is set to be completely white just before saving. This is typically used for common completely opaque textures.


'''DXT3.'''
==DXT3==


Channels bit depth: 8:8:8:8 RGBA.
Channels bit depth: 8:8:8:8 RGBA.
Line 30: Line 33:
This is often described as "RGB texture with explicit alpha". It's commonnly used for partially transparent textures. There application field is the same of DXT5, theoretically you should use this when alpha channel is featuring steep variations. However, I must point out that from my personal experience in 99% of cases DXT5 will preserve better alpha channel detail, so if you don't have time enough to make a comparison, I recommend using DXT5 instead.
This is often described as "RGB texture with explicit alpha". It's commonnly used for partially transparent textures. There application field is the same of DXT5, theoretically you should use this when alpha channel is featuring steep variations. However, I must point out that from my personal experience in 99% of cases DXT5 will preserve better alpha channel detail, so if you don't have time enough to make a comparison, I recommend using DXT5 instead.


'''DXT5.'''
==DXT5==


Channels bit depth: 8:8:8:8 RGBA.
Channels bit depth: 8:8:8:8 RGBA.
Line 43: Line 46:
'''The most common mistake is this: some modders probably thinks that DXT5 is increasing RGB visual quality, so they systematically use it without caring whether alpha channel is used or not'''
'''The most common mistake is this: some modders probably thinks that DXT5 is increasing RGB visual quality, so they systematically use it without caring whether alpha channel is used or not'''


'''Uncompressed dds'''
==Uncompressed dds (8.8.8.8 Unsigned)==


Channels bit depth: 8:8:8:8 RGBA.
Channels bit depth: 8:8:8:8 RGBA.


Well, I think there is no need to explain this
Well, I think there is no need to explain this.
 
Sometimes useful if you really want to avoid compression artifacts in a normal map, but be careful because the file size will be huge.  On normal maps, if no compression-introduced artifacts are already present, you can afford to reduce the texture size to a smaller one and still maintain a quality normal map.


=Texture Types=
=Texture Types=
Line 72: Line 77:


'''If it's a landscape texture'''(i.e. is inside the textures\landscape folder):
'''If it's a landscape texture'''(i.e. is inside the textures\landscape folder):
I'm not 100% sure about that, but it seems the alpha channel is useless, as tranparency info is stored directly in the esp. So I recommend using DXT1. This even if in some Bethesda landscape textures alpha channel is present, as (courtesy from Qarl who discovered this) it seems it's only because they are a copy of other mesh related textures, where the alpha channel is really used.
the alpha channel is usualy not needed. However, some objects (mostly big rocks) do use landscape textures with alpha, so if you're modifying an existing texture you should keep the alpha if it already exists. If you don't need alpha, I recommend using DXT1.
 
*NOTE: If using the '''OVEP/OBGE Detailed Terrain shader''' mod (http://tesnexus.com/downloads/file.php?id=15245), the alpha channel is used in improving terrain transition blending.


'''If you don't know how or simply don't have time to check this''':
'''If you don't know how or simply don't have time to check this''':
Line 80: Line 87:
(identified by the _n.dds suffix)
(identified by the _n.dds suffix)


'''RGB Channels''': store the normal map info
'''RGB Channels''': store the normal map info.  Red stores X-axis changes from left to right in height (white = lowering, dark = raising, 50% gray = flat).  Green stores Y-axis changes in height in a manner similar to the Red channel but from top to bottom.  Blue stores Z-axis changes in height (white = steady, grays = change)


'''Alpha Channel''': if specular map is enabled, stores the reflectivity info (white: shine, Black: dull)
'''Alpha Channel''': if specular map is enabled, stores the specular highlighting info (white: shine, Black: dull)


'''How to enable specular mapping''':
'''How to enable specular mapping''':
Line 99: Line 106:


'''Alpha Channel''': from my knowledge, is never used, so I recommend using DXT1 in all cases.
'''Alpha Channel''': from my knowledge, is never used, so I recommend using DXT1 in all cases.
==See also==
*[[DDS_Files]]
*[http://tesalliance.org/forums/index.php?/topic/1139-guest-speaker-texturing-101-by-vince/ Texturing 101] at TES Alliance
Anonymous user