Pixel shader
From Wikipedia, the free encyclopedia
A pixel shader is a type of shader program, often executed on a graphics processing unit. It is typically used for effects such as bump mapping and color toning, which provide crisper and more realistic graphics. Microsoft's Direct3D and Silicon Graphics' OpenGL support shaders. (Note: In OpenGL parlance this is called a fragment, so OpenGL calls these fragment shaders).
Contents |
[edit] Function
A pixel shader computes color and other attributes of each pixel. Pixel shaders range from always outputting the same color, to applying a lighting value, to doing bump mapping, shadows, specular highlights, translucency and other phenomena. A pixel shader alone cannot produce very complex effects, because it operates only on a single pixel, without knowledge of a scene's geometry or of neighboring pixels. A pixel shader is a computation kernel function. Pixel shaders can alter the depth of the pixel (for Z-buffering), or output more than one color if multiple render targets are active.
A shader is a program which controls the shading of pixels and display such attributes of display processor. Basically the rasterization of image is affected by the pixel shader as extra processing is required for this purpose. The interpolation used to determine the intensities of different colors such as bicubic interpolation for putting the pixels in the frame buffer.
[edit] History
The term "Shader" originated with Pixar's RenderMan™ - a program that takes an entire description of a scene including camera positions, object geometry and renders the final output. RenderMan was introduced in 1989, but it wasn't really until the 1995 release of Pixar's movie "Toy Story" that the general public was introduced to the power of RenderMan. About this time video graphics hardware was evolving at a rapidly increasing rate and features showing up on "commodity" boards were rivaling those previously found only on dedicated graphics workstations.
As Pixar continued to deliver hit after hit using RenderMan, other movie studios joined in. The PC games industry was also taking advantage of the powerful new graphics cards. Light maps in particular were soon finding their way into games, followed by bump maps and procedural vertex generation. In fact it was the games community that soon started clamoring for more features. In order to differentiate themselves from the pack, some graphics card vendors responded by adding more and more features onto their cards. However, most graphics card manufacturers exposed proprietary programming interfaces requiring software developers to create their own "drivers" to communicate with graphics hardware from different companies.
Silicon Graphics released OpenGL and Microsoft introduced DirectX in order to provide more consistent, higher-level models against which games and graphics software vendors could write their code, reducing the need for them to learn and write their software against proprietary hardware.
OpenGL and DirectX caused a snowball effect, creating an ever increasing installed base of sophisticated PC's that had a good selection of graphics features.[1]
Pixel shaders were the second type of shaders on 3D graphics cards, with vertex shaders being the first. As graphics hardware evolved, geometry shaders appeared that permit adding vertices and primitives to a 3D scene on the graphics card while vertex shaders only allow repositioning existing vertices.
[edit] Programming
Pixel shaders uses different languages depending on which API they use. Popular APIs include DirectX and OpenGL.
[edit] Compatibility
[edit] Hardware
This shows which cards, graphic chips, and DirectX-Version supports which Pixel-Shader-Version. Graphic chips usually are fully downward compatible (3.0 chip supports 2.0, 1.1, etc.).
[edit] Graphic chipsets with pixel shader support
- See Pixel shader for a table of chipsets that support shaders.
While the ATI Radeon 7xxx series and NVIDIA GeForce2/GeForce4 MX series do have somewhat programmable pixel pipelines, they are not flexible enough to run shader programs of level 1.0. Shader Model 1.1 was the first standard used in games, and was first supported in DirectX 8.0.
[edit] Solution for unsupported cards
As of 2008, there are still a large number of users with low end PCs. Software tweaks, such as SwiftShader, swShader and 3D-analyze, can sometimes be used as a workaround for games requiring pixel shaders. However, this often renders games unplayable. Forcing such games to run on unsupported cards usually results in unrendered textures and lighting, as well as poor performance. Additionally, many online anti-cheat systems (such as Punkbuster) perform file and memory scans to ensure that game files have not been modified. As a result, those who attempt to play online using such workarounds may be unable to play, and in a worst case scenario, may in fact have their account/CD-key banned.
Some entry-level video cards supporting pixel shaders are considered affordable. As a result, replacing an unsupported card with a newer one is not only viable, but may also be more desirable than using workarounds.
[edit] See also
[edit] References
- OpenGL Shading Language – Documentation of Shader in OpenGL
- GLSL Tutorial (engl.)
- OpenGL Shading Language examples
- Fundamentals of Pixel Shaders at Gamedev.net

