diff --git a/docs/intermediate/tutorial10-lighting/README.md b/docs/intermediate/tutorial10-lighting/README.md index 50c46c47..8455421a 100644 --- a/docs/intermediate/tutorial10-lighting/README.md +++ b/docs/intermediate/tutorial10-lighting/README.md @@ -517,7 +517,7 @@ Remember the normal vectors that were included with our model? We're finally goi If the dot product of the normal and light vector is 1.0, that means that the current fragment is directly inline with the light source and will receive the lights full intensity. A value of 0.0 or lower means that the surface is perpendicular or facing away from the light, and therefore will be dark. -We're going to need to pull in the normal vector into our `shader.vert`. +We're going to need to pull in the normal vector into our `shader.wgsl`. ```wgsl struct VertexInput { @@ -847,8 +847,8 @@ let reflect_dir = reflect(-light_dir, in.world_normal); Then we use the dot product to calculate the `specular_strength` and use that to compute the `specular_color`. ```wgsl -let specular_strength = pow(max(dot(view_dir, reflect_dir), 0.0), 32); -let specular_color = specular_strength * light_color; +let specular_strength = pow(max(dot(view_dir, reflect_dir), 0.0), 32.0); +let specular_color = specular_strength * light.color; ``` Finally we add that to the result. @@ -873,7 +873,7 @@ Up to this point we've actually only implemented the Phong part of Blinn-Phong. let view_dir = normalize(uniforms.view_pos.xyz - in.world_position); let half_dir = normalize(view_dir + light_dir); -let specular_strength = pow(max(dot(in.world_normal, half_dir), 0.0), 32); +let specular_strength = pow(max(dot(in.world_normal, half_dir), 0.0), 32.0); ``` It's hard to tell the difference, but here's the results.