Browse Source

GLTFLoader: Base color and emissive textures use sRGB.

Don McCurdy 7 years ago
parent
commit
dc78b9f988
1 changed files with 4 additions and 0 deletions
  1. 4 0
      examples/js/loaders/GLTFLoader.js

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

@@ -1695,6 +1695,10 @@ THREE.GLTFLoader = ( function () {
 
 				}
 
+				// emissiveTexture and baseColorTexture use sRGB encoding.
+				if ( _material.map ) _material.map.encoding = THREE.sRGBEncoding;
+				if ( _material.emissiveMap ) _material.emissiveMap.encoding = THREE.sRGBEncoding;
+
 				if ( material.extras ) _material.userData = material.extras;
 
 				return _material;