Sfoglia il codice sorgente

USDZExporter: Only include metalnessMap/roughnessMap when metalness/roughness is 1 (#22201)

Mr.doob 4 anni fa
parent
commit
e203359dc8
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      examples/jsm/exporters/USDZExporter.js

+ 2 - 2
examples/jsm/exporters/USDZExporter.js

@@ -425,7 +425,7 @@ function buildMaterial( material, textures ) {
 
 	}
 
-	if ( material.roughnessMap !== null ) {
+	if ( material.roughnessMap !== null && material.roughness === 1 ) {
 
 		inputs.push( `${ pad }float inputs:roughness.connect = </Materials/Material_${ material.id }/Texture_${ material.roughnessMap.id }_roughness.outputs:g>` );
 
@@ -437,7 +437,7 @@ function buildMaterial( material, textures ) {
 
 	}
 
-	if ( material.metalnessMap !== null ) {
+	if ( material.metalnessMap !== null && material.metalness === 1 ) {
 
 		inputs.push( `${ pad }float inputs:metallic.connect = </Materials/Material_${ material.id }/Texture_${ material.metalnessMap.id }_metallic.outputs:b>` );