From 2f169d152f295114efe982ab06a74bfd930bb540 Mon Sep 17 00:00:00 2001
From: ld-kerley <154285602+ld-kerley@users.noreply.github.com>
Date: Fri, 26 Jan 2024 15:19:06 -0800
Subject: [PATCH 1/2] Add invert node to specification (#1676)
The node exists in the standard library code, but is missing from the specification.
---
documents/Specification/MaterialX.Specification.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/documents/Specification/MaterialX.Specification.md b/documents/Specification/MaterialX.Specification.md
index 895b4756c5..42b6cbbcaf 100644
--- a/documents/Specification/MaterialX.Specification.md
+++ b/documents/Specification/MaterialX.Specification.md
@@ -1084,6 +1084,12 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m
* `in1` (float or colorN or vectorN): 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
+
+
+* **`invert`**: subtract the incoming float/color/vector from "amount" in all channels, outputting: `amount - in`.
+ * `in` (float or colorN or vectorN): 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
+
* **`absval`**: the per-channel absolute value of the incoming float/color/vector.
From d1e08f3e9141fd1d40b018c5230175967c930dcc Mon Sep 17 00:00:00 2001
From: Jonathan Stone
Date: Sat, 27 Jan 2024 16:42:31 -0800
Subject: [PATCH 2/2] Improvements to facingratio
- Fix syntax of input default values.
- Use the invert node in facingratio for compactness.
- Clarify the edge brighten example material.
---
libraries/nprlib/nprlib_defs.mtlx | 4 ++--
libraries/nprlib/nprlib_ng.mtlx | 7 +++----
.../Materials/TestSuite/nprlib/edge_brighten.mtlx | 15 +++++++--------
3 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/libraries/nprlib/nprlib_defs.mtlx b/libraries/nprlib/nprlib_defs.mtlx
index a8d282d0c4..dfbaa5b5f6 100644
--- a/libraries/nprlib/nprlib_defs.mtlx
+++ b/libraries/nprlib/nprlib_defs.mtlx
@@ -34,8 +34,8 @@
-
-
+
+
diff --git a/libraries/nprlib/nprlib_ng.mtlx b/libraries/nprlib/nprlib_ng.mtlx
index c287c2ef79..0bd7e334e5 100644
--- a/libraries/nprlib/nprlib_ng.mtlx
+++ b/libraries/nprlib/nprlib_ng.mtlx
@@ -32,10 +32,9 @@
-
-
-
-
+
+
+
diff --git a/resources/Materials/TestSuite/nprlib/edge_brighten.mtlx b/resources/Materials/TestSuite/nprlib/edge_brighten.mtlx
index dc06b76d98..8ce3affd40 100644
--- a/resources/Materials/TestSuite/nprlib/edge_brighten.mtlx
+++ b/resources/Materials/TestSuite/nprlib/edge_brighten.mtlx
@@ -1,17 +1,16 @@
-
-
-
-
+
+
+
-
-
+
+
-
-
+
+