瀏覽代碼

Merge pull request #16167 from takahirox/FixGLTFLoaderDDSExtension

Fix GLTFLoader DDSExtension
Mr.doob 6 年之前
父節點
當前提交
5fa3d1d954
共有 1 個文件被更改,包括 13 次插入9 次删除
  1. 13 9
      examples/js/loaders/GLTFLoader.js

+ 13 - 9
examples/js/loaders/GLTFLoader.js

@@ -2117,15 +2117,19 @@ 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 ( ! texture.isCompressedTexture ) {
+
+				switch ( mapName ) {
+
+					case 'aoMap':
+					case 'emissiveMap':
+					case 'metalnessMap':
+					case 'normalMap':
+					case 'roughnessMap':
+						texture.format = THREE.RGBFormat;
+						break;
+
+				}
 
 			}