Introducing [glsl_vertex], [glsl_fragment] and [glsl_program].


Shaders are small text programs that are uploaded to the GPU of the Graphics card that come in two flavors or parts. In the first instance, geometry is constructed with vertices in OpenGL. Verteces can be described or manipulated with vertex shaders. In Gem these are loaded with [glsl_vertex]. The geometry is textured by describing fragments for the texture or color and can be described or manipulated with fragment shaders. In Gem these are loaded with [glsl_fragment].

The beginning of a shader program declares which variables you can send to the shader program. These parameters can be either be single floats or grouped as vectors. For instance color information sent to the fragment program would be described with a vec4 for red green blue and alpha channels. A texture will have the same amount of vectors.

Vertex and fragment programs pass parameters to one another so that the vertices correspond either to coordinates of the the texture or to color and alpha information. In Gem linking the vertex and the fragment shaders is done with [glsl_program].