Преглед изворни кода

GLTFLoader: Base color and emissive textures use sRGB.

Don McCurdy пре 8 година
родитељ
комит
dc78b9f988
1 измењених фајлова са 4 додато и 0 уклоњено
  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;