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!
{{Short description|Type of program in computer graphics}} {{about|the kind of computer program||Shader (album){{!}}''Shader'' (album)|and|Tattoo machine}} {{Use mdy dates|date=October 2020}} {{Multiple issues| {{Update|date=April 2017 | inaccurate=yes}} {{More footnotes|date=April 2014}} }} [[File:Phong-shading-sample (cropped).jpg|thumb|upright=1.3|An example of two kinds of shadings: [[Flat shading]] on the left and [[Phong shading]] on the right. Phong shading is an improvement on [[Gouraud shading]], and was one of the first computer shading models developed after the basic flat shader, greatly enhancing the appearance of curved surfaces in renders. Shaders are most commonly used to produce lit and shadowed areas in the rendering of [[3D modeling|3D models]].]] [[File:Example of a Shader.png|thumb|upright=1.3|Another use of shaders is for special effects, even on 2D images, (e.g., a [[digital photograph|photo]] from a [[webcam]]). The unaltered, unshaded image is on the left, and the same image has a shader applied on the right. This shader works by replacing all light areas of the image with white, and all dark areas with a brightly colored texture.]] In [[computer graphics]], a '''shader''' is a [[computer program]] that calculates the appropriate levels of [[light]], [[darkness]], and [[color]] during the [[Rendering (computer graphics)|rendering]] of a [[3D scene]]βa process known as ''[[shading]]''. Shaders have evolved to perform a variety of specialized functions in computer graphics [[special effects]] and [[video post-processing]], as well as [[general-purpose computing on graphics processing units]]. Traditional shaders calculate [[rendering (computer graphics)|rendering]] effects on graphics hardware with a high degree of flexibility. Most shaders are coded for (and run on) a [[graphics processing unit]] (GPU),<ref>{{Cite web|url=https://learnopengl.com/Getting-started/Shaders|title=LearnOpenGL - Shaders|website=learnopengl.com|access-date=November 12, 2019}}</ref> though this is not a strict requirement. ''Shading languages'' are used to program the GPU's [[rendering pipeline]], which has mostly superseded the [[fixed-function pipeline]] of the past that only allowed for common [[Vertex shader|geometry transforming]] and [[Pixel shader|pixel-shading]] functions; with shaders, customized effects can be used. The [[3d coordinates|position]] and [[color]] ([[hue]], [[Colorfulness|saturation]], [[brightness]], and [[Contrast (vision)|contrast]]) of all [[pixel]]s, [[vertex (computer graphics)|vertices]], and/or [[texture (computer graphics)|texture]]s used to construct a final rendered image can be altered using [[algorithm]]s defined in a shader, and can be modified by external [[variable (computer science)|variable]]s or textures introduced by the computer program calling the shader.{{Citation needed|date=March 2020}} Shaders are used widely in [[Filmmaking|cinema]] [[Post processing (images)|post-processing]], [[computer-generated imagery]], and [[video games]] to produce a range of effects. Beyond simple lighting models, more complex uses of shaders include: altering the [[hue]], [[Colorfulness|saturation]], [[brightness]] ([[HSL and HSV|HSL/HSV]]) or [[contrast (vision)|contrast]] of an image; producing [[Defocus aberration|blur]], [[light bloom]], [[volumetric lighting]], [[normal mapping]] (for depth effects), [[bokeh]], [[cel shading]], [[posterization]], [[bump mapping]], [[distortion (optics)|distortion]], [[chroma key]]ing (for so-called "bluescreen/[[greenscreen]]" effects), [[edge detection|edge]] and [[motion detection]], as well as [[Psychedelia|psychedelic]] effects such as those seen in the [[demoscene]].{{Clarify|date=March 2020}}
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)