Skip to content

Commit

Permalink
Upgrade data libraries to 1.39
Browse files Browse the repository at this point in the history
This changelist upgrades the documents in the MaterialX data libraries to v1.39, leveraging the `mxformat.py` script and making additional minor edits for clarity.
  • Loading branch information
jstone-lucasfilm committed Jun 22, 2024
1 parent 600854b commit 4713ec9
Show file tree
Hide file tree
Showing 35 changed files with 488 additions and 277 deletions.
2 changes: 1 addition & 1 deletion libraries/bxdf/disney_brdf_2012.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<materialx version="1.39" colorspace="lin_rec709">
<nodedef name="ND_disney_brdf_2012_surface" node="disney_brdf_2012" nodegroup="pbr">
<input name="baseColor" type="color3" value="0.16, 0.16, 0.16" />
<input name="metallic" type="float" value="0" />
Expand Down
2 changes: 1 addition & 1 deletion libraries/bxdf/disney_brdf_2015.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<materialx version="1.39" colorspace="lin_rec709">
<nodedef name="ND_disney_bsdf_2015_surface" node="disney_bsdf_2015" nodegroup="pbr">
<input name="baseColor" type="color3" value="0.16, 0.16, 0.16" />
<input name="metallic" type="float" value="0" />
Expand Down
2 changes: 1 addition & 1 deletion libraries/bxdf/lama/lama_dielectric.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<input name="in2" type="float" nodename="ior_float" />
<input name="which" type="integer" interfacename="fresnelMode" />
</switch>

<!-- Roughness -->
<subtract name="roughness_inverse" type="float">
<input name="in1" type="float" value="1.0" />
Expand Down
34 changes: 18 additions & 16 deletions libraries/bxdf/standard_surface.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38">
<materialx version="1.39">
<!--
Autodesk Standard Surface node definition.
-->
Expand All @@ -8,10 +8,11 @@
<input name="base" type="float" value="1.0" uimin="0.0" uimax="1.0" uiname="Base" uifolder="Base"
doc="Multiplier on the intensity of the diffuse reflection." />
<input name="base_color" type="color3" value="0.8, 0.8, 0.8" uimin="0,0,0" uimax="1,1,1" uiname="Base Color" uifolder="Base"
doc="Color of the diffuse reflection." />
doc="Color of the diffuse reflection." />
</nodedef>

<nodedef name="ND_standard_surface_surfaceshader_100" node="standard_surface" nodegroup="pbr" version="1.0.0" doc="Autodesk standard surface shader">
<nodedef name="ND_standard_surface_surfaceshader_100" node="standard_surface" nodegroup="pbr" version="1.0.0"
doc="Autodesk standard surface shader">
<input name="base" type="float" value="0.8" uimin="0.0" uimax="1.0" uiname="Base" uifolder="Base"
doc="Multiplier on the intensity of the diffuse reflection." />
<input name="base_color" type="color3" value="1.0, 1.0, 1.0" uimin="0,0,0" uimax="1,1,1" uiname="Base Color" uifolder="Base"
Expand Down Expand Up @@ -296,6 +297,8 @@
<input name="tangent" type="vector3" nodename="main_tangent" />
<input name="distribution" type="string" value="ggx" />
<input name="scatter_mode" type="string" value="R" />
<input name="thinfilm_thickness" type="float" interfacename="thin_film_thickness" />
<input name="thinfilm_ior" type="float" interfacename="thin_film_IOR" />
</dielectric_bsdf>
<layer name="specular_layer" type="BSDF">
<input name="top" type="BSDF" nodename="specular_bsdf" />
Expand Down Expand Up @@ -323,31 +326,23 @@
<input name="normal" type="vector3" interfacename="normal" />
<input name="tangent" type="vector3" nodename="main_tangent" />
<input name="distribution" type="string" value="ggx" />
<input name="thinfilm_thickness" type="float" interfacename="thin_film_thickness" />
<input name="thinfilm_ior" type="float" interfacename="thin_film_IOR" />
</conductor_bsdf>
<mix name="metalness_mix" type="BSDF">
<input name="fg" type="BSDF" nodename="metal_bsdf" />
<input name="bg" type="BSDF" nodename="specular_layer" />
<input name="mix" type="float" interfacename="metalness" />
</mix>

<!-- Thin-film Layer -->
<thin_film_bsdf name="thin_film_bsdf" type="BSDF">
<input name="thickness" type="float" interfacename="thin_film_thickness" />
<input name="ior" type="float" interfacename="thin_film_IOR" />
</thin_film_bsdf>
<layer name="thin_film_layer" type="BSDF">
<input name="top" type="BSDF" nodename="thin_film_bsdf" />
<input name="base" type="BSDF" nodename="metalness_mix" />
</layer>

