mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Fix potential bug when using multiple lights. (#1055)
This commit is contained in:
parent
d91117d6e7
commit
f71dc5daeb
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue