Brain Dump

Normal Matrix

Tags
computer-graphics opengl

Is a variant of the model-matrix specifically tailored for use in calculating vertex-normals.

This is required because some translation operations on vector normals don't preserve the perpendicular quality of the normal. For example, a non-uniform scale operation can distort the direction of the normal.

This matrix is defined as:

The transpose of the inverse of the upper-left 3x3 part of the model matrix. Normal = mat3(transpose(inverse(model))) \* prevNormal;