Here is my code to begin with, this is the vertex shader
"#version 400\n"
"layout(location = 0) in vec2 vp;"
"layout(location = 1) in vec2 tex;"
"out vec2 texCoord;"
"void main () {"
" gl_Position = vec4 (vp, 0.0f, 1.0f);"
" texCoord = tex; "
"}";
Quiet common and basic
So basically what i am trying to understand, does the vertex shader run for every vertex attribute separately ? Or it only runs for one attribute individually?
As far as i have understood if i give it as input vertices for a triangle
x y U V
{-0.5,-0.5, 0.0, 0.0
0.5, -0.5 , 1.0, 0.0
0.0 0.0 , 0.5, 1.0 };
Does that mean that the vertex shader will run for both of the vertex attributes and produce each individual fragment that is within the area of both triangles (sample) to result in the xy coordinates for both of my defined triangles for each attribute?
Or does the vertex shader only run for the gl_Position to produce the xy coordinates for the area in the first attribute i.e vp?