Skip to content

Commit

Permalink
USDZExporter: Improved material parameter nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 11, 2021
1 parent dbd5d99 commit d5326ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,27 +251,27 @@ function buildMaterial( material ) {

if ( material.map !== null ) {

parameters.push( `${ pad }float3 inputs:diffuseColor.connect = </Textures/Texture_${ material.map.id }.outputs:rgb>` );
parameters.push( `${ pad }color3f inputs:diffuseColor.connect = </Textures/Texture_${ material.map.id }.outputs:rgb>` );

} else {

parameters.push( `${ pad }float3 inputs:diffuseColor = ${ buildColor( material.color ) }` );
parameters.push( `${ pad }color3f inputs:diffuseColor = ${ buildColor( material.color ) }` );

}

if ( material.emissiveMap !== null ) {

parameters.push( `${ pad }float3 inputs:emissiveColor.connect = </Textures/Texture_${ material.emissiveMap.id }.outputs:rgb>` );
parameters.push( `${ pad }color3f inputs:emissiveColor.connect = </Textures/Texture_${ material.emissiveMap.id }.outputs:rgb>` );

} else {

parameters.push( `${ pad }float3 inputs:emissiveColor = ${ buildColor( material.emissive ) }` );
parameters.push( `${ pad }color3f inputs:emissiveColor = ${ buildColor( material.emissive ) }` );

}

if ( material.normalMap !== null ) {

parameters.push( `${ pad }float3 inputs:normal.connect = </Textures/Texture_${ material.normalMap.id }.outputs:rgb>` );
parameters.push( `${ pad }normal3f inputs:normal.connect = </Textures/Texture_${ material.normalMap.id }.outputs:rgb>` );

}

Expand Down

0 comments on commit d5326ca

Please sign in to comment.