Browse Source

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

tsone 10 năm trước cách đây
mục cha
commit
48d416cf7d
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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;