Skip to content

Commit 2a59812

Browse files
committed
- Fix mx_format to check all subfolders when looking for files.
- Add in XML syntax checking and validation as options. - Apply to libraries to fix some implementation files.
1 parent b91ec7a commit 2a59812

29 files changed

Lines changed: 452 additions & 604 deletions

libraries/bxdf/genglsl/gltf_pbr.mtlx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
<input name="in" type="vector3" nodename="rotate_tangent" />
309309
</normalize>
310310
<absval name="abs_anisotropy_rotation" type="float">
311-
<input name="in" type="float" interfacename="anisotropy_rotation"/>
311+
<input name="in" type="float" interfacename="anisotropy_rotation" />
312312
</absval>
313313
<ifgreater name="selected_tangent" type="vector3">
314314
<input name="value1" type="float" nodename="abs_anisotropy_rotation" />

libraries/bxdf/genglsl/open_pbr_surface.mtlx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,21 @@
211211
</multiply>
212212

213213
<!-- Dielectric Base -->
214-
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
215-
<divide name="specular_to_coat_ior_ratio" type="float">
216-
<input name="in1" type="float" interfacename="specular_ior" />
217-
<input name="in2" type="float" interfacename="coat_ior" />
218-
</divide>
219-
<divide name="coat_to_specular_ior_ratio" type="float">
220-
<input name="in1" type="float" interfacename="coat_ior" />
221-
<input name="in2" type="float" interfacename="specular_ior" />
222-
</divide>
223-
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
224-
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
225-
<input name="value2" type="float" value="1.0" />
226-
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
227-
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
228-
</ifgreater>
214+
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
215+
<divide name="specular_to_coat_ior_ratio" type="float">
216+
<input name="in1" type="float" interfacename="specular_ior" />
217+
<input name="in2" type="float" interfacename="coat_ior" />
218+
</divide>
219+
<divide name="coat_to_specular_ior_ratio" type="float">
220+
<input name="in1" type="float" interfacename="coat_ior" />
221+
<input name="in2" type="float" interfacename="specular_ior" />
222+
</divide>
223+
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
224+
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
225+
<input name="value2" type="float" value="1.0" />
226+
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
227+
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
228+
</ifgreater>
229229
<mix name="eta_s" type="float">
230230
<input name="fg" type="float" nodename="specular_to_coat_ior_ratio_tir_fix" />
231231
<input name="bg" type="float" interfacename="specular_ior" />
@@ -546,8 +546,7 @@
546546
<!--
547547
OpenPBR Anisotropy node definition
548548
-->
549-
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr"
550-
doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
549+
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr" doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
551550
<input name="roughness" type="float" value="0.0" />
552551
<input name="anisotropy" type="float" value="0.0" />
553552
<output name="out" type="vector2" />

libraries/bxdf/genmdl/open_pbr_surface.mtlx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -210,21 +210,21 @@
210210
</multiply>
211211

212212
<!-- Dielectric Base -->
213-
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
214-
<divide name="specular_to_coat_ior_ratio" type="float">
215-
<input name="in1" type="float" interfacename="specular_ior" />
216-
<input name="in2" type="float" interfacename="coat_ior" />
217-
</divide>
218-
<divide name="coat_to_specular_ior_ratio" type="float">
219-
<input name="in1" type="float" interfacename="coat_ior" />
220-
<input name="in2" type="float" interfacename="specular_ior" />
221-
</divide>
222-
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
223-
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
224-
<input name="value2" type="float" value="1.0" />
225-
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
226-
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
227-
</ifgreater>
213+
<!-- apply IOR ratio inversion method to avoid TIR artifact (as in Coat TIR section of spec) -->
214+
<divide name="specular_to_coat_ior_ratio" type="float">
215+
<input name="in1" type="float" interfacename="specular_ior" />
216+
<input name="in2" type="float" interfacename="coat_ior" />
217+
</divide>
218+
<divide name="coat_to_specular_ior_ratio" type="float">
219+
<input name="in1" type="float" interfacename="coat_ior" />
220+
<input name="in2" type="float" interfacename="specular_ior" />
221+
</divide>
222+
<ifgreater name="specular_to_coat_ior_ratio_tir_fix" type="float">
223+
<input name="value1" type="float" nodename="specular_to_coat_ior_ratio" />
224+
<input name="value2" type="float" value="1.0" />
225+
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
226+
<input name="in2" type="float" nodename="coat_to_specular_ior_ratio" />
227+
</ifgreater>
228228
<mix name="eta_s" type="float">
229229
<input name="fg" type="float" nodename="specular_to_coat_ior_ratio_tir_fix" />
230230
<input name="bg" type="float" interfacename="specular_ior" />
@@ -326,7 +326,7 @@
326326
<layer name="dielectric_base_tf" type="BSDF">
327327
<input name="top" type="BSDF" nodename="dielectric_reflection_tf" />
328328
<input name="base" type="BSDF" nodename="dielectric_substrate" />
329-
</layer >
329+
</layer>
330330
<layer name="dielectric_base_notf" type="BSDF">
331331
<input name="top" type="BSDF" nodename="dielectric_reflection" />
332332
<input name="base" type="BSDF" nodename="dielectric_substrate" />
@@ -543,8 +543,7 @@
543543
<!--
544544
OpenPBR Anisotropy node definition
545545
-->
546-
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr"
547-
doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
546+
<nodedef name="ND_open_pbr_anisotropy" node="open_pbr_anisotropy" nodegroup="pbr" doc="Computes anisotropic surface roughness as defined in the OpenPBR specification.">
548547
<input name="roughness" type="float" value="0.0" />
549548
<input name="anisotropy" type="float" value="0.0" />
550549
<output name="out" type="vector2" />

