Skip to content

Commit

Permalink
Minor optimizations to tiledcircles
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm committed Aug 4, 2023
1 parent c782e03 commit 44397ed
Showing 1 changed file with 56 additions and 62 deletions.
118 changes: 56 additions & 62 deletions libraries/stdlib/stdlib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -1697,18 +1697,11 @@
<input name="in1" type="vector2" nodename="texcoord_scale" />
<input name="in2" type="vector2" interfacename="uvoffset" />
</subtract>
<separate2 name="separate_coord" type="multioutput">
<input name="in" type="vector2" nodename="texcoord_bias" />
</separate2>
<modulo name="mod_X_1" type="float">
<input name="in1" type="float" nodename="shift_X" />
</modulo>
<modulo name="mod_Y_1" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outy" />
<input name="in2" type="float" value="0.866025" />
<modulo name="mod_texcoord" type="vector2">
<input name="in1" type="vector2" nodename="texcoord_bias" />
</modulo>
<modulo name="stagg_Y" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outy" />
<input name="in1" type="float" nodename="texcoord_bias" channels="y" />
<input name="in2" type="float" value="1.73205" />
</modulo>
<ifgreater name="delta_X" type="float">
Expand All @@ -1717,15 +1710,32 @@
<input name="in1" type="float" value="0.5" />
</ifgreater>
<add name="shift_X" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outx" />
<input name="in1" type="float" nodename="texcoord_bias" channels="x" />
<input name="in2" type="float" nodename="delta_X" />
</add>
<ifequal name="pattern_selection" type="float">
<input name="value1" type="boolean" interfacename="staggered" />
<input name="value2" type="boolean" value="true" />
<input name="in1" type="float" nodename="max" />
<input name="in2" type="float" nodename="circle_regular" />
</ifequal>
<modulo name="mod_X_1" type="float">
<input name="in1" type="float" nodename="shift_X" />
</modulo>
<modulo name="mod_Y_1" type="float">
<input name="in1" type="float" nodename="texcoord_bias" channels="y" />
<input name="in2" type="float" value="0.866025" />
</modulo>
<multiply name="modx_2" type="float">
<input name="in1" type="float" nodename="mod_texcoord" channels="x" />
<input name="in2" type="float" value="2" />
</multiply>
<subtract name="subX_1" type="float">
<input name="in1" type="float" nodename="modx_2" />
<input name="in2" type="float" value="1" />
</subtract>
<multiply name="mody_2" type="float">
<input name="in1" type="float" nodename="mod_texcoord" channels="y" />
<input name="in2" type="float" value="2" />
</multiply>
<subtract name="subY_1" type="float">
<input name="in1" type="float" nodename="mody_2" />
<input name="in2" type="float" value="1" />
</subtract>
<subtract name="coord_adj_1" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" nodename="mod_X_1" />
Expand All @@ -1738,40 +1748,22 @@
<input name="in1" type="float" value="0.866025" />
<input name="in2" type="float" nodename="mod_Y_1" />
</subtract>
<max name="max1" type="float">
<input name="in1" type="float" nodename="circle_stagg1" />
<input name="in2" type="float" nodename="circle_stagg2" />
</max>
<max name="max" type="float">
<input name="in1" type="float" nodename="max1" />
<input name="in2" type="float" nodename="circle_stagg3" />
</max>
<combine2 name="coord_circ1" type="vector2">
<input name="in1" type="float" nodename="mod_X_1" />
<input name="in2" type="float" nodename="mod_Y_1" />
</combine2>
<combine2 name="coord_circ2" type="vector2">
<input name="in1" type="float" nodename="coord_adj_1" />
<input name="in2" type="float" nodename="mod_Y_1" />
</combine2>
<combine2 name="coord_circ3" type="vector2">
<input name="in1" type="float" nodename="coord_adj_2" />
<input name="in2" type="float" nodename="coord_adj_3" />
</combine2>
<divide name="scale_half" type="float">
<input name="in1" type="float" interfacename="size" />
<input name="in2" type="float" value="2" />
</divide>
<multiply name="modx_2" type="float">
<input name="in1" type="float" nodename="mod_X" />
<input name="in2" type="float" value="2" />
</multiply>
<modulo name="mod_X" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outx" />
</modulo>
<modulo name="mod_Y" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outy" />
</modulo>
<subtract name="subX_1" type="float">
<input name="in1" type="float" nodename="modx_2" />
<input name="in2" type="float" value="1" />
</subtract>
<multiply name="mody_2" type="float">
<input name="in1" type="float" nodename="mod_Y" />
<input name="in2" type="float" value="2" />
</multiply>
<subtract name="subY_1" type="float">
<input name="in1" type="float" nodename="mody_2" />
<input name="in2" type="float" value="1" />
</subtract>
<circle name="circle_stagg1" type="float">
<input name="sample" type="vector2" nodename="coord_circ1" />
<input name="radius" type="float" nodename="scale_half" />
Expand All @@ -1784,26 +1776,28 @@
<input name="sample" type="vector2" nodename="coord_circ3" />
<input name="radius" type="float" nodename="scale_half" />
</circle>
<combine2 name="coord_circ1" type="vector2">
<input name="in1" type="float" nodename="mod_X_1" />
<input name="in2" type="float" nodename="mod_Y_1" />
</combine2>
<combine2 name="coord_circ2" type="vector2">
<input name="in1" type="float" nodename="coord_adj_1" />
<input name="in2" type="float" nodename="mod_Y_1" />
</combine2>
<combine2 name="coord_circ3" type="vector2">
<input name="in1" type="float" nodename="coord_adj_2" />
<input name="in2" type="float" nodename="coord_adj_3" />
<max name="max1" type="float">
<input name="in1" type="float" nodename="circle_stagg1" />
<input name="in2" type="float" nodename="circle_stagg2" />
</max>
<max name="max" type="float">
<input name="in1" type="float" nodename="max1" />
<input name="in2" type="float" nodename="circle_stagg3" />
</max>
<combine2 name="recenter" type="vector2">
<input name="in1" type="float" nodename="subX_1" />
<input name="in2" type="float" nodename="subY_1" />
</combine2>
<circle name="circle_regular" type="float">
<input name="sample" type="vector2" nodename="recenter" />
<input name="radius" type="float" interfacename="size" />
</circle>
<combine2 name="recenter" type="vector2">
<input name="in1" type="float" nodename="subX_1" />
<input name="in2" type="float" nodename="subY_1" />
</combine2>
<ifequal name="pattern_selection" type="float">
<input name="value1" type="boolean" interfacename="staggered" />
<input name="value2" type="boolean" value="true" />
<input name="in1" type="float" nodename="max" />
<input name="in2" type="float" nodename="circle_regular" />
</ifequal>
<convert name="to_rgb" type="color3">
<input name="in" type="float" nodename="pattern_selection" />
</convert>
Expand Down

0 comments on commit 44397ed

Please sign in to comment.