Alpha: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (better term than "integerized")
(Provided hint about free alternative. Know any more of them?)
Line 1: Line 1:
[[category:Glossary]][[category:Material System]]
[[category:Glossary]][[category:Material System]]
'''Alpha''' is a [[byte]] [[variable]] that is often included as the "fourth" byte in a [[RGB]] color format. '''Alpha''' is an [[opacity]] rating from 0 - 255, where 0 is completely invisible and 255 is completely visible.  In a VMT file, the "$alpha" parameter is normalized from 0 to 1.0. The value used in the in-game texture is $alpha * 255. That is, an $alpha of 0.7 will convert to a texture alpha of 178 ( 0.7 * 255 = 178.5, floor rounded to 178 ).
'''Alpha''' is a [[byte]] [[variable]] that is often included as the "fourth" byte in a [[RGB]] color format. '''Alpha''' is an [[opacity]] rating from 0 - 255, where 0 is completely invisible and 255 is completely visible.  In a [[VMT]] file, the "$alpha" parameter is normalized from 0 to 1.0. The value used in the in-game texture is $alpha * 255. That is, an $alpha of 0.7 will convert to a texture alpha of 178 ( 0.7 * 255 = 178.5, floor rounded to 178 ).


To store an individual alpha value in each pixel, an [[alpha channel]] is used as the fourth channel of the [[TGA]] file.  This allows variable opacity, for example, in a single texture, such as the lettered Petrol signs in Half-Life 2.  The texture's alpha channel can also be used to define self illumination instead of opacity.
To store an individual alpha value in each pixel, an [[alpha channel]] is used as the fourth channel of the [[TGA]] file.  This allows variable opacity, for example, in a single texture, such as the lettered Petrol signs in Half-Life 2.  The texture's alpha channel can also be used to define self illumination instead of opacity.
{{note|Some graphics editors (such as Photoshop Elements) will not be able to save alpha into TGA format. A free alternative that is able to handle alpha is [http://www.gimp.org/ GIMP].}}

Revision as of 13:02, 16 November 2006

Alpha is a byte variable that is often included as the "fourth" byte in a RGB color format. Alpha is an opacity rating from 0 - 255, where 0 is completely invisible and 255 is completely visible. In a VMT file, the "$alpha" parameter is normalized from 0 to 1.0. The value used in the in-game texture is $alpha * 255. That is, an $alpha of 0.7 will convert to a texture alpha of 178 ( 0.7 * 255 = 178.5, floor rounded to 178 ).

To store an individual alpha value in each pixel, an alpha channel is used as the fourth channel of the TGA file. This allows variable opacity, for example, in a single texture, such as the lettered Petrol signs in Half-Life 2. The texture's alpha channel can also be used to define self illumination instead of opacity.

Note.pngNote:Some graphics editors (such as Photoshop Elements) will not be able to save alpha into TGA format. A free alternative that is able to handle alpha is GIMP.