Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
343 lines (321 sloc) 16.3 KB
<?xml version="1.0" encoding="UTF-8"?>
<materialx version="1.36">
<!-- ======================================================================== -->
<!-- USD Preview Surface node definitions -->
<!-- ======================================================================== -->
<!-- Node: UsdPreviewSurface -->
<nodedef name="ND_UsdPreviewSurface_surfaceshader" node="UsdPreviewSurface" type="surfaceshader">
<input name="diffuseColor" type="color3" value="0.18, 0.18, 0.18" />
<input name="emissiveColor" type="color3" value="0, 0, 0" />
<input name="useSpecularWorkflow" type="integer" value="0" />
<input name="specularColor" type="color3" value="0, 0, 0" />
<input name="metalness" type="float" value="0" />
<input name="roughness" type="float" value="0.01" />
<input name="clearcoat" type="float" value="0" />
<input name="clearcoatRoughness" type="float" value="0.01" />
<input name="opacity" type="float" value="1" />
<input name="opacityThreshold" type="float" value="0" />
<input name="ior" type="float" value="1.5" />
<input name="normal" type="vector3" value="0, 0, 1"/>
<input name="displacement" type="float" value="0" />
<input name="occlusion" type="float" value="1" />
</nodedef>
<!-- Node: UsdUVTexture -->
<nodedef name="ND_UsdUVTexture" node="UsdUVTexture" type="multioutput">
<parameter name="file" type="filename" />
<input name="st" type="vector2" defaultgeomprop="UV0" />
<parameter name="wrapS" type="string" value="periodic" enum="black,clamp,periodic" />
<parameter name="wrapT" type="string" value="periodic" enum="black,clamp,periodic" />
<parameter name="fallback" type="color4" value="0, 0, 0, 1" />
<input name="scale" type="color4" value="1, 1, 1, 1" />
<input name="bias" type="color4" value="0, 0, 0, 0" />
<output name="r" type="float" />
<output name="g" type="float" />
<output name="b" type="float" />
<output name="a" type="float" />
<output name="rgb" type="color3" />
<output name="rgba" type="color4" />
</nodedef>
<!-- Node: UsdPrimvarReader -->
<nodedef name="ND_UsdPrimvarReader_integer" node="UsdPrimvarReader" type="integer">
<parameter name="varname" type="string" />
<parameter name="fallback" type="integer" value="0" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_boolean" node="UsdPrimvarReader" type="boolean">
<parameter name="varname" type="string" />
<parameter name="fallback" type="boolean" value="false" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_string" node="UsdPrimvarReader" type="string">
<parameter name="varname" type="string" />
<parameter name="fallback" type="string" value="" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_float" node="UsdPrimvarReader" type="float">
<parameter name="varname" type="string" />
<parameter name="fallback" type="float" value="0" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_vector2" node="UsdPrimvarReader" type="vector2">
<parameter name="varname" type="string" />
<parameter name="fallback" type="vector2" value="0, 0" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_vector3" node="UsdPrimvarReader" type="vector3">
<parameter name="varname" type="string" />
<parameter name="fallback" type="vector3" value="0, 0, 0" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_vector4" node="UsdPrimvarReader" type="vector4">
<parameter name="varname" type="string" />
<parameter name="fallback" type="vector4" value="0, 0, 0, 0" />
</nodedef>
<!-- TODO: Getting primvar of matrix type is not supported in MaterialX standard library.
<nodedef name="ND_UsdPrimvarReader_matrix44" node="UsdPrimvarReader" type="matrix44">
<parameter name="varname" type="string" />
<parameter name="fallback" type="matrix44" value="1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1" />
</nodedef>
-->
<!-- Node: UsdTransform2d -->
<nodedef name="ND_UsdTransform2d" node="UsdTransform2d" type="vector2">
<input name="in" type="vector2"/>
<input name="rotation" type="float" value="0"/>
<input name="scale" type="vector2" value="1, 1"/>
<input name="translation" type="vector2" value="0, 0"/>
</nodedef>
<!-- ======================================================================== -->
<!-- USD Preview Surface nodegraph implementations -->
<!-- ======================================================================== -->
<!-- Node: UsdPreviewSurface -->
<nodegraph name="IMP_UsdPreviewSurface_surfaceshader" nodedef="ND_UsdPreviewSurface_surfaceshader">
<!-- Calculate normal from tangent space input-->
<normal name="Nw" type="vector3">
<parameter name="space" type="string" value="world"/>
</normal>
<tangent name="Tw" type="vector3">
<parameter name="space" type="string" value="world"/>
</tangent>
<bitangent name="Bw" type="vector3">
<parameter name="space" type="string" value="world"/>
</bitangent>
<separate name="normal_components" type="multioutput">
<input name="in" type="vector3" interfacename="normal"/>
<output name="outx" type="float" />
<output name="outy" type="float" />
<output name="outz" type="float" />
</separate>
<multiply name="normal_x" type="vector3">
<input name="in1" type="vector3" nodename="Tw"/>
<input name="in2" type="float" nodename="normal_components" output="outx"/>
</multiply>
<multiply name="normal_y" type="vector3">
<input name="in1" type="vector3" nodename="Bw"/>
<input name="in2" type="float" nodename="normal_components" output="outy"/>
</multiply>
<multiply name="normal_z" type="vector3">
<input name="in1" type="vector3" nodename="Nw"/>
<input name="in2" type="float" nodename="normal_components" output="outz"/>
</multiply>
<add name="normal_xy" type="vector3">
<input name="in1" type="vector3" nodename="normal_x"/>
<input name="in2" type="vector3" nodename="normal_y"/>
</add>
<add name="normal_xyz" type="vector3">
<input name="in1" type="vector3" nodename="normal_xy"/>
<input name="in2" type="vector3" nodename="normal_z"/>
</add>
<normalize name="surface_normal" type="vector3">
<input name="in" type="vector3" nodename="normal_xyz"/>
</normalize>
<!-- Diffuse Layer -->
<diffuse_brdf name="diffuse_bsdf" type="BSDF">
<input name="weight" type="float" value="1" />
<input name="color" type="color3" interfacename="diffuseColor" />
<input name="roughness" type="float" value="0" />
<input name="normal" type="vector3" nodename="surface_normal" />
</diffuse_brdf>
<!-- Transmission Layer -->
<dielectric_btdf name="transmission_bsdf" type="BSDF">
<input name="weight" type="float" value="1" />
<input name="tint" type="color3" value="1, 1, 1" />
<input name="ior" type="float" interfacename="ior" />
<input name="normal" type="vector3" nodename="surface_normal" />
</dielectric_btdf>
<mix name="transmission_mix" type="BSDF">
<input name="fg" type="BSDF" nodename="diffuse_bsdf" />
<input name="bg" type="BSDF" nodename="transmission_bsdf" />
<input name="mix" type="float" interfacename="opacity" />
</mix>
<!-- Specular Workflow -->
<roughness_anisotropy name="specular_roughness" type="vector2">
<input name="roughness" type="float" interfacename="roughness" />
<input name="anisotropy" type="float" value="0" />
</roughness_anisotropy>
<generalized_schlick_brdf name="specular_workflow_bsdf" type="BSDF">
<input name="weight" type="float" value="1" />
<input name="color0" type="color3" interfacename="specularColor" />
<input name="color90" type="color3" value="1, 1, 1" />
<input name="roughness" type="vector2" nodename="specular_roughness" />
<input name="normal" type="vector3" nodename="surface_normal" />
<input name="base" type="BSDF" nodename="transmission_mix" />
</generalized_schlick_brdf>
<!-- Metalness Workflow -->
<subtract name="one_minus_ior" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" interfacename="ior" />
</subtract>
<add name="one_plus_ior" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" interfacename="ior" />
</add>
<divide name="div_ior" type="float">
<input name="in1" type="float" nodename="one_minus_ior" />
<input name="in2" type="float" nodename="one_plus_ior" />
</divide>
<multiply name="F0" type="float">
<input name="in1" type="float" nodename="div_ior" />
<input name="in2" type="float" nodename="div_ior" />
</multiply>
<multiply name="F0_albedo" type="color3">
<input name="in1" type="color3" interfacename="diffuseColor" />
<input name="in2" type="float" nodename="F0" />
</multiply>
<generalized_schlick_brdf name="metalness_specular_bsdf" type="BSDF">
<input name="weight" type="float" value="1" />
<input name="color0" type="color3" nodename="F0" channels="rrr"/>
<input name="color90" type="color3" value="1, 1, 1" />
<input name="roughness" type="vector2" nodename="specular_roughness" />
<input name="normal" type="vector3" nodename="surface_normal" />
<input name="base" type="BSDF" nodename="transmission_mix" />
</generalized_schlick_brdf>
<conductor_brdf name="metalness_metal_bsdf" type="BSDF">
<input name="weight" type="float" value="1" />
<input name="reflectivity" type="color3" nodename="F0_albedo" />
<input name="edge_color" type="color3" interfacename="diffuseColor" />
<input name="roughness" type="vector2" nodename="specular_roughness" />
<input name="normal" type="vector3" nodename="surface_normal" />
</conductor_brdf>
<mix name="metalness_workflow_bsdf" type="BSDF">
<input name="fg" type="BSDF" nodename="metalness_metal_bsdf" />
<input name="bg" type="BSDF" nodename="metalness_specular_bsdf" />
<input name="mix" type="float" interfacename="metalness" />
</mix>
<!-- Select Specular/Metalness workflow -->
<convert name="use_specular_workflow_float" type="float">
<input name="in" type="integer" interfacename="useSpecularWorkflow" />
</convert>
<mix name="workflow_selector_bsdf" type="BSDF">
<input name="fg" type="BSDF" nodename="specular_workflow_bsdf" />
<input name="bg" type="BSDF" nodename="metalness_workflow_bsdf" />
<input name="mix" type="float" nodename="use_specular_workflow_float" />
</mix>
<!-- Clearcoat Layer -->
<roughness_anisotropy name="coat_roughness" type="vector2">
<input name="roughness" type="float" interfacename="clearcoatRoughness" />
<input name="anisotropy" type="float" value="0" />
</roughness_anisotropy>
<dielectric_brdf name="coat_bsdf" type="BSDF">
<input name="weight" type="float" interfacename="clearcoat" />
<input name="tint" type="color3" value="1, 1, 1" />
<input name="ior" type="float" value="1.5" />
<input name="roughness" type="vector2" nodename="coat_roughness" />
<input name="normal" type="vector3" nodename="surface_normal" />
<input name="base" type="BSDF" nodename="workflow_selector_bsdf" />
</dielectric_brdf>
<!-- Emission Layer -->
<uniform_edf name="emission_edf" type="EDF">
<input name="color" type="color3" interfacename="emissiveColor" />
</uniform_edf>
<!-- Surface Shader Constructor -->
<clamp name="opacity_clamped" type="float">
<input name="in" type="float" interfacename="opacity"/>
<parameter name="low" type="float" value="0.00001"/>
<parameter name="high" type="float" value="1.0"/>
</clamp>
<compare name="cutout_opacity" type="float">
<input name="intest" type="float" nodename="opacity_clamped" />
<parameter name="cutoff" type="float" interfacename="opacityThreshold" />
<input name="in1" type="float" value="0" />
<input name="in2" type="float" value="1" />
</compare>
<surface name="surface_constructor" type="surfaceshader">
<input name="bsdf" type="BSDF" nodename="coat_bsdf" />
<input name="edf" type="EDF" nodename="emission_edf" />
<input name="opacity" type="float" nodename="cutout_opacity"/>
</surface>
<!-- Output -->
<output name="surface" type="surfaceshader" nodename="surface_constructor" />
</nodegraph>
<!-- Node: UsdUVTexture -->
<nodegraph name="IMP_UsdUVTexture" nodedef="ND_UsdUVTexture">
<image name="image_reader" type="color4">
<parameter name="file" type="filename" interfacename="file"/>
<parameter name="default" type="color4" interfacename="fallback"/>
<input name="texcoord" type="vector2" interfacename="st"/>
<parameter name="uaddressmode" type="string" interfacename="wrapS"/>
<parameter name="vaddressmode" type="string" interfacename="wrapT"/>
</image>
<multiply name="image_scale" type="color4">
<input name="in1" type="color4" nodename="image_reader"/>
<input name="in2" type="color4" interfacename="scale"/>
</multiply>
<add name="image_bias" type="color4">
<input name="in1" type="color4" nodename="image_scale"/>
<input name="in2" type="color4" interfacename="bias"/>
</add>
<output name="r" type="float" nodename="image_bias" channels="r"/>
<output name="g" type="float" nodename="image_bias" channels="g"/>
<output name="b" type="float" nodename="image_bias" channels="b"/>
<output name="a" type="float" nodename="image_bias" channels="a"/>
<output name="rgb" type="color3" nodename="image_bias" channels="rgb"/>
<output name="rgba" type="color4" nodename="image_bias" />
</nodegraph>
<!-- Node: UsdPrimvarReader -->
<nodegraph name="IMP_UsdPrimvarReader_integer" nodedef="ND_UsdPrimvarReader_integer">
<geomattrvalue name="primvar" type="integer">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="integer" nodename="primvar"/>
</nodegraph>
<nodegraph name="IMP_UsdPrimvarReader_boolean" nodedef="ND_UsdPrimvarReader_boolean">
<geomattrvalue name="primvar" type="boolean">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="boolean" nodename="primvar"/>
</nodegraph>
<nodegraph name="IMP_UsdPrimvarReader_string" nodedef="ND_UsdPrimvarReader_string">
<geomattrvalue name="primvar" type="string">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="string" nodename="primvar"/>
</nodegraph>
<nodegraph name="IMP_UsdPrimvarReader_float" nodedef="ND_UsdPrimvarReader_float">
<geomattrvalue name="primvar" type="float">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="float" nodename="primvar"/>
</nodegraph>
<nodegraph name="IMP_UsdPrimvarReader_vector2" nodedef="ND_UsdPrimvarReader_vector2">
<geomattrvalue name="primvar" type="vector2">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="vector2" nodename="primvar"/>
</nodegraph>
<nodegraph name="IMP_UsdPrimvarReader_vector3" nodedef="ND_UsdPrimvarReader_vector3">
<geomattrvalue name="primvar" type="vector3">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="vector3" nodename="primvar"/>
</nodegraph>
<nodegraph name="IMP_UsdPrimvarReader_vector4" nodedef="ND_UsdPrimvarReader_vector4">
<geomattrvalue name="primvar" type="vector4">
<parameter name="attrname" type="string" interfacename="varname"/>
</geomattrvalue>
<output name="result" type="vector4" nodename="primvar"/>
</nodegraph>
<!-- Node: UsdTransform2d -->
<nodegraph name="IMP_UsdTransform2d" nodedef="ND_UsdTransform2d">
<place2d name="placement" type="vector2">
<input name="texcoord" type="vector2" interfacename="in"/>
<input name="scale" type="vector2" interfacename="scale"/>
<input name="rotate" type="float" interfacename="rotation"/>
<input name="offset" type="vector2" interfacename="translation"/>
</place2d>
<output name="result" type="vector2" nodename="placement"/>
</nodegraph>
</materialx>
You can’t perform that action at this time.