Skip to content

Commit

Permalink
Align grecian with tiledimage
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm committed Jul 25, 2023
1 parent c0707ad commit 390bbff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 43 deletions.
5 changes: 3 additions & 2 deletions libraries/stdlib/stdlib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -1144,9 +1144,10 @@
Pattern can be regular or staggered.
-->
<nodedef name="ND_grecian_color3" node="grecian" nodegroup="procedural2d">
<input name="texcoord" type="vector2" value="0, 0" />
<input name="texcoord" type="vector2" defaultgeomprop="UV0" />
<input name="uvtiling" type="vector2" value="1.0, 1.0" />
<input name="uvoffset" type="vector2" value="0.0, 0.0" />
<input name="thickness" type="float" value="0.05" />
<input name="spacing" type="float" value="1" />
<input name="staggered" type="boolean" value="false" />
<output name="out" type="color3" />
</nodedef>
Expand Down
54 changes: 20 additions & 34 deletions libraries/stdlib/stdlib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -1689,31 +1689,23 @@
Pattern can be regular or staggered.
-->
<nodegraph name="NG_grecian_color3" nodedef="ND_grecian_color3">
<multiply name="texcoord_scale" type="vector2">
<input name="in1" type="vector2" interfacename="texcoord" />
<input name="in2" type="vector2" interfacename="uvtiling" />
</multiply>
<subtract name="texcoord_bias" type="vector2">
<input name="in1" type="vector2" nodename="texcoord_scale" />
<input name="in2" type="vector2" interfacename="uvoffset" />
</subtract>
<subtract name="thick_to_size" type="float">
<input name="in1" type="float" interfacename="spacing" />
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="thickness" />
</subtract>
<divide name="scale" type="float">
<input name="in1" type="float" nodename="thick_to_size" />
<input name="in2" type="float" interfacename="spacing" />
</divide>
<divide name="inv_spacing" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" interfacename="spacing" />
</divide>
<combine2 name="invspc_vec" type="vector2">
<input name="in1" type="float" nodename="inv_spacing" />
<input name="in2" type="float" nodename="inv_spacing" />
</combine2>
<multiply name="coord_adj" type="vector2">
<input name="in1" type="vector2" interfacename="texcoord" />
<input name="in2" type="vector2" nodename="invspc_vec" />
</multiply>
<modulo name="mod_Y" type="float">
<input name="in1" type="float" nodename="coord_adj" channels="y" />
<input name="in1" type="float" nodename="texcoord_bias" channels="y" />
</modulo>
<modulo name="mod_Y_row" type="float">
<input name="in1" type="float" nodename="coord_adj" channels="y" />
<input name="in1" type="float" nodename="texcoord_bias" channels="y" />
<input name="in2" type="float" value="2" />
</modulo>
<multiply name="mody_2" type="float">
Expand All @@ -1726,14 +1718,14 @@
<input name="in1" type="float" value="0.5" />
</ifgreater>
<add name="shift_X" type="float">
<input name="in1" type="float" nodename="coord_adj" channels="x" />
<input name="in1" type="float" nodename="texcoord_bias" channels="x" />
<input name="in2" type="float" nodename="alt_rows_shift" />
</add>
<ifequal name="stagger_selection" type="float">
<input name="value1" type="boolean" interfacename="staggered" />
<input name="value2" type="boolean" value="true" />
<input name="in1" type="float" nodename="shift_X" />
<input name="in2" type="float" nodename="coord_adj" channels="x" />
<input name="in2" type="float" nodename="texcoord_bias" channels="x" />
</ifequal>
<modulo name="mod_X" type="float">
<input name="in1" type="float" nodename="stagger_selection" />
Expand All @@ -1758,13 +1750,13 @@
</absval>
<ifgreater name="X_detect" type="float">
<input name="value1" type="float" nodename="abs_X" />
<input name="value2" type="float" nodename="scale" />
<input name="value2" type="float" nodename="thick_to_size" />
<input name="in1" type="float" value="0" />
<input name="in2" type="float" value="1" />
</ifgreater>
<ifgreater name="Y_detect" type="float">
<input name="value1" type="float" nodename="abs_Y" />
<input name="value2" type="float" nodename="scale" />
<input name="value2" type="float" nodename="thick_to_size" />
<input name="in1" type="float" value="0" />
<input name="in2" type="float" value="1" />
</ifgreater>
Expand Down Expand Up @@ -1792,19 +1784,15 @@
<constant name="diag2_point2" type="vector2">
<input name="value" type="vector2" value="1, -1" />
</constant>
<divide name="diag_thickness" type="float">
<input name="in1" type="float" interfacename="thickness" />
<input name="in2" type="float" interfacename="spacing" />
</divide>
<line name="line_diag1" type="float">
<input name="sample" type="vector2" nodename="sample_vec" />
<input name="radius" type="float" nodename="diag_thickness" />
<input name="radius" type="float" interfacename="thickness" />
<input name="point1" type="vector2" nodename="diag1_point1" />
<input name="point2" type="vector2" nodename="diag1_point2" />
</line>
<line name="line_diag2" type="float">
<input name="sample" type="vector2" nodename="sample_vec" />
<input name="radius" type="float" nodename="diag_thickness" />
<input name="radius" type="float" interfacename="thickness" />
<input name="point1" type="vector2" nodename="diag2_point1" />
<input name="point2" type="vector2" nodename="diag2_point2" />
</line>
Expand All @@ -1816,11 +1804,9 @@
<input name="in1" type="float" nodename="inv_result" />
<input name="in2" type="float" nodename="composite_diags" />
</max>
<combine3 name="to_rgb" type="color3">
<input name="in1" type="float" nodename="max" />
<input name="in2" type="float" nodename="max" />
<input name="in3" type="float" nodename="max" />
</combine3>
<convert name="to_rgb" type="color3">
<input name="in" type="float" nodename="max" />
</convert>
<output name="out" type="color3" nodename="to_rgb" />
</nodegraph>

Expand Down
8 changes: 1 addition & 7 deletions resources/Materials/TestSuite/stdlib/procedural/grecian.mtlx
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<texcoord name="texcoord_vector2" type="vector2" />
<multiply name="multiply_vector2FA" type="vector2">
<input name="in1" type="vector2" nodename="texcoord_vector2" />
<input name="in2" type="float" value="29" />
</multiply>
<grecian name="grecian_color3" type="color3">
<input name="texcoord" type="vector2" nodename="multiply_vector2FA" />
<input name="uvtiling" type="vector2" value="29, 29" />
<input name="thickness" type="float" value="0.05" />
<input name="spacing" type="float" value="1.0" />
</grecian>
<standard_surface name="SR_test_grecian" type="surfaceshader">
<input name="base" type="float" value="1" />
Expand Down

0 comments on commit 390bbff

Please sign in to comment.