Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/bxdf/genglsl/gltf_pbr.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
<input name="in" type="vector3" nodename="rotate_tangent" />
</normalize>
<absval name="abs_anisotropy_rotation" type="float">
<input name="in" type="float" interfacename="anisotropy_rotation"/>
<input name="in" type="float" interfacename="anisotropy_rotation" />
</absval>
<ifgreater name="selected_tangent" type="vector3">
<input name="value1" type="float" nodename="abs_anisotropy_rotation" />
Expand Down
33 changes: 16 additions & 17 deletions libraries/bxdf/genglsl/open_pbr_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,21 @@
</multiply>

<!-- Dielectric Base -->
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" interfacename="coat_ior" />
</divide>
<divide name="coat_to_specular_ior_ratio" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" interfacename="specular_ior" />
</divide>
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="value2" type="float" value="1.0" />
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
</ifgreater>
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" interfacename="coat_ior" />
</divide>
<divide name="coat_to_specular_ior_ratio" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" interfacename="specular_ior" />
</divide>
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="value2" type="float" value="1.0" />
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
</ifgreater>
<mix name="eta_s" type="float">
<input name="fg" type="float" nodename="specular_to_coat_ior_ratio_tir_fix" />
<input name="bg" type="float" interfacename="specular_ior" />
Expand Down Expand Up @@ -546,8 +546,7 @@
<!--
OpenPBR Anisotropy node definition
-->
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr"
doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr" doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
<input name="roughness" type="float" value="0.0" />
<input name="anisotropy" type="float" value="0.0" />
<output name="out" type="vector2" />
Expand Down
35 changes: 17 additions & 18 deletions libraries/bxdf/genmdl/open_pbr_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,21 @@
</multiply>

<!-- Dielectric Base -->
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" interfacename="coat_ior" />
</divide>
<divide name="coat_to_specular_ior_ratio" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" interfacename="specular_ior" />
</divide>
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="value2" type="float" value="1.0" />
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
</ifgreater>
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" interfacename="coat_ior" />
</divide>
<divide name="coat_to_specular_ior_ratio" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" interfacename="specular_ior" />
</divide>
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="value2" type="float" value="1.0" />
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
</ifgreater>
<mix name="eta_s" type="float">
<input name="fg" type="float" nodename="specular_to_coat_ior_ratio_tir_fix" />
<input name="bg" type="float" interfacename="specular_ior" />
Expand Down Expand Up @@ -326,7 +326,7 @@
<layer name="dielectric_base_tf" type="BSDF">
<input name="top" type="BSDF" nodename="dielectric_reflection_tf" />
<input name="base" type="BSDF" nodename="dielectric_substrate" />
</layer >
</layer>
<layer name="dielectric_base_notf" type="BSDF">
<input name="top" type="BSDF" nodename="dielectric_reflection" />
<input name="base" type="BSDF" nodename="dielectric_substrate" />
Expand Down Expand Up @@ -543,8 +543,7 @@
<!--
OpenPBR Anisotropy node definition
-->
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr"
doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr" doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
<input name="roughness" type="float" value="0.0" />
<input name="anisotropy" type="float" value="0.0" />
<output name="out" type="vector2" />
Expand Down
2 changes: 1 addition & 1 deletion libraries/bxdf/gltf_pbr.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
<input name="in" type="vector3" nodename="rotate_tangent" />
</normalize>
<absval name="abs_anisotropy_rotation" type="float">
<input name="in" type="float" interfacename="anisotropy_rotation"/>
<input name="in" type="float" interfacename="anisotropy_rotation" />
</absval>
<ifgreater name="selected_tangent" type="vector3">
<input name="value1" type="float" nodename="abs_anisotropy_rotation" />
Expand Down
2 changes: 1 addition & 1 deletion libraries/bxdf/lama/lama_iridescence.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<rotate3d name="tangent_rotate" type="vector3">
<input name="in" type="vector3" interfacename="anisotropyDirection" />
<input name="amount" type="float" nodename="tangent_rotate_degree_offset" />
<input name="axis" type="vector3" nodename="tangent_normal" /> />
<input name="axis" type="vector3" nodename="tangent_normal" />
</rotate3d>
<normalize name="tangent_rotate_normalize" type="vector3">
<input name="in" type="vector3" nodename="tangent_rotate" />
Expand Down
30 changes: 15 additions & 15 deletions libraries/bxdf/open_pbr_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -301,21 +301,21 @@
</multiply>

