Browse Source

Fixed more envMap breakage.

Mr.doob 10 years ago
parent
commit
92876d839e

+ 1 - 1
examples/js/loaders/MTLLoader.js

@@ -387,7 +387,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 		}
 
-		texture.mapping = mapping;
+		if ( mapping !== undefined ) texture.mapping = mapping;
 
 		return texture;
 

+ 5 - 2
examples/js/loaders/SceneLoader.js

@@ -937,7 +937,9 @@ THREE.SceneLoader.prototype = {
 				if ( loader !== null ) {
 
 					texture = loader.load( url_array, generateTextureCallback( count ) );
-					texture.mapping = textureJSON.mapping;
+
+					if ( textureJSON.mapping !== undefined )
+						texture.mapping = textureJSON.mapping;
 
 				} else {
 
@@ -977,7 +979,8 @@ THREE.SceneLoader.prototype = {
 
 				}
 
-				texture.mapping = textureJSON.mapping;
+				if ( textureJSON.mapping !== undefined )
+					texture.mapping = textureJSON.mapping;
 
 				if ( THREE[ textureJSON.minFilter ] !== undefined )
 					texture.minFilter = THREE[ textureJSON.minFilter ];

+ 1 - 2
src/renderers/webgl/WebGLProgram.js

@@ -104,8 +104,7 @@ THREE.WebGLProgram = ( function () {
 					envMapTypeDefine = "ENVMAP_TYPE_SPHERE";
 					break;
 
-				case THREE.UVMapping:
-					console.warn( 'THREE.WebGLProgram: envMap.mapping shouldn\'t be THREE.UVMapping. Using THREE.CubeReflectionMapping instead.')
+				default:
 					envMapTypeDefine = "ENVMAP_TYPE_CUBE";
 					break;