Browse Source

MTLLoader: Fix to avoid loading bump map twice in case material contains both 'bump' and 'bump_map'.

tsone 10 years ago
parent
commit
48d416cf7d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      examples/js/loaders/MTLLoader.js

+ 2 - 0
examples/js/loaders/MTLLoader.js

@@ -345,6 +345,8 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 					// Bump texture map
 
+					if ( params[ 'bumpMap' ] ) break; // Avoid loading twice.
+
 					params[ 'bumpMap' ] = this.loadTexture( this.baseUrl + value );
 					params[ 'bumpMap' ].wrapS = this.wrap;
 					params[ 'bumpMap' ].wrapT = this.wrap;