Skip to content

Commit

Permalink
Merge branch 'main' into bhata/npr_gooch
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Jan 28, 2024
2 parents 02c9f25 + d1e08f3 commit 79a4c93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 6 additions & 0 deletions documents/Specification/MaterialX.Specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,12 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m
* `in1` (float or color<em>N</em> or vector<em>N</em>): the value or nodename for the primary input
* `in2` (same type as `in1` or float): the modulo value or nodename to divide by, cannot be 0 in any channel; default is 1.0 in all channels, which effectively returns the fractional part of a float value

<a id="node-invert"> </a>

* **`invert`**: subtract the incoming float/color/vector from "amount" in all channels, outputting: `amount - in`.
* `in` (float or color<em>N</em> or vector<em>N</em>): the value or nodename for the primary input
* `amount` (same type as `in` or float): the value or nodename to subtract from; default is 1.0 in all channels

<a id="node-absval"> </a>

* **`absval`**: the per-channel absolute value of the incoming float/color/vector.
Expand Down
4 changes: 2 additions & 2 deletions libraries/nprlib/nprlib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<nodedef name="ND_facingratio_float" node="facingratio" nodegroup="npr">
<input name="viewdirection" type="vector3" defaultgeomprop="Vworld" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<input name="faceforward" type="boolean" default="true" />
<input name="invert" type="boolean" default="false" />
<input name="faceforward" type="boolean" value="true" />
<input name="invert" type="boolean" value="false" />
<output name="out" type="float" default="0.0" />
</nodedef>

Expand Down
7 changes: 3 additions & 4 deletions libraries/nprlib/nprlib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
<input name="in1" type="float" nodename="N_absval" />
<input name="in2" type="float" nodename="N_scale" />
</ifequal>
<subtract name="N_invert" type="float">
<input name="in1" type="float" value="1" />
<input name="in2" type="float" nodename="N_facing" />
</subtract>
<invert name="N_invert" type="float">
<input name="in" type="float" nodename="N_facing" />
</invert>
<ifequal name="N_result" type="float">
<input name="value1" type="boolean" interfacename="invert" />
<input name="value2" type="boolean" value="true" />
Expand Down
15 changes: 7 additions & 8 deletions resources/Materials/TestSuite/nprlib/edge_brighten.mtlx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
<nodegraph name="edge_brighten">
<facingratio name="facingratio_float" type="float" />
<clamp name="clamp_float" type="float">
<input name="in" type="float" nodename="facingratio_float" />
</clamp>
<facingratio name="facingratio_float" type="float">
<input name="invert" type="boolean" value="true" />
</facingratio>
<power name="power_float" type="float">
<input name="in1" type="float" nodename="clamp_float" />
<input name="in2" type="float" value="0.2" />
<input name="in1" type="float" nodename="facingratio_float" />
<input name="in2" type="float" value="3.0" />
</power>
<mix name="mix_color3" type="color3">
<input name="fg" type="color3" value="0, 0.0986187, 0.186275" />
<input name="bg" type="color3" value="0.735294, 0.735294, 0.735294" />
<input name="bg" type="color3" value="0, 0.0986187, 0.186275" />
<input name="fg" type="color3" value="0.735294, 0.735294, 0.735294" />
<input name="mix" type="float" nodename="power_float" />
</mix>
<output name="out" type="color3" nodename="mix_color3" />
Expand Down

0 comments on commit 79a4c93

Please sign in to comment.