Skip to content

Commit 59740f9

Browse files
authored
Keep ndotl in shadow code
1 parent ea636e8 commit 59740f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/docs/current/Guides/Your First Shader/4_shadows.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ float shadow = step(shadowScreenPos.z, texture(shadowtex0, shadowScreenPos.xy).r
126126
We can then replace our multiplication by `lightmap.g` with one by `shadow`.
127127

128128
```glsl
129-
vec3 sunlight = sunlightColor * dot(normal, worldLightVector) * shadow;
129+
vec3 sunlight = sunlightColor * clamp(dot(worldLightVector, normal), 0.0, 1.0) * shadow;
130130
```
131131

132132
You should now see something like this:

0 commit comments

Comments
 (0)