The fragment shader is the same as the pixel shader.
The main difference is that the vertex shader can manipulate the attributes of the vertices. which are the corner points of your polygons.
The fragment shader, on the other hand, takes care of how the pixels look between the vertices. They are interpolated between certain vertices, following certain rules.
For example: if you want your polygon to be completely red, you would define all the vertices in red. If you want to use certain effects, such as the gradient between the vertices, you must do this in the fragment shader.
Put another way:
The vertex shader is part of the early steps of the graphics pipeline, somewhere between the model coordinate transformation and the polygon clipping. At this point, nothing has been done.
However, the fragment / pixel shader is part of the rasterization step where the image is computed and the pixels between the vertices are filled or “painted”.
Just read about the graphics pipeline here and it will open: http://en.wikipedia.org/wiki/Graphics_pipeline
The Surrican Dec 12 '10 at 10:48 2010-12-12 10:48
source share