Browse Source

WebGLRenderer: Removed dead code (invisible lights don't get added to lights array).

Mr.doob 9 years ago
parent
commit
d5deb46f94
1 changed files with 0 additions and 22 deletions
  1. 0 22
      src/renderers/WebGLRenderer.js

+ 0 - 22
src/renderers/WebGLRenderer.js

@@ -2577,8 +2577,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			if ( light instanceof THREE.AmbientLight ) {
 
-				if ( ! light.visible ) continue;
-
 				r += color.r;
 				g += color.g;
 				b += color.b;
@@ -2595,11 +2593,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var lightUniforms = light.__webglUniforms;
 				_lights.directional[ writeIndexDirectional ++ ] = lightUniforms;
 
-				if ( ! light.visible ) {
-					lightUniforms.color.setRGB( 0, 0, 0 );
-					continue;
-				}
-
 				lightUniforms.direction.setFromMatrixPosition( light.matrixWorld );
 				_vector3.setFromMatrixPosition( light.target.matrixWorld );
 				lightUniforms.direction.sub( _vector3 );
@@ -2621,11 +2614,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var lightUniforms = light.__webglUniforms;
 				_lights.point[ writeIndexPoint ++ ] = lightUniforms;
 
-				if ( ! light.visible ) {
-					lightUniforms.color.setRGB( 0, 0, 0 );
-					continue;
-				}
-
 				lightUniforms.position.setFromMatrixPosition( light.matrixWorld );
 				lightUniforms.position.applyMatrix4( viewMatrix );
 
@@ -2649,11 +2637,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var lightUniforms = light.__webglUniforms;
 				_lights.spot[ writeIndexSpot ++ ] = lightUniforms;
 
-				if ( ! light.visible ) {
-					lightUniforms.color.setRGB( 0, 0, 0 );
-					continue;
-				}
-
 				lightUniforms.position.setFromMatrixPosition( light.matrixWorld );
 				lightUniforms.position.applyMatrix4( viewMatrix );
 
@@ -2682,11 +2665,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var lightUniforms = light.__webglUniforms;
 				_lights.hemi[ writeIndexHemi ++ ] = lightUniforms;
 
-				if ( ! light.visible ) {
-					lightUniforms.skyColor.setRGB( 0, 0, 0 );
-					continue;
-				}
-
 				lightUniforms.direction.setFromMatrixPosition( light.matrixWorld );
 				lightUniforms.direction.transformDirection( viewMatrix );
 				lightUniforms.direction.normalize();