|
|
@@ -4,7 +4,7 @@ attribute vec3 a_normal; // Vertex Normal (x, y, z)
|
|
|
|
|
|
// Uniforms
|
|
|
uniform mat4 u_worldViewProjectionMatrix; // Matrix to transform a position to clip space.
|
|
|
-uniform mat4 u_inverseTransposeWorldMatrix; // Matrix to transform a normal to view space.
|
|
|
+uniform mat4 u_inverseTransposeWorldViewMatrix; // Matrix to transform a normal to view space.
|
|
|
|
|
|
// Outputs
|
|
|
varying vec3 v_normalVector; // Normal vector in view space.
|
|
|
@@ -19,6 +19,6 @@ void main()
|
|
|
gl_Position = u_worldViewProjectionMatrix * position;
|
|
|
|
|
|
// Transform normal to view space.
|
|
|
- mat3 inverseTransposeWorldViewMatrix = mat3(u_inverseTransposeWorldMatrix[0].xyz, u_inverseTransposeWorldMatrix[1].xyz, u_inverseTransposeWorldMatrix[2].xyz);
|
|
|
+ mat3 inverseTransposeWorldViewMatrix = mat3(u_inverseTransposeWorldViewMatrix[0].xyz, u_inverseTransposeWorldViewMatrix[1].xyz, u_inverseTransposeWorldViewMatrix[2].xyz);
|
|
|
v_normalVector = inverseTransposeWorldViewMatrix * normal;
|
|
|
}
|