Browse Source

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

Mr.doob 6 years ago
parent
commit
de06cab138
1 changed files with 10 additions and 0 deletions
  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;