A logical next step in extending our knowledge of OpenGL is to add color as a variable.
We will pack the color values into the same buffer as the vertex position data and show how to read these interleaved values into shader attributes.
We know that variables are input into the shader pipeline as vertex shader attributes. But gl_FragColor, the pixel color, is set in the fragment shader. To communicate the color values from the vertex shader to the fragment shader we will introduce a varying variable to pass the color from the vertex shader to the fragment shader.