Skip to content

Commit

Permalink
Minor optimizations to tiledsquares
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm committed Aug 4, 2023
1 parent 3f2f727 commit e101bae
Showing 1 changed file with 35 additions and 45 deletions.
80 changes: 35 additions & 45 deletions libraries/stdlib/stdlib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -2024,45 +2024,54 @@
<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_scale" />
</separate2>
<ifgreater name="Y_detect" type="float">
<input name="value1" type="float" nodename="abs_Y" />
<input name="value2" type="float" interfacename="size" />
<input name="in1" type="float" value="0" />
<input name="in2" type="float" value="1" />
<modulo name="mod_Y_row" type="float">
<input name="in1" type="float" nodename="texcoord_bias" channels="y" />
<input name="in2" type="float" value="2" />
</modulo>
<ifgreater name="alt_rows_shift" type="float">
<input name="value1" type="float" nodename="mod_Y_row" />
<input name="value2" type="float" value="1" />
<input name="in1" type="float" value="0.5" />
</ifgreater>
<add name="shift_X" type="float">
<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="texcoord_bias" channels="x" />
</ifequal>
<modulo name="mod_X" type="float">
<input name="in1" type="float" nodename="stagger_selection" />
</modulo>
<modulo name="mod_Y" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outy" />
<input name="in1" type="float" nodename="texcoord_bias" channels="y" />
</modulo>
<multiply name="modx_2" type="float">
<combine2 name="texcoord_mod" type="vector2">
<input name="in1" type="float" nodename="mod_X" />
<input name="in2" type="float" nodename="mod_Y" />
</combine2>
<multiply name="tecoord_mod_2" type="vector2">
<input name="in1" type="vector2" nodename="texcoord_mod" />
<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_Y" />
<input name="in2" type="float" value="2" />
</multiply>
<subtract name="subY_1" type="float">
<input name="in1" type="float" nodename="mody_2" />
<subtract name="tecoord_sub_1" type="vector2">
<input name="in1" type="vector2" nodename="tecoord_mod_2" />
<input name="in2" type="float" value="1" />
</subtract>
<absval name="abs_X" type="float">
<input name="in" type="float" nodename="subX_1" />
</absval>
<absval name="abs_Y" type="float">
<input name="in" type="float" nodename="subY_1" />
<absval name="tecoord_abs" type="vector2">
<input name="in" type="vector2" nodename="tecoord_sub_1" />
</absval>
<ifgreater name="X_detect" type="float">
<input name="value1" type="float" nodename="abs_X" />
<input name="value1" type="float" nodename="tecoord_abs" channels="x" />
<input name="value2" type="float" interfacename="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="tecoord_abs" channels="y" />
<input name="value2" type="float" interfacename="size" />
<input name="in1" type="float" value="0" />
<input name="in2" type="float" value="1" />
Expand All @@ -2071,25 +2080,6 @@
<input name="in1" type="float" nodename="X_detect" />
<input name="in2" type="float" nodename="Y_detect" />
</min>
<modulo name="mod_Y_row" type="float">
<input name="in1" type="float" nodename="separate_coord" output="outy" />
<input name="in2" type="float" value="2" />
</modulo>
<ifgreater name="alt_rows_shift" type="float">
<input name="value1" type="float" nodename="mod_Y_row" />
<input name="value2" type="float" value="1" />
<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="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="separate_coord" output="outx" />
</ifequal>
<convert name="to_rgb" type="color3">
<input name="in" type="float" nodename="min" />
</convert>
Expand Down

0 comments on commit e101bae

Please sign in to comment.