Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions getting-started/4-directional-lighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void main() {

// 0.2 will be the *minimum* light for objects facing away from the sun. You can mess with this value.
// The sun/moon position must be normalized.
float NdotL = max(0.2, dot(normal, normalize(shadowLightPosition));
float NdotL = max(0.2, dot(normal, normalize(shadowLightPosition)));

finalColor.rgb *= NdotL;
}
Expand All @@ -41,4 +41,4 @@ Congrats! You now have cool shading on entities.

However, take a look at the sky. You may see the sun is a bit... wider than usual. This is because the vertex position for the sky is nonsense.

To fix this, we will need to make another copy `gbuffers_skytextured`, and remove the fog calculation. (Don't forget to remove directional lighting too; you don't want the sun shading itself!)
To fix this, we will need to make another copy `gbuffers_skytextured`, and remove the fog calculation. (Don't forget to remove directional lighting too; you don't want the sun shading itself!)