Skip to content

Commit

Permalink
Use normalized normal vectors instead of unnormalized ones
Browse files Browse the repository at this point in the history
  • Loading branch information
KY246 authored and greggman committed Dec 3, 2023
1 parent 71ce9f6 commit 25f71bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webgl/lessons/webgl-3d-lighting-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ and so would not be a complete unit vector

vec3 surfaceToLightDirection = normalize(v_surfaceToLight);

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

outColor = u_color;

Expand Down

0 comments on commit 25f71bc

Please sign in to comment.