|
@@ -692,8 +692,7 @@ class GLTFMaterialsClearcoatExtension {
|
|
|
|
|
|
const scale = extension.clearcoatNormalTexture.scale;
|
|
|
|
|
|
- // https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
|
|
|
- materialParams.clearcoatNormalScale = new Vector2( scale, - scale );
|
|
|
+ materialParams.clearcoatNormalScale = new Vector2( scale, scale );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2920,7 +2919,7 @@ class GLTFParser {
|
|
|
const geometry = mesh.geometry;
|
|
|
let material = mesh.material;
|
|
|
|
|
|
- const useVertexTangents = geometry.attributes.tangent !== undefined;
|
|
|
+ const useDerivativeTangents = geometry.attributes.tangent === undefined;
|
|
|
const useVertexColors = geometry.attributes.color !== undefined;
|
|
|
const useFlatShading = geometry.attributes.normal === undefined;
|
|
|
|
|
@@ -2965,12 +2964,12 @@ class GLTFParser {
|
|
|
}
|
|
|
|
|
|
// Clone the material if it will be modified
|
|
|
- if ( useVertexTangents || useVertexColors || useFlatShading ) {
|
|
|
+ if ( useDerivativeTangents || useVertexColors || useFlatShading ) {
|
|
|
|
|
|
let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
|
|
|
|
|
|
if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
|
|
|
- if ( useVertexTangents ) cacheKey += 'vertex-tangents:';
|
|
|
+ if ( useDerivativeTangents ) cacheKey += 'derivative-tangents:';
|
|
|
if ( useVertexColors ) cacheKey += 'vertex-colors:';
|
|
|
if ( useFlatShading ) cacheKey += 'flat-shading:';
|
|
|
|
|
@@ -2983,7 +2982,7 @@ class GLTFParser {
|
|
|
if ( useVertexColors ) cachedMaterial.vertexColors = true;
|
|
|
if ( useFlatShading ) cachedMaterial.flatShading = true;
|
|
|
|
|
|
- if ( useVertexTangents ) {
|
|
|
+ if ( useDerivativeTangents ) {
|
|
|
|
|
|
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
|
|
|
if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1;
|
|
@@ -3130,12 +3129,13 @@ class GLTFParser {
|
|
|
|
|
|
pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) );
|
|
|
|
|
|
- // https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
|
|
|
- materialParams.normalScale = new Vector2( 1, - 1 );
|
|
|
+ materialParams.normalScale = new Vector2( 1, 1 );
|
|
|
|
|
|
if ( materialDef.normalTexture.scale !== undefined ) {
|
|
|
|
|
|
- materialParams.normalScale.set( materialDef.normalTexture.scale, - materialDef.normalTexture.scale );
|
|
|
+ const scale = materialDef.normalTexture.scale;
|
|
|
+
|
|
|
+ materialParams.normalScale.set( scale, scale );
|
|
|
|
|
|
}
|
|
|
|