The vertex and fragment shaders are
each a C-like program that must be compiled, linked, and bound to the OpenGL
The client program provides the modelview and
projection matrices to the shaders, and
issues rendering commands, like glDrawArrays
The vertex shader program,
on the graphics card, transforms the vertices. The
vertex shader is responsible for at least writing a variable: gl_Position
The fragment shader program,
running on the graphics card, either discards the fragment (so it is not
rendered) or assigns a colour to the fragment.
A set of OpenGL functions are available
to create, compile, attach, link, and use a shader. The compiler
linker is built
into the graphics driver.
Compilation and linking occur when invoked by the client programme.