From de06cab138788405aeeaff8d3da80a90d0be96ae Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Mon, 11 Feb 2019 17:19:59 -0800 Subject: [PATCH] GLTFLoader: Use RGBFormat for `aoMap`, `roughnessMap` and `metalnessMap` textures. --- examples/js/loaders/GLTFLoader.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index 295889d0d0..1d92281f55 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/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; -- GitLab