|
@@ -2262,6 +2262,14 @@ THREE.GLTFLoader = ( function () {
|
|
|
|
|
|
if ( materialDef.name !== undefined ) material.name = materialDef.name;
|
|
|
|
|
|
+ // Normal map textures use OpenGL conventions:
|
|
|
+ // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materialnormaltexture
|
|
|
+ if ( material.normalScale && ! material.vertexTangents ) {
|
|
|
+
|
|
|
+ material.normalScale.y = - material.normalScale.y;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding.
|
|
|
if ( material.map ) material.map.encoding = THREE.sRGBEncoding;
|
|
|
if ( material.emissiveMap ) material.emissiveMap.encoding = THREE.sRGBEncoding;
|