Skip to content

Commit

Permalink
Fix enums on glTF definition inputs (#1073)
Browse files Browse the repository at this point in the history
Need to add 'enum' as part of the definition inputs as appropriate otherwise the values will not map properly for shader generation for languages which require remapping such as GLSL.

In particular u, v address and filter handling is fixed by this.
  • Loading branch information
kwokcb authored Sep 13, 2022
1 parent f17f8d3 commit c6a96c5
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions libraries/bxdf/gltf_pbr.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@
<input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" uifolder="Image" />
<input name="offset" type="vector2" value="0, 0" uifolder="Image" />
<input name="operationorder" type="integer" value="1" uifolder="Image" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" uifolder="Image"/>
<input name="vaddressmode" type="string" uniform="true" value="periodic" uifolder="Image"/>
<input name="filtertype" type="string" uniform="true" value="linear" uifolder="Image" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" uifolder="Image"/>
<input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" uifolder="Image"/>
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" uifolder="Image" />
<input name="color" type="color4" value="1, 1, 1, 1" uifolder="Color" />
<input name="geomcolor" type="color4" value="1, 1, 1, 1" uifolder="Color" uiname="Geometry Color" />
<output name="outcolor" type="color3" value="0, 0, 0" />
Expand Down Expand Up @@ -356,9 +356,9 @@
<input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" />
<input name="offset" type="vector2" value="0, 0" />
<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" value="linear" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" />
<output name="out" type="color3" value="0, 0, 0" />
</nodedef>
<nodegraph name="NG_NG_gltf_image_color3_color3_1_0" nodedef="ND_gltf_image_color3_color3_1_0">
Expand Down Expand Up @@ -426,9 +426,9 @@
<input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" />
<input name="offset" type="vector2" value="0, 0" />
<input name="operationorder" type="integer" value="1" />
<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" value="linear" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" />
<output name="out" type="color4" value="0, 0, 0, 0" />
</nodedef>
<nodegraph name="NG_gltf_image_color4_color4_1_0" nodedef="ND_gltf_image_color4_color4_1_0">
Expand Down Expand Up @@ -496,9 +496,9 @@
<input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" />
<input name="offset" type="vector2" value="0, 0" />
<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" value="linear" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" />
<output name="out" type="float" value="0" />
</nodedef>
<nodegraph name="NG_gltf_image_float_float_1_0" nodedef="ND_gltf_image_float_float_1_0">
Expand Down Expand Up @@ -565,9 +565,9 @@
<input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" />
<input name="offset" type="vector2" value="0, 0" />
<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" value="linear" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" />
<output name="out" type="vector3" value="0, 0, 0" />
</nodedef>
<nodegraph name="NG_gltf_image_vector3_vector3_1_0" nodedef="ND_gltf_image_vector3_vector3_1_0">
Expand Down Expand Up @@ -629,9 +629,9 @@
<input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" />
<input name="offset" type="vector2" value="0, 0" />
<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" value="linear" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" />
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" />
<output name="out" type="vector3" value="0, 0, 0" />
</nodedef>
<nodegraph name="NG_gltf_normalmap_vector3_1_0" nodedef="ND_gltf_normalmap_vector3_1_0">
Expand Down Expand Up @@ -695,9 +695,9 @@
<input name="scale" type="vector2" value="1, 1" uifolder="Image" />
<input name="rotate" type="float" value="0" uifolder="Image" />
<input name="offset" type="vector2" value="0, 0" uifolder="Image" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" uifolder="Image" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" uifolder="Image" />
<input name="filtertype" type="string" uniform="true" value="linear" uifolder="Image" />
<input name="uaddressmode" type="string" uniform="true" value="periodic" uifolder="Image" enum="constant,clamp,periodic,mirror" />
<input name="vaddressmode" type="string" uniform="true" value="periodic" uifolder="Image" enum="constant,clamp,periodic,mirror" />
<input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" uifolder="Image" />
<input name="thicknessMin" type="float" value="100" uifolder="Thickness" />
<input name="thicknessMax" type="float" value="400" uifolder="Thickness" />
<output name="out" type="float" value="0" />
Expand Down

0 comments on commit c6a96c5

Please sign in to comment.