Shader
From DmWiki
A shader is commonly said when referring to a custom program that resides on the graphics processing unit. A shader is a set of instructions that can be executed either for each vertex or each pixel. If it is for a vertex then it is called a vertex shader, and if it for a pixel it is called a pixel shader or fragment shader.
Vertex shader
Vertex shaders are being executed whenever a vertex is transformed. As an "extra step" you can use your custom code to do additional transformations. Most common transformations done using vertex shaders are surface deformations. For example you can create moving water surface effect if you write a custom vertex shader in a way that moves the vertex along its normal vector depending on brightness of given texture for it. When the texture is moving, you could achieve effect of waving water.
Pixel shader
Pixel shaders are being executed whenever a pixel is going to be rendered. They provide last opportunity to modify transformed, lit, and textured pixel color. Most common transformations done using pixel shaders are texture modifications or texture generation. You can create a procedural texture using pixel shader technique - for example procedural wood or marble. You can also apply any custom logic to the shader.
Programming shaders
In the very beginning, programming shaders required knowledge of assembly-like language, that was specific for any given hardware vendor (mainly ATI and NVidia). With advent of high level shader languages, you could create vendor-transparent code, which was compiled for specific video card at runtime. High level shader languages also enabled programmers to easily experiment with shader programs and create stunning effects which can be seen in numerous AAA titles. High level shader languages also helped to create great tools for developing custom shaders, tools that could be used by graphic artists in a completely non-programmer way.
This article is a stub. You can help improve the article by expanding it.
