Skip to content

Commit 51e75d7

Browse files
committed
fix inconsistency in coordinate system for lighting
1 parent eebdfe1 commit 51e75d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/light-2/shaders/vertex.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ varying vec3 fragNormal;
66

77
void main() {
88
vec4 worldPosition = model * vec4(position, 1.0);
9-
vec4 worldNormal = vec4(normal, 0.0) * inverseModel;
9+
vec4 worldNormal = vec4(normal, 0.0) * inverseModel * inverseView;
1010

1111
gl_Position = projection * view * worldPosition;
1212
fragNormal = worldNormal.xyz;

0 commit comments

Comments
 (0)