A pixel shader (abbreviation PS) is a shader program, normally executed on the graphics processing unit. In OpenGL, it is referred to as the fragment shader.
FunctionA pixel shader computes color (and optionally more attributes) of each rendered pixel - so the pixel shader defines how the pixels ultimately look. Pixel shaders range from very simple ones (e.g. always output the same color) to simple (e.g. read a color from a texture, apply lighting value) to complex ones that simulate bump mapping, shadows, specular highlights, translucency and other complex phenomena. The pixel shader is executed for each pixel rendered, and independently from the other pixels. Taken in isolation, a pixel shader alone can't produce very complex effects, because it operates only on a single pixel, without any knowledge of scene's geometry or neighboring pixels. In Stream processing terms, pixel shader is a computation kernel function. In addition to color of the pixel, the pixel shader can also alter the depth of the pixel (for Z-buffering), or output more than one color if multiple Render Targets are active. ProgrammingPixel shaders are commonly programmed in the following languages: Assembly, Cg, GLSL, HLSL. CompatibilityHardwareThe following table shows a summary, which graphic cards i.e. which graphic chip together with which DirectX-Version supports which Pixel-Shader-Version. Graphic chips usually are fully downward compatible (3.0 chip supports 2.0, 1.1, etc.).
(Italics indicate products that are not yet available.) See alsoReferences
| |