<!-- Coat Layer -->
<mix name="coat_attenuation" type="color3">
<input name="fg" type="color3" interfacename="coat_color" />
<input name="bg" type="color3" value="1.0, 1.0, 1.0" />
<input name="mix" type="float" interfacename="coat" />
</mix>
<multiply name="thin_film_layer_attenuated" type="BSDF">
<input name="in1" type="BSDF" nodename="thin_film_layer" />
<input name="in1" type="BSDF" nodename="metalness_mix" />
<input name="in2" type="color3" nodename="coat_attenuation" />
</multiply>
<roughness_anisotropy name="coat_roughness_vector" type="vector2">
Expand Down Expand Up @@ -401,8 +396,11 @@
<input name="in1" type="EDF" nodename="emission_edf" />
<input name="in2" type="color3" interfacename="coat_color" />
</multiply>
<convert name="emission_color0" type="color3">
<input name="in" type="float" nodename="one_minus_coat_ior_to_F0" />
</convert>
<generalized_schlick_edf name="coat_emission_edf" type="EDF">
<input name="color0" type="color3" nodename="one_minus_coat_ior_to_F0" channels="rrr" />
<input name="color0" type="color3" nodename="emission_color0" />
<input name="color90" type="color3" value="0.0, 0.0, 0.0" />
<input name="exponent" type="float" value="5.0" />
<input name="base" type="EDF" nodename="coat_tinted_emission_edf" />
Expand All @@ -418,10 +416,14 @@
<luminance name="opacity_luminance" type="color3">
<input name="in" type="color3" interfacename="opacity" />
</luminance>
<extract name="opacity_luminance_float" type="float">
<input name="in" type="color3" nodename="opacity_luminance" />
<input name="index" type="integer" value="0" />
</extract>
<surface name="shader_constructor" type="surfaceshader">
<input name="bsdf" type="BSDF" nodename="coat_layer" />
<input name="edf" type="EDF" nodename="blended_coat_emission_edf" />
<input name="opacity" type="float" nodename="opacity_luminance" channels="r" />
<input name="opacity" type="float" nodename="opacity_luminance_float" />
</surface>

<!-- Output -->
Expand Down
39 changes: 25 additions & 14 deletions libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38">
<materialx version="1.39">

<nodedef name="ND_standard_surface_to_gltf_pbr" node="standard_surface_to_gltf_pbr" nodegroup="translation">
<input name="base" type="float" value="1" />
Expand Down Expand Up @@ -33,40 +33,51 @@

<nodegraph name="NG_standard_surface_to_gltf_pbr" nodedef="ND_standard_surface_to_gltf_pbr">

<!-- Constants -->
<divide name="constantOneThird" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" value="3" />
</divide>
<convert name="constantOneThirdVector" type="vector3">
<input name="in" type="float" nodename="constantOneThird" />
</convert>

<!-- Coat attenuation -->
<dotproduct name="has_coat_color" type="float">
<input name="in1" type="vector3" interfacename="coat_color" channels="rgb" />
<input name="in2" type="vector3" value="1,1,1" />
<convert name="coatColorVector" type="vector3">
<input name="in" type="color3" interfacename="coat_color" />
</convert>
<dotproduct name="hasCoatColor" type="float">
<input name="in1" type="vector3" nodename="coatColorVector" />
<input name="in2" type="vector3" value="1, 1, 1" />
</dotproduct>
<multiply name="scaledBaseColor" type="color3">
<input name="in1" type="color3" interfacename="base_color" />
<input name="in2" type="float" interfacename="base" />
</multiply>
<mix name="coatAttenuation" type="color3">
<input name="fg" type="color3" interfacename="coat_color" />
<input name="bg" type="color3" value="1.0, 1.0, 1.0" />
<input name="bg" type="color3" value="1, 1, 1" />
<input name="mix" type="float" interfacename="coat" />
</mix>
<multiply name="mixedBaseColor" type="color3">
<input name="in1" type="color3" nodename="scaledBaseColor" />
<input name="in2" type="color3" nodename="coatAttenuation" />
</multiply>
<divide name="constantOneThird" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" value="3" />
</divide>
<multiply name="coatColor" type="color3">
<multiply name="coatColorScaled" type="color3">
<input name="in1" type="color3" interfacename="coat_color" />
<input name="in2" type="float" interfacename="coat" />
</multiply>
<convert name="coatColorScaledVector" type="vector3">
<input name="in" type="color3" nodename="coatColorScaled" />
</convert>
<dotproduct name="weightedCoat" type="float">
<input name="in1" type="vector3" nodename="coatColor" channels="rgb" />
<input name="in2" type="vector3" nodename="constantOneThird" channels="xxx" />
<input name="in1" type="vector3" nodename="coatColorScaledVector" />
<input name="in2" type="vector3" nodename="constantOneThirdVector" />
</dotproduct>

