Skip to content

Commit

Permalink
feat: add normalNode and emissiveNode support for MaterialXLoader (mr…
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst authored and AdaRoseCannon committed Jan 15, 2024
1 parent 5471265 commit 72245f4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/jsm/loaders/MaterialXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,30 @@ class MaterialXNode {

//

let normalNode = null;

if ( inputs.normal ) normalNode = inputs.normal;

//

let emissiveNode = null;

if ( inputs.emission ) emissiveNode = inputs.emission;
if ( inputs.emissionColor ) {

emissiveNode = emissiveNode ? mul( emissiveNode, inputs.emissionColor ) : emissiveNode;

}

//

material.colorNode = colorNode || color( 0.8, 0.8, 0.8 );
material.roughnessNode = roughnessNode || float( 0.2 );
material.metalnessNode = metalnessNode || float( 0 );
material.clearcoatNode = clearcoatNode || float( 0 );
material.clearcoatRoughnessNode = clearcoatRoughnessNode || float( 0 );
if ( normalNode ) material.normalNode = normalNode;
if ( emissiveNode ) material.emissiveNode = emissiveNode;

}

Expand Down

0 comments on commit 72245f4

Please sign in to comment.