libraries/bxdf/gltf_pbr.mtlx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
<input name="in" type="vector3" nodename="rotate_tangent" />
353353
</normalize>
354354
<absval name="abs_anisotropy_rotation" type="float">
355-
<input name="in" type="float" interfacename="anisotropy_rotation"/>
355+
<input name="in" type="float" interfacename="anisotropy_rotation" />
356356
</absval>
357357
<ifgreater name="selected_tangent" type="vector3">
358358
<input name="value1" type="float" nodename="abs_anisotropy_rotation" />

libraries/bxdf/lama/lama_conductor.mtlx

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
11
<?xml version="1.0"?>
22
<materialx version="1.39" colorspace="acescg">
33
<nodedef name="ND_lama_conductor" node="LamaConductor" nodegroup="pbr" doc="Lama conductor" version="1.0" isdefaultversion="true">
4-
<input name="tint" type="color3" value="1, 1, 1" uiname="Tint" uifolder="Main"
5-
doc="Overall color multiplier. It should be used with parsimony, as a non-white value breaks physicality. The preferred way to define the color of a conductor is through the Fresnel attributes right below." />
6-
<input name="fresnelMode" type="integer" uniform="true" enum="Artistic,Scientific" enumvalues="0,1" value="0" uiname="Fresnel Mode" uifolder="Main"
7-
doc="Switches the Fresnel between Artistic and Scientific parameters. The Artistic mode offers reflectivity in the normal direction and reflectivity90 at the grazing angle. The Scientific mode provides an index of refraction for each rgb component. Note that IOR is only used to calculate the reflectivity value used by the Schlick approximation. When reflectivity90 is 1, then both modes achieve identical results, as one can be mapped to the other." />
8-
<input name="IOR" type="vector3" value="0.180000007153,0.419999986887,1.37000000477" uiname="IOR" uifolder="Main"
9-
doc="Index of refraction (often denoted by eta), defining the color reflected by the surface in the normal direction." />
10-
<input name="extinction" type="vector3" value="3.42000007629,2.34999990463,1.76999998093" uiname="Extinction" uifolder="Main"
11-
doc="Extinction coefficient (often denoted by kappa), influencing how the reflected color curve evolves between its value in the normal direction (or 0 degree), and 1 when reaching 90 degrees. A null value does not deviate the curve at all." />
12-
<input name="reflectivity" type="color3" value="0.9450, 0.7772, 0.3737" uiname="Reflectivity" uifolder="Main"
13-
doc="Color reflected by the surface in the normal direction." />
14-
<input name="edgeColor" type="color3" value="0.7137, 0.7373, 0.4550" uiname="Edge Color" uifolder="Main"
15-
doc="Indicates how the reflected color curve evolves between its value in the normal direction (or 0 degree), and 1 when reaching 90 degrees. Note that this color is unlikely to be reached, and just bends the curve towards it when reaching grazing angles. A null value does not deviate the curve at all." />
16-
<input name="roughness" type="float" value="0.1" uimin="0.0" uimax="1.0" uiname="Roughness" uifolder="Main"
17-
doc="Micro-facet distribution roughness." />
18-
<input name="normal" type="vector3" defaultgeomprop="Nworld" uiname="Normal" uifolder="Main"
19-
doc="Shading normal, typically defined by bump or normal mapping. Defaults to the smooth surface normal if not set." />
20-
<input name="anisotropy" type="float" value="0.0" uimin="-1.0" uimax="1.0" uiname="Anisotropy" uifolder="Anisotropy"
21-
doc="Defines the amount of anisotropy, changing the co-tangent axis roughness from the original value to 1 (or to 0 with a negative value)." />
22-
<input name="anisotropyDirection" type="vector3" defaultgeomprop="Tworld" uiname="Direction" uifolder="Anisotropy"
23-
doc="Overrides the surface tangent as the anisotropy direction." />
24-
<input name="anisotropyRotation" type="float" value="0.0" uisoftmin="0.0" uisoftmax="1.0" uiname="Rotation" uifolder="Anisotropy"
25-
doc="Rotates the anisotropy direction (possibly overridden by the previous attribute) around the normal, from 0 to 360 degrees." />
4+
<input name="tint" type="color3" value="1, 1, 1" uiname="Tint" uifolder="Main" doc="Overall color multiplier. It should be used with parsimony, as a non-white value breaks physicality. The preferred way to define the color of a conductor is through the Fresnel attributes right below." />
5+
<input name="fresnelMode" type="integer" uniform="true" enum="Artistic,Scientific" enumvalues="0,1" value="0" uiname="Fresnel Mode" uifolder="Main" doc="Switches the Fresnel between Artistic and Scientific parameters. The Artistic mode offers reflectivity in the normal direction and reflectivity90 at the grazing angle. The Scientific mode provides an index of refraction for each rgb component. Note that IOR is only used to calculate the reflectivity value used by the Schlick approximation. When reflectivity90 is 1, then both modes achieve identical results, as one can be mapped to the other." />
6+
<input name="IOR" type="vector3" value="0.180000007153,0.419999986887,1.37000000477" uiname="IOR" uifolder="Main" doc="Index of refraction (often denoted by eta), defining the color reflected by the surface in the normal direction." />
7+
<input name="extinction" type="vector3" value="3.42000007629,2.34999990463,1.76999998093" uiname="Extinction" uifolder="Main" doc="Extinction coefficient (often denoted by kappa), influencing how the reflected color curve evolves between its value in the normal direction (or 0 degree), and 1 when reaching 90 degrees. A null value does not deviate the curve at all." />
8+
<input name="reflectivity" type="color3" value="0.9450, 0.7772, 0.3737" uiname="Reflectivity" uifolder="Main" doc="Color reflected by the surface in the normal direction." />
9+
<input name="edgeColor" type="color3" value="0.7137, 0.7373, 0.4550" uiname="Edge Color" uifolder="Main" doc="Indicates how the reflected color curve evolves between its value in the normal direction (or 0 degree), and 1 when reaching 90 degrees. Note that this color is unlikely to be reached, and just bends the curve towards it when reaching grazing angles. A null value does not deviate the curve at all." />
10+
<input name="roughness" type="float" value="0.1" uimin="0.0" uimax="1.0" uiname="Roughness" uifolder="Main" doc="Micro-facet distribution roughness." />
11+
<input name="normal" type="vector3" defaultgeomprop="Nworld" uiname="Normal" uifolder="Main" doc="Shading normal, typically defined by bump or normal mapping. Defaults to the smooth surface normal if not set." />
12+
<input name="anisotropy" type="float" value="0.0" uimin="-1.0" uimax="1.0" uiname="Anisotropy" uifolder="Anisotropy" doc="Defines the amount of anisotropy, changing the co-tangent axis roughness from the original value to 1 (or to 0 with a negative value)." />
13+
<input name="anisotropyDirection" type="vector3" defaultgeomprop="Tworld" uiname="Direction" uifolder="Anisotropy" doc="Overrides the surface tangent as the anisotropy direction." />
14+
<input name="anisotropyRotation" type="float" value="0.0" uisoftmin="0.0" uisoftmax="1.0" uiname="Rotation" uifolder="Anisotropy" doc="Rotates the anisotropy direction (possibly overridden by the previous attribute) around the normal, from 0 to 360 degrees." />
2615
<output name="out" type="BSDF" />
2716
</nodedef>
2817

0 commit comments

Comments
 (0)