浏览代码

GLTFLoader: Use RGBFormat for `aoMap`, `roughnessMap` and `metalnessMap` textures.

Mr.doob 6 年之前
父节点
当前提交
de06cab138
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      examples/js/loaders/GLTFLoader.js

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

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