Skip to content

Commit

Permalink
Fix potential bug when using multiple lights. (#1055)
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimisticPeach committed Dec 31, 2020
1 parent d91117d commit f71dc5d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ void main() {
// add light contribution
color += diffuse * light.color.xyz;
}

// average the lights so that we will never get something with > 1.0
color /= max(float(NumLights.x), 1.0);

output_color.xyz *= color;
# endif

Expand Down

0 comments on commit f71dc5d

Please sign in to comment.