@bpashch - You’re right in that it’s not the “eyePosition”. It is the direction from the vertex to the camera.

The vertex starts in object space, and the modelViewMatrix moves it to camera space.

In camera space, your camera would be at the original, at (0, 0, 0). If your vertex is at (0, 0, 2), then that’s the direction from the camera. Projection doesn’t come into it. All calculations here are done in camera space. Projection is for flattening 3D vertices into 2D space.

Nowadays I tend to do the lighting calculation in world space rather than camera space. So I just multiply by the modelMatrix and send the fragment shader the camera’s world position to get the direction from the camera and the vertex in world space. The light position is generally in world space, so I find it easier to compare camera and light direction and reflection about the vertex.

As long as you do your calculations in the same space, it doesn’t really matter.

https://www.scratchapixel.com is probably the fullest resource, but can get a bit technical at times.

https://learnopengl.com/Lighting/Basic-Lighting is a good explanation for Ambient/Diffuse/Specular. Ignore the OpenGL code - the explanation is good.