<!-- Metallic roughness -->
<ifequal name="base_color" type="color3">
<input name="value1" type="float" nodename="has_coat_color" />
<input name="value1" type="float" nodename="hasCoatColor" />
<input name="value2" type="float" value="0" />
<input name="in1" type="color3" nodename="scaledBaseColor" />
<input name="in2" type="color3" nodename="mixedBaseColor" />
Expand Down Expand Up @@ -103,7 +114,7 @@

<!-- Clearcoat -->
<ifequal name="clearcoat" type="float">
<input name="value1" type="float" nodename="has_coat_color" />
<input name="value1" type="float" nodename="hasCoatColor" />
<input name="value2" type="float" value="0" />
<input name="in1" type="float" interfacename="coat" />
<input name="in2" type="float" nodename="weightedCoat" />
Expand Down
19 changes: 14 additions & 5 deletions libraries/bxdf/translation/standard_surface_to_usd.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38">
<materialx version="1.39">

<nodedef name="ND_standard_surface_to_UsdPreviewSurface" node="standard_surface_to_UsdPreviewSurface" nodegroup="translation">
<input name="metalness" type="float" value="0" />
Expand Down Expand Up @@ -35,6 +35,9 @@
<input name="in1" type="float" value="1" />
<input name="in2" type="float" value="3" />
</divide>
<convert name="constantOneThirdVector" type="vector3">
<input name="in" type="float" nodename="constantOneThird" />
</convert>

<!-- Diffuse/Specular -->
<dot name="metallic" type="float">
Expand Down Expand Up @@ -65,9 +68,12 @@
<input name="in1" type="color3" interfacename="coat_color" />
<input name="in2" type="float" interfacename="coat" />
</multiply>
<convert name="coatColorVector" type="vector3">
<input name="in" type="color3" nodename="coatColor" />
</convert>
<dotproduct name="clearcoat" type="float">
<input name="in1" type="vector3" nodename="coatColor" channels="rgb" />
<input name="in2" type="vector3" nodename="constantOneThird" channels="xxx" />
<input name="in1" type="vector3" nodename="coatColorVector" />
<input name="in2" type="vector3" nodename="constantOneThirdVector" />
</dotproduct>
<dot name="clearcoatRoughness" type="float">
<input name="in" type="float" interfacename="coat_roughness" />
Expand All @@ -80,9 +86,12 @@
</multiply>

<!-- Opacity -->
<convert name="opacityVector" type="vector3">
<input name="in" type="color3" interfacename="opacity" />
</convert>
<dotproduct name="opacity" type="float">
<input name="in1" type="vector3" interfacename="opacity" channels="rgb" />
<input name="in2" type="vector3" nodename="constantOneThird" channels="xxx" />
<input name="in1" type="vector3" nodename="opacityVector" />
<input name="in2" type="vector3" nodename="constantOneThirdVector" />
</dotproduct>

<!-- Normal Map -->
Expand Down
34 changes: 23 additions & 11 deletions libraries/bxdf/usd_preview_surface.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38">
<materialx version="1.39">

<!-- ======================================================================== -->
<!-- USD Preview Surface node definitions -->
Expand Down Expand Up @@ -300,11 +300,17 @@
<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" />
<separate4 name="image_bias_separate" type="multioutput">
<input name="in" type="color4" nodename="image_bias" />
</separate4>
<convert name="image_bias_color3" type="color3">
<input name="in" type="color4" nodename="image_bias" />
</convert>
<output name="r" type="float" nodename="image_bias_separate" output="outr" />
<output name="g" type="float" nodename="image_bias_separate" output="outg" />
<output name="b" type="float" nodename="image_bias_separate" output="outb" />
<output name="a" type="float" nodename="image_bias_separate" output="outa" />
<output name="rgb" type="color3" nodename="image_bias_color3" />
<output name="rgba" type="color4" nodename="image_bias" />
</nodegraph>

Expand All @@ -324,11 +330,17 @@
<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" />
<separate4 name="image_bias_separate" type="multioutput">
<input name="in" type="color4" nodename="image_bias" />
</separate4>
<convert name="image_bias_color3" type="color3">
<input name="in" type="color4" nodename="image_bias" />
</convert>
<output name="r" type="float" nodename="image_bias_separate" output="outr" />
<output name="g" type="float" nodename="image_bias_separate" output="outg" />
<output name="b" type="float" nodename="image_bias_separate" output="outb" />
<output name="a" type="float" nodename="image_bias_separate" output="outa" />
<output name="rgb" type="color3" nodename="image_bias_color3" />
</nodegraph>

<!-- Node: UsdPrimvarReader -->
Expand Down
2 changes: 1 addition & 1 deletion libraries/cmlib/cmlib_defs.mtlx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<materialx version="1.38">
<materialx version="1.39">
<!--
Copyright Contributors to the MaterialX Project
SPDX-License-Identifier: Apache-2.0
Expand Down
Loading

0 comments on commit 4713ec9

Please sign in to comment.