X-Git-Url: https://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=vertex.glsl;fp=vertex.glsl;h=341b26a1771d0a0d164b2310f50703427ca9cfe0;hp=f886c9bf2650af8771ec501cbc0a601b21091861;hb=ba9c738e8660304aa0341eb44118e63502a4a009;hpb=37cba564a96018a5500e942498d4e48c0ebe73ed diff --git a/vertex.glsl b/vertex.glsl index f886c9b..341b26a 100644 --- a/vertex.glsl +++ b/vertex.glsl @@ -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; }