浏览代码

Merge pull request #15758 from mrdoob/gltfloader

GLTFLoader: Use RGBFormat for aoMap, emissiveMap, metalnessMap, normalMap and roughnessMap.
Mr.doob 6 年之前
父节点
当前提交
494ccf6f0f
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      examples/js/loaders/GLTFLoader.js

+ 12 - 0
examples/js/loaders/GLTFLoader.js

@@ -2232,6 +2232,18 @@ THREE.GLTFLoader = ( function () {
 
 		return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {
 
+			switch ( mapName ) {
+
+				case 'aoMap':
+				case 'emissiveMap':
+				case 'metalnessMap':
+				case 'normalMap':
+				case 'roughnessMap':
+					texture.format = THREE.RGBFormat;
+					break;
+
+			}
+
 			if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) {
 
 				var transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;