The half-vector is used in specular lighting and represents the normal at micro-imperfections in the surface which would cause incoming light to reflect toward the viewer. When the half-vector is closer to the surface normal, more imperfections align with the actual surface normal. Smoother surfaces will have fewer imperfections pointing away from the surface normal and result in a sharper highlight with a more significant drop off of light as the half-vector moves away from the actual normal than a rougher surface. The amount of drop off is controlled by the specular term, which is the power to which the cosine between the half-vector and normal vector is taken, so smoother surfaces have a higher power.
We call it the half-vector (H) because it is half-way between the vector point to the light (light vector, L) and the vector pointing to the viewer (which is the eye position. view vector, V). Before you calculate H, make sure the vector to the light and the eye are in the same coordinate space (legacy OpenGL used eye-space).
H = normalize( L + V )
vec3 Light = normalize(light_position - vec3(out_Vertex));
out_Vertex is the eye position of the vertex, which is the vertex after modelView transform. The term light_position here is wrong, since the tutorial cited is the Directional light tutorial, which by definition, directional lights don’t have position. The light vector for directional lights is independent of the vertex, so here, he has combined three equations. Keep in mind, the light vector is toward the light, so opposite of the flow of photons from the light.
//i'm keeping his term here... I'm assuming
// he wanted to simulate at light coming from that position, so the light direction
// would be -light_position, making L = -(-light_position) = light_position.
vec3 L = light_position;
vec3 V = -out_Vertex; // really it is (eye - vertexPosition), so (0,0,0) - out_Vertex
vec3 H = normalize(L + V);
For a point light, you need the direction from the vertex to the point so instead,
vec3 L = light_position - out_Vertex;
vec3 V = -out_Vertex;
vec3 H = normalize(L+V);
The answer to your questions is:
In the above code, is the “out_Vertex” the vPosition that is coming in for the geometry?
Eye position for the vertex, so (modelview * vertex)
I don’t have a light position in my GLSL shader but it seems based on the above example I need one. Am I correct? Or do I need to send a light position to the GLSL fragment shader as well?
You need a light position for point lights, or a light direction for directional lights submitted to your shader