A simplified view of the path of data through OpenGL.
A simplified view of the flow of data through the shaders and out to the screen. It starts with attributes that are the input to the vertex shaders for each vertex. Remember in our first example the attribute is the position of the vertex. Uniforms are slso inputs to the vertex shaders, but they are constant across all vertices. We will see them later.
Variables that the vertex shader pass on to the fragment shaders are called varying. The vertex is required to generate gl_Position, the position of the vertex after all transformations are applied. In the first example, we apply not transformations to see that shape of the space we are drawing into.
Fragment shaders can be though of as performing per pixel computations. They can use uniforms and also varyings as input, and we will see examples of these in the coming slides.
The first example fragment shader simply sets the pixel color, which is output as gl_FragColor, to red (r,g,b,α) = (0.8, 0.3, 0.3, 1).