Portal:OpenGL Shading Language/Fragment Shader: Difference between revisions
Smaller. |
m Bot: Updating section links to use redirects. |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
When a [[Primitive]] is [[Rasterization|rasterized]], it is converted blocks of data based on sample-sized areas of the primitive being rasterized. This data is called a [[Fragment]]. The '''Fragment Shader''' is the shader stage responsible for processing fragments. For each input fragment, it produces an output fragment consisting of a number of colors, a depth, and a stencil value that will be output to the [[Framebuffer]] (after some [[Per-Sample Processing|post-fragment shader operations]]). | When a [[Primitive]] is [[Rasterization|rasterized]], it is converted into blocks of data based on sample-sized areas of the primitive being rasterized. This data is called a [[Fragment]]. The '''Fragment Shader''' is the shader stage responsible for processing fragments. For each input fragment, it produces an output fragment consisting of a number of colors, a depth, and a stencil value that will be output to the [[Framebuffer]] (after some [[Per-Sample Processing|post-fragment shader operations]]). | ||
Fragment shader input values are interpolated across the surface of the primitive, based on the [[ | Fragment shader input values are interpolated across the surface of the primitive, based on the [[Interpolation qualifiers|interpolation qualifiers]] present on the input variable declaration (and on the corresponding output declaration in the previous shader stage). | ||
Fragment shaders can use most of the [[Sampler (GLSL)|texture accessing functions]] with full mipmapping support. They also can effectively abort processing, which not only ignores the output of the fragment shader, but culls the fragment entirely, as if the fragment had never been rasterized. | Fragment shaders can use most of the [[Sampler (GLSL)|texture accessing functions]] with full mipmapping support. They also can effectively abort processing, which not only ignores the output of the fragment shader, but culls the fragment entirely, as if the fragment had never been rasterized. |
Latest revision as of 15:36, 12 April 2015
When a Primitive is rasterized, it is converted into blocks of data based on sample-sized areas of the primitive being rasterized. This data is called a Fragment. The Fragment Shader is the shader stage responsible for processing fragments. For each input fragment, it produces an output fragment consisting of a number of colors, a depth, and a stencil value that will be output to the Framebuffer (after some post-fragment shader operations).
Fragment shader input values are interpolated across the surface of the primitive, based on the interpolation qualifiers present on the input variable declaration (and on the corresponding output declaration in the previous shader stage).
Fragment shaders can use most of the texture accessing functions with full mipmapping support. They also can effectively abort processing, which not only ignores the output of the fragment shader, but culls the fragment entirely, as if the fragment had never been rasterized.