Browse Source

Merge pull request #12239 from donmccurdy/feat-gltf-srgb-encoding

GLTFLoader: Base color and emissive textures use sRGB.
Mr.doob 7 years ago
parent
commit
e9d6b1e171
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;