2
0
Эх сурвалжийг харах

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

Mr.doob 6 жил өмнө
parent
commit
de06cab138

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

@@ -2232,6 +2232,16 @@ THREE.GLTFLoader = ( function () {
 
 
 		return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {
 		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 ] ) {
 			if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) {
 
 
 				var transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;
 				var transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;