Why do I need to specify the same name for color input in fragment shader and output color from vertex shader?
//Vertex shader
out vec3 vertex_color;
void main()
{
vertex_color=vec3(1.0,0.0,0.0);
}
//Fragment shader
in vec3 vertex_color;
out vec4 frag_color;
void main()
{
frag_color=vec4(vertex_color,1.0);
}
Since we already hand the color value from vertex shader to fragment shader, why do we need same names?