Is gl_Vertex exactly the value transferred from glVertex3f?

Suppose I am using glVertex3f to transfer vertex position while at the same time using glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(…); to set up the model-view transformation. Is the gl_Vertex in the vertex shader the value I transferred in glVertex3f, not the value multiplied by the model-view matrix? Thanks a lot. PS: I know it is legacy OpenGL; I just have question on this specific point.

Add one more question: What about gl_LightSource[i].position? Is it affected by model-view matrix in vertex and fragment shaders? Thanks a lot.

Right.

Add one more question: What about gl_LightSource[i].position? Is it affected by model-view matrix in vertex and fragment shaders? Thanks a lot.

It’s the position you specified on the C/C++ side transformed by the MODELVIEW setting in effect when you set that position. In other words, it’s already in EYE space when you get the value in the shader.

I got it. Thank you very much, Dark.