Skip to content

Commit

Permalink
Remove duplicate bindings in documents
Browse files Browse the repository at this point in the history
This changelist removes duplicate data bindings from the library and example documents in MaterialX, allowing this case to be potentially flagged as a validation warning in a future update.

Additionally, a handful of unit tests that depended upon duplicate bindings being present have been removed from the test suite.
  • Loading branch information
jstone-lucasfilm committed Oct 13, 2022
1 parent e82d4df commit d67431b
Show file tree
Hide file tree
Showing 22 changed files with 143 additions and 155 deletions.
98 changes: 49 additions & 49 deletions libraries/bxdf/gltf_pbr.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -389,17 +389,17 @@
<input name="index" type="integer" uniform="true" interfacename="uvindex" />
</texcoord>
<gltf_image name="image" type="color4">
<input name="file" type="filename" uniform="true" interfacename="file" value="" />
<input name="default" type="color4" interfacename="default" value="0, 0, 0, 0" />
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="color4" interfacename="default" />
<input name="uvindex" type="integer" interfacename="uvindex" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 1" />
<input name="scale" type="vector2" interfacename="scale" value="1, 1" />
<input name="rotate" type="float" interfacename="rotate" value="0" />
<input name="offset" type="vector2" interfacename="offset" value="0, 0" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" interfacename="scale" />
<input name="rotate" type="float" interfacename="rotate" />
<input name="offset" type="vector2" interfacename="offset" />
<input name="operationorder" type="integer" value="0" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</gltf_image>
<multiply name="modulate_color" type="color4">
<input name="in1" type="color4" interfacename="color" />
Expand Down Expand Up @@ -461,11 +461,11 @@
</texcoord>
<image name="image" type="color3">
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="color3" interfacename="default" value="0, 0, 0" />
<input name="default" type="color3" interfacename="default" />
<input name="texcoord" type="vector2" nodename="place2d" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</image>
<divide name="invert_scale" type="vector2">
<input name="in1" type="vector2" value="1.0, 1.0" />
Expand All @@ -481,11 +481,11 @@
</multiply>
<place2d name="place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 1" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" nodename="invert_scale" />
<input name="rotate" type="float" nodename="negate_rotate" />
<input name="offset" type="vector2" nodename="negate_offset" />
<input name="operationorder" type="integer" interfacename="operationorder" value="0" />
<input name="operationorder" type="integer" interfacename="operationorder" />
</place2d>
<multiply name="scale_image" type="color3">
<input name="in1" type="color3" interfacename="factor" />
Expand Down Expand Up @@ -531,11 +531,11 @@
</texcoord>
<image name="image" type="color4">
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="color4" interfacename="default" value="0, 0, 0, 0" />
<input name="default" type="color4" interfacename="default" />
<input name="texcoord" type="vector2" nodename="place2d" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</image>
<divide name="invert_scale" type="vector2">
<input name="in1" type="vector2" value="1.0, 1.0" />
Expand All @@ -551,11 +551,11 @@
</multiply>
<place2d name="place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 1" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" nodename="invert_scale" />
<input name="rotate" type="float" nodename="negate_rotate" />
<input name="offset" type="vector2" nodename="negate_offset" />
<input name="operationorder" type="integer" interfacename="operationorder" value="0" />
<input name="operationorder" type="integer" interfacename="operationorder" />
</place2d>
<multiply name="scale_image" type="color4">
<input name="in1" type="color4" interfacename="factor" />
Expand Down Expand Up @@ -601,11 +601,11 @@
</texcoord>
<image name="image" type="float">
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="float" interfacename="default" value="0" />
<input name="default" type="float" interfacename="default" />
<input name="texcoord" type="vector2" nodename="place2d" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</image>
<divide name="invert_scale" type="vector2">
<input name="in1" type="vector2" value="1.0, 1.0" />
Expand All @@ -621,11 +621,11 @@
</multiply>
<place2d name="place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 1" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" nodename="invert_scale" />
<input name="rotate" type="float" nodename="negate_rotate" />
<input name="offset" type="vector2" nodename="negate_offset" />
<input name="operationorder" type="integer" interfacename="operationorder" value="0" />
<input name="operationorder" type="integer" interfacename="operationorder" />
</place2d>
<multiply name="scale_image" type="float">
<input name="in1" type="float" interfacename="factor" />
Expand Down Expand Up @@ -669,11 +669,11 @@
</texcoord>
<image name="image" type="vector3">
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="vector3" interfacename="default" value="0, 0, 0" />
<input name="default" type="vector3" interfacename="default" />
<input name="texcoord" type="vector2" nodename="place2d" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</image>
<divide name="invert_scale" type="vector2">
<input name="in1" type="vector2" value="1.0, 1.0" />
Expand All @@ -689,11 +689,11 @@
</multiply>
<place2d name="place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 1" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" nodename="invert_scale" />
<input name="rotate" type="float" nodename="negate_rotate" />
<input name="offset" type="vector2" nodename="negate_offset" />
<input name="operationorder" type="integer" interfacename="operationorder" value="0" />
<input name="operationorder" type="integer" interfacename="operationorder" />
</place2d>
<output name="out" type="vector3" nodename="image" />
</nodegraph>
Expand Down Expand Up @@ -733,11 +733,11 @@
</texcoord>
<image name="image" type="vector3">
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="vector3" interfacename="default" value="0.5, 0.5, 1" />
<input name="default" type="vector3" interfacename="default" />
<input name="texcoord" type="vector2" nodename="place2d" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</image>
<normalmap name="normalmap" type="vector3">
<input name="in" type="vector3" nodename="image" />
Expand All @@ -756,11 +756,11 @@
</multiply>
<place2d name="place2d" type="vector2" nodedef="ND_place2d_vector2">
<input name="texcoord" type="vector2" nodename="texcoord1" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 1" />
<input name="scale" type="vector2" nodename="invert_scale" value="1, 1" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" nodename="invert_scale" />
<input name="rotate" type="float" nodename="negate_rotate" />
<input name="offset" type="vector2" nodename="negate_offset" />
<input name="operationorder" type="integer" interfacename="operationorder" value="0" />
<input name="operationorder" type="integer" interfacename="operationorder" />
</place2d>
<output name="out" type="vector3" nodename="normalmap" />
</nodegraph>
Expand Down Expand Up @@ -798,21 +798,21 @@
<input name="thicknessMin" type="float" value="100" />
<input name="thicknessMax" type="float" value="400" />
<mix name="mixThickness" type="float" nodedef="ND_mix_float">
<input name="fg" type="float" interfacename="thicknessMin" value="0" />
<input name="bg" type="float" interfacename="thicknessMax" value="0" />
<input name="fg" type="float" interfacename="thicknessMin" />
<input name="bg" type="float" interfacename="thicknessMax" />
<input name="mix" type="float" nodename="extract" />
</mix>
<gltf_image name="thickness_image" type="vector3">
<input name="file" type="filename" uniform="true" interfacename="file" />
<input name="default" type="vector3" interfacename="default" value="0, 0, 0" />
<input name="uvindex" type="integer" interfacename="uvindex" value="0" />
<input name="pivot" type="vector2" interfacename="pivot" value="0, 0" />
<input name="scale" type="vector2" interfacename="scale" value="1, 1" />
<input name="rotate" type="float" interfacename="rotate" value="0" />
<input name="offset" type="vector2" interfacename="offset" value="0, 0" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" value="periodic" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" value="periodic" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" value="linear" />
<input name="default" type="vector3" interfacename="default" />
<input name="uvindex" type="integer" interfacename="uvindex" />
<input name="pivot" type="vector2" interfacename="pivot" />
<input name="scale" type="vector2" interfacename="scale" />
<input name="rotate" type="float" interfacename="rotate" />
<input name="offset" type="vector2" interfacename="offset" />
<input name="uaddressmode" type="string" uniform="true" interfacename="uaddressmode" />
<input name="vaddressmode" type="string" uniform="true" interfacename="vaddressmode" />
<input name="filtertype" type="string" uniform="true" interfacename="filtertype" />
</gltf_image>
<extract name="extract" type="float">
<input name="in" type="vector3" nodename="thickness_image" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
<output name="out" type="surfaceshader" nodename="standard_surface_metal" />
<standard_surface name="standard_surface_metal" type="surfaceshader">
<input name="base" type="float" value="0.8" />
<input name="base_color" type="color3" value="1, 1, 1" interfacename="MetalF0" />
<input name="base_color" type="color3" interfacename="MetalF0" />
<input name="diffuse_roughness" type="float" value="0" />
<input name="specular" type="float" value="1" />
<input name="specular_color" type="color3" value="1, 1, 1" interfacename="SurfaceAlbedo" />
<input name="specular_roughness" type="float" value="0.1" interfacename="SurfaceRoughness" />
<input name="specular_color" type="color3" interfacename="SurfaceAlbedo" />
<input name="specular_roughness" type="float" interfacename="SurfaceRoughness" />
<input name="specular_IOR" type="float" value="1.52" />
<input name="specular_anisotropy" type="float" value="0" interfacename="SurfaceAnisotropy" />
<input name="specular_rotation" type="float" value="0" interfacename="SurfaceRotation" />
<input name="specular_anisotropy" type="float" interfacename="SurfaceAnisotropy" />
<input name="specular_rotation" type="float" interfacename="SurfaceRotation" />
<input name="metalness" type="float" value="1" />
<input name="normal" type="vector3" value="1, 1, 1" interfacename="SurfaceNormal" />
<input name="normal" type="vector3" interfacename="SurfaceNormal" />
<input name="tangent" type="vector3" value="0.0, 0.0, 0.0" />
<input name="opacity" type="color3" value="1, 1, 1" interfacename="SurfaceCutout" />
<input name="opacity" type="color3" interfacename="SurfaceCutout" />
<input name="coat" type="float" value="0" />
<input name="coat_color" type="color3" value="1, 1, 1" />
<input name="coat_roughness" type="float" value="0.1" />
Expand Down
2 changes: 1 addition & 1 deletion resources/Materials/TestSuite/pbrlib/bsdf/bsdf_graph.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<input name="specularColor" type="color3" value="1.0, 1.0, 1.0" />
</mybsdf>
<surface name="surface1" type="surfaceshader">
<input name="bsdf" type="BSDF" value="" nodename="mybsdf1" />
<input name="bsdf" type="BSDF" nodename="mybsdf1" />
<input name="edf" type="EDF" value="" />
<input name="opacity" type="float" value="1.0" />
</surface>
Expand Down
14 changes: 7 additions & 7 deletions resources/Materials/TestSuite/pbrlib/bsdf/mix_bsdf.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
</nodedef>
<nodegraph name="IMP_substratebsdf" nodedef="ND_substratebsdf">
<oren_nayar_diffuse_bsdf name="diffuse" type="BSDF">
<input name="color" type="color3" interfacename="albedo" value="0.9, 0.1, 0.1" />
<input name="color" type="color3" interfacename="albedo" />
</oren_nayar_diffuse_bsdf>
<translucent_bsdf name="subsurface2" type="BSDF">
<input name="color" type="color3" interfacename="subsurface" value="0.1, 0.1, 0.8" />
<input name="color" type="color3" interfacename="subsurface" />
</translucent_bsdf>
<mix name="mix1" type="BSDF">
<input name="fg" type="BSDF" nodename="diffuse" />
Expand All @@ -69,17 +69,17 @@
</nodedef>
<nodegraph name="IMP_substrateshader" nodedef="ND_substrateshader">
<substratebsdf name="substrate1" type="BSDF">
<input name="albedo" type="color3" value="0.8, 0.2, 0.1" interfacename="albedo" />
<input name="subsurface" type="color3" value="0.1, 0.1, 0.8" interfacename="subsurface" />
<input name="subsurface_weight" type="float" value="0.0" interfacename="subsurface_weight" />
<input name="albedo" type="color3" interfacename="albedo" />
<input name="subsurface" type="color3" interfacename="subsurface" />
<input name="subsurface_weight" type="float" interfacename="subsurface_weight" />
</substratebsdf>
<uniform_edf name="edf1" type="EDF">
<input name="color" type="color3" value="0.0, 0.0, 0.0" interfacename="emission" />
<input name="color" type="color3" interfacename="emission" />
</uniform_edf>
<surface name="surface1" type="surfaceshader">
<input name="bsdf" type="BSDF" nodename="substrate1" />
<input name="edf" type="EDF" nodename="edf1" />
<input name="opacity" type="float" value="1.0" interfacename="opacity" />
<input name="opacity" type="float" interfacename="opacity" />
</surface>
<output name="out" type="surfaceshader" nodename="surface1" />
</nodegraph>
Expand Down
6 changes: 3 additions & 3 deletions resources/Materials/TestSuite/pbrlib/bsdf/transmission.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
<input name="normal" type="vector3" value="0.0, 0.0, 0.0" />
</oren_nayar_diffuse_bsdf>
<mix name="mix1" type="BSDF">
<input name="fg" type="BSDF" value="" nodename="diffuse_brdf2" />
<input name="bg" type="BSDF" value="" nodename="dielectric_btdf1" />
<input name="fg" type="BSDF" nodename="diffuse_brdf2" />
<input name="bg" type="BSDF" nodename="dielectric_btdf1" />
<input name="mix" type="float" interfacename="transmission" />
</mix>
<surface name="surface3" type="surfaceshader">
<input name="bsdf" type="BSDF" value="" nodename="mix1" />
<input name="bsdf" type="BSDF" nodename="mix1" />
<input name="edf" type="EDF" value="" />
<input name="opacity" type="float" value="1.0000" />
</surface>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
<input name="base" type="BSDF" nodename="mybsdf1" />
</layer>
<surface name="surface1" type="surfaceshader">
<input name="bsdf" type="BSDF" value="" nodename="layer1" />
<input name="bsdf" type="BSDF" nodename="layer1" />
</surface>
<output name="out" type="surfaceshader" nodename="surface1" />
</nodegraph>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<materialx version="1.38">
<nodegraph name="lighting1">
<surface name="surface1" type="surfaceshader">
<input name="bsdf" type="BSDF" value="" nodename="diffusebsdf1" />
<input name="bsdf" type="BSDF" nodename="diffusebsdf1" />
<input name="edf" type="EDF" value="" />
<input name="opacity" type="float" value="1.0" />
</surface>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<materialx version="1.38">
<nodegraph name="nodegraph1">
<mix name="mix_surface_shader" type="surfaceshader">
<input name="fg" type="surfaceshader" value="" nodename="standard_surface1" />
<input name="bg" type="surfaceshader" value="" nodename="standard_surface2" />
<input name="fg" type="surfaceshader" nodename="standard_surface1" />
<input name="bg" type="surfaceshader" nodename="standard_surface2" />
<input name="mix" type="float" value="0.5000" />
</mix>
<standard_surface name="standard_surface1" type="surfaceshader">
Expand Down
Loading

0 comments on commit d67431b

Please sign in to comment.