Browse Source

GLTFExporter: Added normalMap scale

Fernando Serrano 8 years ago
parent
commit
9568c9f4fb
1 changed files with 12 additions and 0 deletions
  1. 12 0
      examples/js/exporters/GLTFExporter.js

+ 12 - 0
examples/js/exporters/GLTFExporter.js

@@ -500,6 +500,18 @@ THREE.GLTFExporter.prototype = {
 
 				};
 
+				if ( material.normalScale.x !== -1 ) {
+
+					if ( material.normalScale.x !== material.normalScale.y ) {
+
+						console.warn('GLTFExporter: Normal scale components are different, ignoring Y and exporting X');
+
+					}
+
+					gltfMaterial.normalTexture.scale = material.normalScale.x;
+
+				}
+
 			}
 
 			// occlusionTexture