I am having difficulties trying to understand how a fragment shader (GLSL) works in OpenGL. To be more specific, how does OpenGL reads the color/texture data?
In the vertex Shader (GLSL) there is a pre-defined variable that sets the vertex data called gl_Position.
So basically I am asking, what is the variable/method that sends color/texture data to the OpenGL program in the fragment shader or do i just type
out vec4 fragColor;
does that work? (above code)