|
Graphics Resources
|
|
|
|
Shaders are simply simple programs that describe the traits of either a vertex or a pixel.Vertex shaders describe the traits (position, texture coordinates, colors, etc.) of a vertex, while pixel shaders describe the traits (color, z depth and alpha value) of a pixel. (Note: In OpenGL parlance this is called a fragment, so OpenGL calles these fragment shaders). A vertex shader is called for each vertex in a primitive (possibly after tesselation) - thus one vertex in - one (updated) vertex out. Each vertex is then rendered as a series of pixels on the screen (or more correctly, onto a surface (block of memory) that will eventually be sent to the screen).
Shaders replace a section of video hardware that's typically called the Fixed Function Pipeline (FFP). This is because it performs lighting and texture mapping in a hard-coded manner, while shaders let you replace this hard-coded approach with a programmable one.