Add specular and normal mapping
[opengl.git] / vertex.glsl
index f886c9bf2650af8771ec501cbc0a601b21091861..341b26a1771d0a0d164b2310f50703427ca9cfe0 100644 (file)
@@ -17,7 +17,7 @@ void main() {
        gl_Position = projection * view * pos;
        fragPos = vec3(pos);
        color = vColor;
-       normal = vNormal;
+       normal = mat3(transpose(inverse(model))) * vNormal;
        normalEye = vec3(view * vec4(normal, 0.0));
        texCoord = vTexCoord;
 }