From e10b7f4a47fd15011a05efac20aa8fecc71a78e7 Mon Sep 17 00:00:00 2001 From: urlysses Date: Sun, 21 May 2017 10:05:45 -0400 Subject: [PATCH] Fix inconsistency for lighting Since the lesson description tells us to work off of LIGHT 02, the vertex shaders should match. This applies 51e75d7558ee096c1a3f1198e88b326f8e25f6b4 to NPR 01. --- exercises/npr-1/shaders/vertex.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/npr-1/shaders/vertex.glsl b/exercises/npr-1/shaders/vertex.glsl index c6fb07f..7c8b183 100644 --- a/exercises/npr-1/shaders/vertex.glsl +++ b/exercises/npr-1/shaders/vertex.glsl @@ -15,8 +15,8 @@ varying vec3 fragNormal; void main() { vec4 worldPosition = model * vec4(position, 1.0); - vec4 worldNormal = vec4(normal, 0.0) * inverseModel; + vec4 worldNormal = vec4(normal, 0.0) * inverseModel * inverseView; gl_Position = projection * view * worldPosition; fragNormal = worldNormal.xyz; -} \ No newline at end of file +}