<!-- Dielectric Base -->
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" interfacename="coat_ior" />
</divide>
<divide name="coat_to_specular_ior_ratio" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" interfacename="specular_ior" />
</divide>
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="value2" type="float" value="1.0" />
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
</ifgreater>
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" interfacename="coat_ior" />
</divide>
<divide name="coat_to_specular_ior_ratio" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" interfacename="specular_ior" />
</divide>
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="value2" type="float" value="1.0" />
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
</ifgreater>
<mix name="eta_s" type="float">
<input name="fg" type="float" nodename="specular_to_coat_ior_ratio_tir_fix" />
<input name="bg" type="float" interfacename="specular_ior" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<output name="diffuse_roughness_out" type="float" />
<output name="metalness_out" type="float" />

<output name="specular_out" type="float"/>
<output name="specular_out" type="float" />
<output name="specular_color_out" type="color3" />
<output name="specular_roughness_out" type="float" />
<output name="specular_IOR_out" type="float" />
Expand Down
12 changes: 6 additions & 6 deletions libraries/bxdf/translation/standard_surface_to_open_pbr.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<input name="specular_anisotropy" type="float" value="0" />

<input name="transmission" type="float" value="0" />
<input name="transmission_color" type="color3" value="1, 1, 1"/>
<input name="transmission_color" type="color3" value="1, 1, 1" />
<input name="transmission_depth" type="float" value="0" />
<input name="transmission_scatter" type="color3" value="0, 0, 0" />
<input name="transmission_scatter_anisotropy" type="float" value="0" />
<input name="transmission_dispersion" type="float" value="0" />

<input name="subsurface" type="float" value="0" uimin="0.0" />
<input name="subsurface_color" type="color3" value="1, 1, 1" />
<input name="subsurface_radius" type="color3" value="1, 1, 1" />
Expand All @@ -36,7 +36,7 @@
<input name="coat_anisotropy" type="float" value="0.0" />
<input name="coat_IOR" type="float" value="1.5" />
<input name="coat_affect_roughness" type="float" value="0" />

<input name="thin_film_thickness" type="float" value="0" />
<input name="thin_film_IOR" type="float" value="1.5" />

Expand Down Expand Up @@ -64,7 +64,7 @@
<output name="transmission_scatter_out" type="color3" />
<output name="transmission_scatter_anisotropy_out" type="float" />
<output name="transmission_dispersion_scale_out" type="float" />

<output name="subsurface_weight_out" type="float" />
<output name="subsurface_color_out" type="color3" />
<output name="subsurface_radius_out" type="float" />
Expand Down Expand Up @@ -132,7 +132,7 @@
</dotproduct>
<!--Intentionally ignoring the original specular_color input for metals, since the translation between these concepts will take more thought.-->
<ifequal name="specColor" type="color3">
<input name="value1" type="float" value="0.0" />
<input name="value1" type="float" value="0.0" />
<input name="value2" type="float" nodename="dotProd" />
<input name="in1" type="color3" value="1.0, 1.0, 1.0" />
<input name="in2" type="color3" interfacename="specular_color" />
Expand Down Expand Up @@ -271,7 +271,7 @@
<output name="specular_roughness_out" type="float" nodename="specRoughness" />
<output name="specular_ior_out" type="float" nodename="specIOR" />
<output name="specular_roughness_anisotropy_out" type="float" nodename="specRoughnessAnisotropy" />

<output name="transmission_weight_out" type="float" nodename="transmissionWeight" />
<output name="transmission_color_out" type="color3" nodename="transmissionColor" />
<output name="transmission_depth_out" type="float" nodename="transmissionDepth" />
Expand Down
4 changes: 2 additions & 2 deletions libraries/bxdf/usd_preview_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
<nodedef name="ND_UsdPrimvarReader_string" nodegroup="geometric" node="UsdPrimvarReader">
<input name="varname" type="string" value="" uniform="true" />
<input name="fallback" type="string" value="" uniform="true" />
<output name="out" type="string" uniform="true"/>
<output name="out" type="string" uniform="true" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_filename" nodegroup="geometric" node="UsdPrimvarReader">
<input name="varname" type="string" value="" uniform="true" />
<input name="fallback" type="filename" value="" uniform="true" />
<output name="out" type="filename" uniform="true"/>
<output name="out" type="filename" uniform="true" />
</nodedef>
<nodedef name="ND_UsdPrimvarReader_float" nodegroup="geometric" node="UsdPrimvarReader">
<input name="varname" type="string" value="" uniform="true" />
Expand Down
6 changes: 2 additions & 4 deletions libraries/cmlib/cmlib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@

