fragmentShader.fs - Fish-In-A-Suit/Conquest GitHub Wiki

The supported GLSL version is 3.3: #version 330

The fragment shader collects the colour of vertices, which are passed to it from the vertex shader: in vec3 outVertexColour;. Note that the output of the vertex shader matches the input of the fragment shader.

Fragment shader output location for the variable fragColour (which is the final colour of a fragment) is configured by layout (location = 0) out vec4 fragColour;. This specifies the output (fragColour) to be stored in the back buffer, which is represented by 0 (location = 0).

Inside the main method, each vertex input colour to the fragment shader is extended by 1 (making it homogenous?) and then assigned to the variable fragColour:

void main()
{
	fragColour = vec4(outVertexColour, 1.0);
}