提交 507fdf95 编写于 作者: E Emmett Lalish

flip normalScale without tangents

上级 316f6a3a
......@@ -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;
......
......@@ -2329,6 +2329,14 @@ var 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 = sRGBEncoding;
if ( material.emissiveMap ) material.emissiveMap.encoding = sRGBEncoding;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册