diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index fa3243571a..c7a16580e7 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -228,7 +228,8 @@ jobs:
run: |
python MaterialXTest/main.py
python MaterialXTest/genshader.py
- python Scripts/comparenodedefs.py
+ python Scripts/comparenodedefs.py --spec ../documents/Specification/MaterialX.StandardNodes.md --mtlx ../libraries/stdlib/stdlib_defs.mtlx
+ python Scripts/comparenodedefs.py --spec ../documents/Specification/MaterialX.PBRSpec.md --mtlx ../libraries/pbrlib/pbrlib_defs.mtlx
python Scripts/creatematerial.py ../resources/Materials/Examples/StandardSurface/chess_set --texturePrefix chessboard --shadingModel standard_surface
python Scripts/creatematerial.py ../resources/Materials/Examples/GltfPbr/boombox --shadingModel gltf_pbr
python Scripts/mxformat.py ../resources/Materials/TestSuite/stdlib/upgrade --yes --upgrade
diff --git a/documents/Specification/MaterialX.PBRSpec.md b/documents/Specification/MaterialX.PBRSpec.md
index 612f5d1986..6f19a102e0 100644
--- a/documents/Specification/MaterialX.PBRSpec.md
+++ b/documents/Specification/MaterialX.PBRSpec.md
@@ -398,11 +398,11 @@ Adds a directionally varying factor to an EDF. Scales the emission distribution
### `absorption_vdf`
Constructs a VDF for pure light absorption.
-The `absorption` input represents the absorption rate per distance traveled in the medium, stated in _m−1_, with independent control for each color channel.
+The `absorption` input represents the absorption rate per distance traveled in the medium, stated in _m−1_, with independent control for each wavelength.
|Port |Description |Type |Default |
|------------|------------------------------|-------|-------------|
-|`absorption`|Absorption rate for the medium|color3 |0.0, 0.0, 0.0|
+|`absorption`|Absorption rate for the medium|vector3|0.0, 0.0, 0.0|
|`out` |Output: the computed VDF |VDF | |
@@ -410,16 +410,16 @@ The `absorption` input represents the absorption rate per distance traveled in t
### `anisotropic_vdf`
Constructs a VDF scattering light for a participating medium, based on the Henyey-Greenstein phase function[^Pharr2023]. Forward, backward and uniform scattering is supported and controlled by the anisotropy input.
-The `absorption` input represents the absorption rate per distance traveled in the medium, stated in _m−1_, with independent control for each color channel.
+The `absorption` input represents the absorption rate per distance traveled in the medium, stated in _m−1_, with independent control for each wavelength.
-The `anisotropy` input controls the scattering direction: negative values produce backwards scattering, positive values produce forward scattering, and 0.0 produces uniform scattering. Both absorption and scattering rates are specified per color channel/wavelength.
+The `anisotropy` input controls the scattering direction: negative values produce backwards scattering, positive values produce forward scattering, and 0.0 produces uniform scattering. Both absorption and scattering rates are specified per wavelength.
-|Port |Description |Type |Default |Accepted Values|
-|------------|------------------------------------------|------|-------------|---------------|
-|`absorption`|Absorption rate for the medium |color3|0.0, 0.0, 0.0| |
-|`scattering`|Scattering rate for the medium |color3|0.0, 0.0, 0.0| |
-|`anisotropy`|Anisotropy factor for scattering direction|float |0.0 |[-1, 1] |
-|`out` |Output: the computed VDF |VDF | | |
+|Port |Description |Type |Default |Accepted Values|
+|------------|------------------------------------------|-------|-------------|---------------|
+|`absorption`|Absorption rate for the medium |vector3|0.0, 0.0, 0.0| |
+|`scattering`|Scattering rate for the medium |vector3|0.0, 0.0, 0.0| |
+|`anisotropy`|Anisotropy factor for scattering direction|float |0.0 |[-1, 1] |
+|`out` |Output: the computed VDF |VDF | | |
## PBR Shader Nodes
@@ -457,17 +457,16 @@ If the `edf` input is left unconnected, no emission will occur from the medium.
### `light`
Constructs a light shader describing an explicit light source. The light shader will emit light according to the connected EDF. If the shader is attached to geometry both sides will be considered for light emission and the EDF controls if light is emitted from both sides or not.
-|Port |Description |Type |Default |
-|-----------|---------------------------------------------------|------------|-------------|
-|`edf` |Emission distribution function for the light source|EDF |__zero__ |
-|`intensity`|Intensity multiplier for the EDF's emittance |color3 |1.0, 1.0, 1.0|
-|`exposure` |Exposure control for the EDF's emittance |float |0.0 |
-|`out` |Output: the computed light shader |lightshader | |
+|Port |Description |Type |Default |
+|-----------|---------------------------------------------------|------------|--------|
+|`edf` |Emission distribution function for the light source|EDF |__zero__|
+|`intensity`|Intensity multiplier for the EDF's emittance |float |1.0 |
+|`exposure` |Exposure control for the EDF's emittance |float |0.0 |
+|`out` |Output: the computed light shader |lightshader | |
Note that the standard library includes definitions for [**`displacement`**](./MaterialX.Specification.md#node-displacement) and [**`surface_unlit`**](./MaterialX.Specification.md#node-surfaceunlit) shader nodes.
-
## Utility Nodes
@@ -595,7 +594,7 @@ Converts the hair melanin parameterization to absorption coefficient based on pi
|`melanin_redness` |Amount of redness affected to the output |float |0.5 |[0, 1] |
|`eumelanin_color` |Eumelanin color |color3 |0.657704, 0.498077, 0.254107| |
|`pheomelanin_color` |Pheomelanin color |color3 |0.829444, 0.67032, 0.349938 | |
-|`out` |Output: the computed absorption coefficient |vector3| | |
+|`absorption` |Output: the computed absorption coefficient |vector3| | |
@@ -606,7 +605,7 @@ Converts the hair scattering color to absorption coefficient using the mapping m
|---------------------|------------------------------------------------|-------|-------------|---------------|
|`color` |Scattering color |color3 |1.0, 1.0, 1.0| |
|`azimuthal_roughness`|Azimuthal roughness |float |0.2 |[0, 1] |
-|`out` |Output: the computed absorption coefficient |vector3| | |
+|`absorption` |Output: the computed absorption coefficient |vector3| | |
diff --git a/documents/Specification/MaterialX.StandardNodes.md b/documents/Specification/MaterialX.StandardNodes.md
index 3faf9fcd59..e515b294a1 100644
--- a/documents/Specification/MaterialX.StandardNodes.md
+++ b/documents/Specification/MaterialX.StandardNodes.md
@@ -2327,17 +2327,13 @@ An unlit surface shader node, representing a surface that can emit and transmit
### `displacement`
Constructs a displacement shader describing geometric modification to surfaces.
-|Port |Description |Type |Default|
-|--------------|------------------------------------------------------------|------------------|-------|
-|`displacement`|Scalar along the surface normal direction for each position.|float |0.0 |
-|`scale` |Scale factor for the displacement vector. |float |1.0 |
-|`out` |Output: displacement shader closure |displacementshader| |
-
-|Port |Description |Type |Default |
-|--------------|------------------------------------------------------------------------------|------------------|-------------|
-|`displacement`|Vector displacement in (dPdu, dPdv, N) tangent/normal space for each position.|vector3 |0.0, 0.0, 0.0|
-|`scale` |Scale factor for the displacement vector. |float |1.0 |
-|`out` |Output: displacement shader closure |displacementshader| |
+The scalar signature displaces along the surface normal direction, while the vector signature allows displacement in tangent/normal space using (dPdu, dPdv, N) coordinates.
+
+|Port |Description |Type |Default |
+|--------------|----------------------------------------|------------------|--------|
+|`displacement`|Displacement amount or direction |float, vector3 |__zero__|
+|`scale` |Scale factor for the displacement |float |1.0 |
+|`out` |Output: the computed displacement shader|displacementshader| |
diff --git a/python/Scripts/comparenodedefs.py b/python/Scripts/comparenodedefs.py
index 97724918b7..edd0316e21 100644
--- a/python/Scripts/comparenodedefs.py
+++ b/python/Scripts/comparenodedefs.py
@@ -62,7 +62,12 @@ def buildTypeGroupVariables(typeGroups):
def parseSpecTypes(typeStr):
'''
Parse a specification type string into (types, typeRef).
- Handles "Same as X" and "Same as X or Y" patterns.
+
+ Supported patterns:
+ - Simple types: "float", "color3"
+ - Comma-separated: "float, color3"
+ - Union with "or": "BSDF or VDF", "BSDF, EDF, or VDF"
+ - Type references: "Same as bg", "Same as in1 or float"
'''
if typeStr is None or not typeStr.strip():
return set(), None
@@ -79,12 +84,14 @@ def parseSpecTypes(typeStr):
extraSet, _ = parseSpecTypes(extraTypes)
return extraSet, refPort
+ # Normalize "or" to comma: "X or Y" -> "X, Y", "X, Y, or Z" -> "X, Y, Z"
+ normalized = re.sub(r',?\s+or\s+', ', ', typeStr)
+
result = set()
- for t in typeStr.split(','):
+ for t in normalized.split(','):
t = t.strip()
- if not t:
- continue
- result.add(t)
+ if t:
+ result.add(t)
return result, None