<nodegraph name="NG_srgb_displayp3_to_lin_rec709_color3" nodedef="ND_srgb_displayp3_to_lin_rec709_color3">
<constant name="mat" type="matrix33">
<input name="value" type="matrix33"
value="1.22493029, -0.04205868, -0.01964128, -0.22492968, 1.04205894, -0.07864794, 0.00000006,-0.00000001, 1.09828925"/>
<input name="value" type="matrix33" value="1.22493029, -0.04205868, -0.01964128, -0.22492968, 1.04205894, -0.07864794, 0.00000006,-0.00000001, 1.09828925" />
</constant>
<!-- Use srgb_texture_to_lin_rec709 to convert from sRGB to Lin before passing to the mat conversion -->
<srgb_texture_to_lin_rec709 name="srgb_transform" type="color3">
Expand Down Expand Up @@ -355,8 +354,7 @@

<nodegraph name="NG_lin_displayp3_to_lin_rec709_color3" nodedef="ND_lin_displayp3_to_lin_rec709_color3">
<constant name="mat" type="matrix33">
<input name="value" type="matrix33"
value="1.22493029, -0.04205868, -0.01964128, -0.22492968, 1.04205894, -0.07864794, 0.00000006,-0.00000001, 1.09828925"/>
<input name="value" type="matrix33" value="1.22493029, -0.04205868, -0.01964128, -0.22492968, 1.04205894, -0.07864794, 0.00000006,-0.00000001, 1.09828925" />
</constant>
<convert name="asVec" type="vector3">
<input name="in" type="color3" interfacename="in" />
Expand Down
4 changes: 2 additions & 2 deletions libraries/pbrlib/pbrlib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@
<nodedef name="ND_deon_hair_absorption_from_melanin" node="deon_hair_absorption_from_melanin" nodegroup="pbr" doc="Calculates hair absorption from melanin parameters.">
<input name="melanin_concentration" type="float" value="0.25" />
<input name="melanin_redness" type="float" value="0.5" />
<input name="eumelanin_color" type="color3" value="0.657704, 0.498077, 0.254107" colorspace="lin_rec709" doc="constant from d'Eon et al. 2011, converted to color via exp(-c)" uiadvanced="true"/>
<input name="pheomelanin_color" type="color3" value="0.829444, 0.67032, 0.349938" colorspace="lin_rec709" doc="constant from d'Eon et al. 2011, converted to color via exp(-c)" uiadvanced="true"/>
<input name="eumelanin_color" type="color3" value="0.657704, 0.498077, 0.254107" colorspace="lin_rec709" doc="constant from d'Eon et al. 2011, converted to color via exp(-c)" uiadvanced="true" />
<input name="pheomelanin_color" type="color3" value="0.829444, 0.67032, 0.349938" colorspace="lin_rec709" doc="constant from d'Eon et al. 2011, converted to color via exp(-c)" uiadvanced="true" />
<output name="absorption" type="vector3" />
</nodedef>

Expand Down
6 changes: 3 additions & 3 deletions libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,9 @@
<!-- Logical operator nodes -->
<!-- ======================================================================== -->

<implementation name="IM_logical_and_genglsl" nodedef="ND_logical_and" target="genglsl" sourcecode="{{in1}} && {{in2}}"/>
<implementation name="IM_logical_or_genglsl" nodedef="ND_logical_or" target="genglsl" sourcecode="{{in1}} || {{in2}}"/>
<implementation name="IM_logical_not_genglsl" nodedef="ND_logical_not" target="genglsl" sourcecode="!{{in}}"/>
<implementation name="IM_logical_and_genglsl" nodedef="ND_logical_and" target="genglsl" sourcecode="{{in1}} &amp;&amp; {{in2}}" />
Comment thread
jstone-lucasfilm marked this conversation as resolved.
<implementation name="IM_logical_or_genglsl" nodedef="ND_logical_or" target="genglsl" sourcecode="{{in1}} || {{in2}}" />
<implementation name="IM_logical_not_genglsl" nodedef="ND_logical_not" target="genglsl" sourcecode="!{{in}}" />

