Alpha: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(cleanup...also example was bad because the combine forcefields use additive blending, not alpha channels)
Line 1: Line 1:
[[category:Glossary]][[category:Material System]]
[[category:Glossary]][[category:Material System]]
'''Alpha''' is an [[Integer]] [[variable]] that is often included as the "fourth" number in a [[RGB]] color format. '''Alpha''' is an [[opacity]] rating from 0 - 255. Smaller '''alpha''' numbers make objects appear more faded whereas larger numbers make objects appear more visable.
'''Alpha''' is an [[integer]] [[variable]] that is often included as the "fourth" number 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 instead.


0 is completely invisible.
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 transparency.
255 is completely visable.
 
[[Alpha Channel]]s are also included inside of textures. A classic graphic format that supports [[alpha channel]]s is the Targa Graphics Format ([[tga]]).
 
[[Alpha channel]]s will let you specify individual opacity values for each pixel.
 
An example of where [[alpha channel]]s are used can be found in the Combine Forcefields.
 
Even though parts of the forcefields are visable, other parts are not. That is because the [[alpha channel]] is hiding certain parts of the texture.

Revision as of 12:01, 15 July 2005

Alpha is an integer variable that is often included as the "fourth" number 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 instead.

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 transparency.