RGB: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (→‎See also: clean up, replaced: See Also → See also)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[category:glossary]]
{{lang|RGB}}[[Category:Glossary]]
[[RGB]] stands for '''r'''ed, '''g'''reen, '''b'''lue. In a [[TGA]] or [[VTF]], each pixel of the image is defined by three [[byte]]s that define how much red, green, and blue light are added together to produce the color in that pixel. The three separate values for each color are called channels.  Shaders in Source can manipulate each channel individually to produce color effects.
'''RGB''' stands for '''r'''ed, '''g'''reen, '''b'''lue. In an uncompressed true-color image, each pixel of the image is defined by three [[byte]]s that define how much red, green, and blue light are added together to produce the color in that pixel. Textures can also have a fourth channel, called [[alpha]], that can store other information for each pixel (usually opacity).


Image files can also have a fourth channel, called [[alpha]], which can define other information for each pixel, usually opacity.
* The three or four separate values for each color are called "channels." [[Shader]]s in Source can manipulate each channel individually to produce color effects.
 
* Within [[material]]s, an RGB color is a [[material vector]].
== RGB Matrix ==
{{note|Sometimes the red and blue bits are flipped, which is called '''BGR'''. BGR encoding is intrinsic to some formats, such as [[TGA]] or {{w|S3TC|DXTn}}, and is the preferred format for SDR textures in [[DirectX 9]] and earlier (newer versions of DirectX prefer RGB).}}
 
In several places Source encodes RGB data in an RGB matrix that looks like this:
 
"[1 1 1]"
 
Note the quote marks.
 
The numbers represent RGB in order; unfortunately while they are sometimes [[normal]]s, they can also at times represent a range from 0 to 255 (LDR) or from 0 to infinity (HDR).


== See also ==
== See also ==
 
* {{ent|HSVtoRGB()}}
*[[Wikipedia:RGB]]
* {{ent|$color}}
* [[Wikipedia:RGB]]

Latest revision as of 03:04, 4 January 2024

English (en)Español (es)Translate (Translate)

RGB stands for red, green, blue. In an uncompressed true-color image, each pixel of the image is defined by three bytes that define how much red, green, and blue light are added together to produce the color in that pixel. Textures can also have a fourth channel, called alpha, that can store other information for each pixel (usually opacity).

  • The three or four separate values for each color are called "channels." Shaders in Source can manipulate each channel individually to produce color effects.
  • Within materials, an RGB color is a material vector.
Note.pngNote:Sometimes the red and blue bits are flipped, which is called BGR. BGR encoding is intrinsic to some formats, such as TGA or Wikipedia icon DXTn, and is the preferred format for SDR textures in DirectX 9 and earlier (newer versions of DirectX prefer RGB).

See also