Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Shader
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Pixel shaders ==== Pixel shaders, also known as [[fragment (computer graphics)|fragment]] shaders, compute [[color]] and other attributes of each "fragment": a unit of rendering work affecting at most a single output [[pixel]]. The simplest kinds of pixel shaders output one screen [[pixel]] as a color value; more complex shaders with multiple inputs/outputs are also possible.<ref>{{cite web|url=http://www.lighthouse3d.com/tutorials/glsl-tutorial/fragment-shader/|title=GLSL Tutorial – Fragment Shader|date=June 9, 2011}}</ref> Pixel shaders range from simply always outputting the same color, to applying a [[lighting]] value, to doing [[bump mapping]], [[shadows]], [[specular highlight]]s, [[translucency]] and other phenomena. They can alter the depth of the fragment (for [[Z-buffering]]), or output more than one color if multiple [[render target]]s are active. In 3D graphics, a pixel shader alone cannot produce some kinds of complex effects because it operates only on a single fragment, without knowledge of a scene's geometry (i.e. vertex data). However, pixel shaders do have knowledge of the screen coordinate being drawn, and can sample the screen and nearby pixels if the contents of the entire screen are passed as a texture to the shader. This technique can enable a wide variety of two-dimensional [[Post processing (images)|postprocessing]] effects such as [[Gaussian blur|blur]], or [[edge detection]]/enhancement for [[Cel shader|cartoon/cel shaders]]. Pixel shaders may also be applied in ''intermediate'' stages to any two-dimensional images—[[sprite (computer graphics)|sprite]]s or [[texture (computer graphics)|texture]]s—in the [[Graphics pipeline|pipeline]], whereas [[vertex shaders]] always require a 3D scene. For instance, a pixel shader is the only kind of shader that can act as a [[video postprocessing|postprocessor]] or [[video filter|filter]] for a [[video stream]] after it has been [[rasterization|rasterized]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)