Преглед на файлове

Merge pull request #13415 from takahirox/GLTFExporterMetallicRoughnessTexture

GLTFExporter: Support metallicRoughnessTexture
Mr.doob преди 7 години
родител
ревизия
b1227ff3e5
променени са 1 файла, в които са добавени 19 реда и са изтрити 0 реда
  1. 19 0
      examples/js/exporters/GLTFExporter.js

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

@@ -613,6 +613,25 @@ THREE.GLTFExporter.prototype = {
 
 			}
 
+			// pbrMetallicRoughness.metallicRoughnessTexture
+			if ( material.metalnessMap || material.roughnessMap ) {
+
+				if ( material.metalnessMap === material.roughnessMap ) {
+
+					gltfMaterial.pbrMetallicRoughness.metallicRoughnessTexture = {
+
+						index: processTexture( material.metalnessMap )
+
+					};
+
+				} else {
+
+					console.warn( 'THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.' );
+
+				}
+
+			}
+
 			// pbrMetallicRoughness.baseColorTexture
 			if ( material.map ) {