<!-- ======================================================================== -->
<!-- Organization nodes -->
Expand Down
12 changes: 7 additions & 5 deletions libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@
<implementation name="IM_divide_vector3FA_genmdl" nodedef="ND_divide_vector3FA" sourcecode="{{in1}} / {{in2}}" target="genmdl" />
<implementation name="IM_divide_vector4_genmdl" nodedef="ND_divide_vector4" sourcecode="{{in1}} / {{in2}}" target="genmdl" />
<implementation name="IM_divide_vector4FA_genmdl" nodedef="ND_divide_vector4FA" sourcecode="{{in1}} / {{in2}}" target="genmdl" />
<implementation name="IM_divide_matrix33_genmdl" nodedef="ND_divide_matrix33" sourcecode="{{in1}}" target="genmdl" /> <!-- TODO: Implement properly -->
<implementation name="IM_divide_matrix44_genmdl" nodedef="ND_divide_matrix44" sourcecode="{{in1}}" target="genmdl" /> <!-- TODO: Implement properly -->
<!-- TODO: Implement IM_divide_matrix33_genmdl properly -->
Comment thread
jstone-lucasfilm marked this conversation as resolved.
<implementation name="IM_divide_matrix33_genmdl" nodedef="ND_divide_matrix33" sourcecode="{{in1}}" target="genmdl" />
<!-- TODO: Implement IM_divide_matrix44_genmdl properly -->
<implementation name="IM_divide_matrix44_genmdl" nodedef="ND_divide_matrix44" sourcecode="{{in1}}" target="genmdl" />

<!-- <modulo> -->
<implementation name="IM_modulo_float_genmdl" nodedef="ND_modulo_float" sourcecode="mx_mod({{in1}}, {{in2}})" target="genmdl" />
Expand Down Expand Up @@ -744,9 +746,9 @@
<!-- Logical operator nodes -->
<!-- ======================================================================== -->

<implementation name="IM_logical_and_genmdl" nodedef="ND_logical_and" target="genmdl" sourcecode="{{in1}} && {{in2}}"/>
<implementation name="IM_logical_or_genmdl" nodedef="ND_logical_or" target="genmdl" sourcecode="{{in1}} || {{in2}}"/>
<implementation name="IM_logical_not_genmdl" nodedef="ND_logical_not" target="genmdl" sourcecode="!{{in}}"/>
<implementation name="IM_logical_and_genmdl" nodedef="ND_logical_and" target="genmdl" sourcecode="{{in1}} &amp;&amp; {{in2}}" />
<implementation name="IM_logical_or_genmdl" nodedef="ND_logical_or" target="genmdl" sourcecode="{{in1}} || {{in2}}" />
<implementation name="IM_logical_not_genmdl" nodedef="ND_logical_not" target="genmdl" sourcecode="!{{in}}" />

<!-- ======================================================================== -->
<!-- Organization nodes -->
Expand Down
6 changes: 3 additions & 3 deletions libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@
<!-- Logical operator nodes -->
<!-- ======================================================================== -->

<implementation name="IM_logical_and_genosl" nodedef="ND_logical_and" target="genosl" sourcecode="{{in1}} && {{in2}}"/>
<implementation name="IM_logical_or_genosl" nodedef="ND_logical_or" target="genosl" sourcecode="{{in1}} || {{in2}}"/>
<implementation name="IM_logical_not_genosl" nodedef="ND_logical_not" target="genosl" sourcecode="!{{in}}"/>
<implementation name="IM_logical_and_genosl" nodedef="ND_logical_and" target="genosl" sourcecode="{{in1}} &amp;&amp; {{in2}}" />
<implementation name="IM_logical_or_genosl" nodedef="ND_logical_or" target="genosl" sourcecode="{{in1}} || {{in2}}" />
<implementation name="IM_logical_not_genosl" nodedef="ND_logical_not" target="genosl" sourcecode="!{{in}}" />

<!-- ======================================================================== -->
<!-- Organization nodes -->
Expand Down
Loading