Browse Source

WebGLRenderer: Use empty texture instead of null for shadow-less lights. Fixes #9037.

Mr.doob 9 years ago
parent
commit
38e6568fc0
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/renderers/WebGLRenderer.js

+ 3 - 1
src/renderers/WebGLRenderer.js

@@ -31,6 +31,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 	var morphInfluences = new Float32Array( 8 );
 	var morphInfluences = new Float32Array( 8 );
 
 
+	var emptyTexture = new THREE.Texture();
+
 	var sprites = [];
 	var sprites = [];
 	var lensFlares = [];
 	var lensFlares = [];
 
 
@@ -2339,7 +2341,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 			intensity = light.intensity;
 			intensity = light.intensity;
 			distance = light.distance;
 			distance = light.distance;
 
 
-			shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;
+			shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : emptyTexture;
 
 
 			if ( light instanceof THREE.AmbientLight ) {
 			if ( light instanceof THREE.AmbientLight ) {