Skip to content

Commit 25f71bc

Browse files
KY246greggman
authored andcommitted
Use normalized normal vectors instead of unnormalized ones
1 parent 71ce9f6 commit 25f71bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webgl/lessons/webgl-3d-lighting-point.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ and so would not be a complete unit vector
9898

9999
vec3 surfaceToLightDirection = normalize(v_surfaceToLight);
100100

101-
- float light = dot(v_normal, u_reverseLightDirection);
102-
+ float light = dot(v_normal, surfaceToLightDirection);
101+
- float light = dot(normal, u_reverseLightDirection);
102+
+ float light = dot(normal, surfaceToLightDirection);
103103

104104
outColor = u_color;
105105

0 commit comments

Comments
 (0)