Hello.
I am porting code to work with GLSL >=1.3 shaders.
The gl_NormalMatrix built-in uniform, among others, is deprecated and unsupported in GLSL 1.3 and above.
However, OGL, to my understand, still calculates matrices when using the traditional functions such as glTransformf(), glPushMatrix(), etc.
I have the following code to get these and inject them to my uniforms, but there is no GL definition for normal matrix. Why is this missing, or is it called differently?
Code :void setUniforms() { GLfloat m[16]; glGetFloatv(GL_MODELVIEW_MATRIX, &m[0]); glUniformMatrix4fv(modelViewMatrixLoc, 1, GL_FALSE, &m[0]); glGetFloatv(GL_PROJECTION_MATRIX, &m[0]); glUniformMatrix4fv(projectionMatrixLoc, 1, GL_FALSE, &m[0]); // Error: GL_NORMAL_MATRIX is not a thing. :-( glGetFloatv(GL_NORMAL_MATRIX, 1, GL_FALSE, &m[0]); glUniformMatrix4fv(normalMatrixLoc, 1, GL_FALSE, &m[0]); }
So yeah, must I really calculate this by myself now?
Thanks in advance!