Both specified matrices are uniform
s. Uniform values are constants, they don't change between vertices (as opposed to varying
variables, which change for each fragment, and attribute
- for each vertex).
gl_ModelViewMatrix
is pre-defined uniform variable set from GL_MODELVIEW
matrix (affected by glLoadIdentity
, glTranslate,
glRotate
, glScale
or glLoadMatrix
).
gl_NormalMatrix
is transpose(inverse(gl_ModelViewMatrix))
, which is the same matrix but with inverted scale factors. Good explanation of this technique could be found at http://www.arcsynthesis.org/gltut/Illumination/Tut09%20Normal%20Transformation.html
Please note that this pre-defined uniforms are deprecated in newer versions of OpenGL (and matrix manipulation functions are deprecated too).