There are two types of shaders in GLSL: "vertex shaders" and "fragment shaders".
So, shaders generally go around in pairs - one shader (the "Vertex shader") is a short program that takes in one vertex from the main CPU and produces one vertex that is passed on to the GPU rasterizer which uses the vertices to create triangles - which it then chops up into individual pixel-sized fragments.
== Vertex Shaders ==
Note: Loading a vertex shader turns off parts of the OpenGL pipeline
Vertex shaders operate on every vertex, the vertex shader is executed for each vertex related OpenGL call (e.g. glVertex* or glDrawArrays).
Vertex Shaders take application geometry and per-vertex attributes as input and transform the input data in some meaningful way.
The vertex shader runs from start to end for each and every vertex that's passed into the graphics card - the fragment process does the same thing at the pixel level. In most scenes there are a heck of a lot more pixel fragments than there are vertices - so the performance of the fragment shader is vastly more important and any work we can do in the vertex shader, we probably should.
== Fragment Shaders ==
Note: Loading a fragment shader turns off parts of the OpenGL pipeline
The other shader (the "Fragment shader" - also known (incorrectly) as the "Pixel shader") takes one pixel from the rasterizer and generates one pixel to write or blend into the frame buffer. A minimum fragment shader may look like this: