title: What is the gl_NormalMatrix and gl_ModelViewMatrix in shaders?
body: <p>A lot of google searches make the assumption that you a basic knowledge of what these matrices represent, while i do not.</p>
  
  <p>I have knowledge of vectors and matrices and their operations.</p>
  
  <p>I want to refer to the most simple shader code that i cannot understand, putting normals and vertices in eye-space:</p>
  
  <pre><code>//vertex shader
  varying vec4 color;
  varying vec3 N;
  varying vec3 v;
  void main(void)
  {
  
      v = vec3(gl_ModelViewMatrix * gl_Vertex);
      N = normalize(gl_NormalMatrix * gl_Normal);
  
      color = gl_Color;
  
      gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
  } 
  </code></pre>
  
  <p>My questions:</p>
  
  <p>(i) As the vertex shader loops through each vertex, does the gl_ModelViewMatrix change with every vertex loop? Or does the gl_ModelViewMatrix remain constant throughout each vertex iteration and can transform any vertex into eye space?</p>
  
  <p>(ii) Similar to my first question, but what information does the gl_NormalMatrix hold? Does it hold information on every normal in the scene and thats how it can transform the current vertex's normal that comes into the vertex shader into eye space? Or does the matrix change as each vertex comes into the vertex shader and thats how it can transform the current vertex's normal that comes into the vertex shader into eye space?  </p>