Fix potential bug when using multiple lights. (#1055)
This commit is contained in:
		
							parent
							
								
									d91117d6e7
								
							
						
					
					
						commit
						f71dc5daeb
					
				| @ -53,6 +53,10 @@ void main() { | |||||||
|         // add light contribution |         // add light contribution | ||||||
|         color += diffuse * light.color.xyz; |         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; |     output_color.xyz *= color; | ||||||
| # endif | # endif | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Patrik Buhring
						Patrik Buhring