Browse Source

This makes sure that the lights are counted correctly based on their visibility. This fixes #4439.

OpenShift guest 11 years ago
parent
commit
a89b036995
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/renderers/WebGLRenderer.js

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -6517,7 +6517,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			var light = lights[ l ];
 			var light = lights[ l ];
 
 
-			if ( light.onlyShadow ) continue;
+			if ( light.onlyShadow || light.visible === false ) continue;
 
 
 			if ( light instanceof THREE.DirectionalLight ) dirLights ++;
 			if ( light instanceof THREE.DirectionalLight ) dirLights ++;
 			if ( light instanceof THREE.PointLight ) pointLights ++;
 			if ( light instanceof THREE.PointLight ) pointLights ++;