Skip to content

Commit 9157384

Browse files
Merge branch 'main' into pbr_blackbody
2 parents 3be2fdb + 07311f5 commit 9157384

4 files changed

Lines changed: 71 additions & 53 deletions

File tree

documents/Specification/inprog_v1.39/MaterialX.PBRSpec.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ This document describes a number of shader-semantic nodes implementing widely-us
3737
[BSDF Nodes](#bsdf-nodes)
3838
[EDF Nodes](#edf-nodes)
3939
[VDF Nodes](#vdf-nodes)
40-
[Shader Nodes](#shader-nodes)
40+
[PBR Shader Nodes](#pbr-shader-nodes)
4141
[Utility Nodes](#utility-nodes)
4242

4343
**[Shading Model Examples](#shading-model-examples)**
@@ -303,7 +303,7 @@ The PBS nodes also make use of the following standard MaterialX types:
303303
* `anisotropy` (float): Anisotropy factor, controlling the scattering direction, range [-1.0, 1.0]. Negative values give backwards scattering, positive values give forward scattering, and a value of 0.0 (the default) gives uniform scattering.
304304

305305

306-
## Shader Nodes
306+
## PBR Shader Nodes
307307

308308
<a id="node-surface"> </a>
309309

@@ -334,6 +334,9 @@ The PBS nodes also make use of the following standard MaterialX types:
334334
* `intensity` (color3): Intensity multiplier for the light's emittance. Defaults to (1.0, 1.0, 1.0).
335335
* `exposure` (float): Exposure control for the light's emittance. Defaults to 0.0.
336336

337+
Note that the standard library includes definitions for [**`displacement`**](./MaterialX.Specification.md#node-displacement) and [**`surface_unlit`**](./MaterialX.Specification.md#node-surfaceunlit) shader nodes.
338+
339+
337340

338341
## Utility Nodes
339342

documents/Specification/inprog_v1.39/MaterialX.Specification.md

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ This document describes the core MaterialX specification. Companion documents [
6464
  [Conditional Nodes](#conditional-nodes)
6565
  [Channel Nodes](#channel-nodes)
6666
  [Convolution Nodes](#convolution-nodes)
67-
  [Shader Nodes](#shader-nodes)
6867

6968
[Standard Node Inputs](#standard-node-inputs)
7069
[Standard UI Attributes](#standard-ui-attributes)
@@ -90,7 +89,7 @@ This document describes the core MaterialX specification. Companion documents [
9089
   [Example Custom Node Defined by a Nodegraph](#example-custom-node-defined-by-a-nodegraph)
9190
  [Custom Node Use](#custom-node-use)
9291
[Shader Nodes](#shader-nodes)
93-
  [Standard Shader-Semantic Operator Nodes](#standard-shader-semantic-operator-nodes)
92+
  [Standard Library Shader Nodes](#standard-library-shader-nodes)
9493
  [AOV Output Elements](#aov-output-elements)
9594
   [AOVOutput Example](#aovoutput-example)
9695
[Material Nodes](#material-nodes)
@@ -620,13 +619,14 @@ Attributes for Output elements:
620619
* `nodename` (string, optional): the name of a node at the same scope within the document, whose result value will be output. This attribute is required for &lt;output> elements within a node graph, but is not allowed in &lt;output> elements within a &lt;nodedef>.
621620
* `output` (string, optional): if the node specified by `nodename` has multiple outputs, the name of the specific output to connect this &lt;output> to.
622621
* `uniform` (boolean, optional): If set to "true", then the output of this node is treated as a uniform value, and this output may be connected to a uniform input of the same (or compatible) type. It is up to the application creating the nodegraph to ensure that the value actually is uniform. Default is "false".
622+
623+
MaterialX also supports the following additional attributes for Output elements in applications which process node graphs in 2D space and save or cache outputs as images for efficiency, such as texture baking or image caching. These attributes do **not** affect values from this &lt;output> connected to other nodes, e.g. they would remain in the working colorspace and retain full resolution and bitdepth precision.
624+
623625
* `colorspace` (string, optional): the name of the color space for the output image. Applications that support color space management are expected to perform the required transformations of output colors into this space.
624626
* `width` (integer, optional): the expected width in pixels of the output image.
625627
* `height` (integer, optional): the expected height in pixels of the output image.
626628
* `bitdepth` (integer, optional): the expected per-channel bit depth of the output image, which may be used to capture expected color quantization effects. Common values for `bitdepth` are 8, 16, 32, and 64. It is up to the application to determine what the internal representation of any declared bit depth is (e.g. scaling factor, signed or unsigned, etc.).
627629

628-
The `colorspace`, `width`, `height` and `bitdepth` attributes are intended to be used in applications which process node graphs in 2D space and save or cache outputs as images for efficiency.
629-
630630

631631

632632
## Standard Source Nodes
@@ -747,6 +747,15 @@ Standard Procedural nodes:
747747
* `center` (float): a value representing the V-coordinate of the split; all pixels above "center" will be `valuet`, all pixels below "center" will be `valueb`. Default is 0.5.
748748
* `texcoord` (vector2): the name of a vector2-type node specifying the 2D texture coordinate at which the split position is evaluated. Default is to use the first set of texture coordinates.
749749

750+
<a id="node-checkerboard"> </a>
751+
752+
* **`checkerboard`**: a 2D checkerboard pattern.
753+
* `color1` (color3): The first color used in the checkerboard pattern.
754+
* `color2` (color3): The second color used in the checkerboard pattern.
755+
* `freq` (vector2): The frequency of checkers, with higher values producing smaller squares. Default is (8, 8).
756+
* `offset` (vector2): Shift the pattern in 2d space. Default is (0, 0).
757+
* `texcoord` (vector2): The input 2d space. Default is the first texture coordinates.
758+
750759
<a id="node-noise2d"> </a>
751760

752761
* **`noise2d`**: 2D Perlin noise in 1, 2, 3 or 4 channels.
@@ -889,6 +898,8 @@ Standard Geometric nodes:
889898
* `geomprop` (uniform string): the geometric property to be referenced.
890899
* `default` (same type as the geomprop's value): a value to return if the specified `geomprop` is not defined on the current geometry.
891900

901+
Additionally, the `geomcolor`, `geompropvalue` and `geompropvalueuniform` nodes for color3/color4-type properties can take a `colorspace` attribute to declare what colorspace the color property value is in; the default is "none" for no colorspace declaration (and hence no colorspace conversion).
902+
892903

893904
<a id="space-values"> </a>
894905

@@ -971,7 +982,7 @@ Operator nodes process one or more required input streams to form an output. Li
971982

972983
The inputs of compositing operators are called "fg" and "bg" (plus "alpha" for float and color3 variants, and "mix" for all variants of the `mix` operator), while the inputs of other operators are called "in" if there is exactly one input, or "in1", "in2" etc. if there are more than one input. If an implementation does not support a particular operator, it should pass through the "bg", "in" or "in1" input unchanged.
973984

974-
This section defines the Operator Nodes that all MaterialX implementations are expected to support. Standard Operator Nodes are grouped into the following classifications: [Math Nodes](#math-nodes), [Adjustment Nodes](#adjustment-nodes), [Compositing Nodes](#compositing-nodes), [Conditional Nodes](#conditional-nodes), [Channel Nodes](#channel-nodes), [Convolution Nodes](#convolution-nodes) and [Shader Nodes](#shader-nodes).
985+
This section defines the Operator Nodes that all MaterialX implementations are expected to support. Standard Operator Nodes are grouped into the following classifications: [Math Nodes](#math-nodes), [Adjustment Nodes](#adjustment-nodes), [Compositing Nodes](#compositing-nodes), [Conditional Nodes](#conditional-nodes), [Channel Nodes](#channel-nodes) and [Convolution Nodes](#convolution-nodes).
975986

976987

977988

@@ -982,7 +993,7 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m
982993

983994
<a id="node-add"> </a>
984995

985-
* **`add`**: add a value to the incoming float/color/vector/matrix. See also the [Shader Nodes](#shader-nodes) section below for additional `add` variants supporting shader-semantic types.
996+
* **`add`**: add a value to the incoming float/color/vector/matrix.
986997
* `in1` (float or color<em>N</em> or vector<em>N</em> or matrix<em>NN</em>): the value or nodename for the primary input
987998
* `in2` (same type as `in1` or float): the value or nodename to add; for matrix types, the default is the zero matrix.
988999

@@ -994,7 +1005,7 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m
9941005

9951006
<a id="node-multiply"> </a>
9961007

997-
* **`multiply`**: multiply an incoming float/color/vector/matrix by a value. Multiplication of two vectors is interpreted as a component-wise vector multiplication, while multiplication of two matrices is interpreted as a standard matrix product. To multiply a vector and a matrix, use one of the `transform*` nodes. See also the [Shader Nodes](#shader-nodes) section below for additional `multiply` variants supporting shader-semantic types.
1008+
* **`multiply`**: multiply an incoming float/color/vector/matrix by a value. Multiplication of two vectors is interpreted as a component-wise vector multiplication, while multiplication of two matrices is interpreted as a standard matrix product. To multiply a vector and a matrix, use one of the `transform*` nodes.
9981009
* `in1` (float or color<em>N</em> or vector<em>N</em> or matrix<em>NN</em>): the value or nodename for the primary input
9991010
* `in2` (same type as `in1` or float): the value or nodename to multiply by; default is 1.0 in all channels for float/color/vector types, or the identity matrix for matrix types.
10001011

@@ -1022,17 +1033,17 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m
10221033

10231034
<a id="node-floor"> </a>
10241035

1025-
* **`floor`**: the per-channel nearest integer value less than or equal to the incoming float/color/vector; the output remains in floating point per-channel, i.e. the same type as the input.
1036+
* **`floor`**: the per-channel nearest integer value less than or equal to the incoming float/color/vector. The output remains in floating point per-channel, i.e. the same type as the input, except that the floor(float) also has a variant outputting an integer type.
10261037
* `in` (float or color<em>N</em> or vector<em>N</em>): the input value or nodename
10271038

10281039
<a id="node-ceil"> </a>
10291040

1030-
* **`ceil`**: the per-channel nearest integer value greater than or equal to the incoming float/color/vector; the output remains in floating point per-channel, i.e. the same type as the input.
1041+
* **`ceil`**: the per-channel nearest integer value greater than or equal to the incoming float/color/vector. The output remains in floating point per-channel, i.e. the same type as the input, except that the ceil(float) also has a variant outputting an integer type.
10311042
* `in` (float or color<em>N</em> or vector<em>N</em>): the input value or nodename
10321043

10331044
<a id="node-round"> </a>
10341045

1035-
* **`round`**: round each channel of the incoming float/color/vector values to the nearest integer value, e.g "floor(in+0.5)".
1046+
* **`round`**: round each channel of the incoming float/color/vector values to the nearest integer value, e.g "floor(in+0.5)"; the round(float) also has a variant outputting an integer type.
10361047
* `in` (float or color<em>N</em> or vector<em>N</em>): the input value or nodename
10371048

10381049
<a id="node-power"> </a>
@@ -1133,6 +1144,13 @@ Math nodes have one or two spatially-varying inputs, and are used to perform a m
11331144
* **`magnitude`**: output the float magnitude (vector length) of the incoming vector<em>N</em> stream; cannot be used on float or color<em>N</em> streams. Note: the fourth channel in vector4 streams is not treated any differently, e.g. not as a homogeneous "w" value.
11341145
* `in` (vector<em>N</em>): the input value or nodename
11351146

1147+
1148+
<a id="node-distance"> </a>
1149+
1150+
* **`distance`**: Measures the distance between two points in 2D, 3D, or 4D.
1151+
* `in1` (vector<em>N</em>): the first input value or nodename
1152+
* `in2` (same type as `in1`): the second input value or nodename
1153+
11361154
<a id="node-dotproduct"> </a>
11371155

11381156
* **`dotproduct`**: output the (float) dot product of two incoming vector<em>N</em> streams; cannot be used on float or color<em>N</em> streams.
@@ -1366,7 +1384,7 @@ The Mix node takes two 1-4 channel inputs `fg` and `bg` plus a separate 1-channe
13661384
| **`mix`** | Fm+B(1-m) |
13671385

13681386

1369-
See also the [Shader Nodes](#shader-nodes) section below for additional `mix` operator variants supporting shader-semantic types.
1387+
See also the [Standard Library Shader Nodes](#standard-library-shader-nodes) section below for additional `mix` operator variants supporting shader-semantic types.
13701388

13711389

13721390

@@ -1402,7 +1420,7 @@ Conditional nodes are used to compare values of two streams, or to select a valu
14021420
<a id="node-switch"> </a>
14031421

14041422
* **`switch`**: output the value of one of up to ten input streams, according to the value of a selector input `which`. Switch nodes can be of output type float, color<em>N</em> or vector<em>N</em>, and have five inputs, in1 through in10 (not all of which must be connected), which must match the output type.
1405-
* `in1`, `in2`, `in3`, `in4`, `in5`, `in6`, `in7`, `in8`, `in9`, `in10` (float or color<em>N</em> or vector<em>N</em>): the values or nodenames to select from based on the value of the `which` input. The types of the various `in<em>N</em>` inputs must match the type of the `switch` node itself. The default value of all `in<em>N</em>` inputs is 0.0 in all channels.
1423+
* `in1`, `in2`, `in3`, `in4`, `in5`, `in6`, `in7`, `in8`, `in9`, `in10` (float or color<em>N</em> or vector<em>N</em>): the values or nodenames to select from based on the value of the `which` input. The types of the various `in`<em>N</em> inputs must match the type of the `switch` node itself. The default value of all `in`<em>N</em> inputs is 0.0 in all channels.
14061424
* `which` (integer or float): a selector to choose which input to take values from; the output comes from input "floor(`which`)+1", clamped to the 1-10 range. So `which`&lt;1 will pass on the value from in1, 1&lt;=`which`&lt;2 will pass the value from in2, 2&lt;=`which`&lt;3 will pass the value from in3, and so on up to 9&lt;=`which` will pass the value from in10. The default value of `which` is 0.
14071425

14081426
<a id="node-ifelse"> </a>
@@ -1439,7 +1457,7 @@ Channel nodes are used to perform channel manipulations and data type conversion
14391457
<a id="node-combine3"> </a>
14401458
<a id="node-combine4"> </a>
14411459

1442-
* **`combine2`**, **`combine3`**, **`combine4`**: combine the channels from two, three or four streams into the same total number of channels of a single output stream of a specified compatible type; please see the table below for a list of all supported combinations of input and output types. For color output types, no colorspace conversion will take place; the channels are simply copied as-is.
1460+
* **`combine2`**, **`combine3`**, **`combine4`**: combine the channels from two, three or four streams into the same total number of channels of a single output stream of a specified compatible type; please see the table below for a list of all supported combinations of input and output types. For colorN output types, no colorspace conversion will take place; the channels are simply copied as-is.
14431461
* `in1` (float/color3/vector2/vector3): the input value or nodename which will be sent to the N channels of the output; default is 0.0 in all channels
14441462
* `in2` (float/vector2): the input value or nodename which will be sent to the next N channels of the output; default is 0.0 in all channels
14451463
* `in3` (float): for **`combine3`** or **`combine4`**, the input value or nodename which will be sent to the next channel of the output after `in2`; default is 0.0
@@ -1497,25 +1515,6 @@ Convolution nodes have one input named "in", and apply a defined convolution fun
14971515

14981516

14991517

1500-
### Shader Nodes
1501-
1502-
Shader nodes construct a shader (a node with a shader semantic output type) from the specified inputs, which may then be connected to a material. Standard library shaders do not respond to external illumination; please refer to the [**MaterialX Physically Based Shading Nodes**](./MaterialX.PBRSpec.md#materialx-pbs-library) document for definitions of additional nodes and shader constructors which do respond to illumination.
1503-
1504-
1505-
<a id="node-surface"> </a>
1506-
1507-
* **`surface`**: Constructs a surface shader for an unlit surface with a plain unshaded color value. Useful for visualizing texture data or rendering non-PBR materials. Output type "surfaceshader".
1508-
* `color` (color3): Color value to display. Default is (0, 0, 0).
1509-
* `opacity` (float or color3): Cutout (float) or transmission (color3) opacity for the surface. Default is 1.0, representing a fully-opaque surface.
1510-
1511-
<a id="node-displacement"> </a>
1512-
1513-
* **`displacement`**: Constructs a displacement shader describing geometric modification to surfaces. Output type "displacementshader".
1514-
* `displacement` (float or vector3): Scalar (along the surface normal direction) or vector displacement (in (dPdu, dPdv, N) tangent/normal space) for each position. Default is 0.
1515-
* `scale` (float): Scale factor for the displacement vector. Default is 1.0.
1516-
1517-
1518-
15191518
## Standard Node Inputs
15201519

15211520
All standard nodes which define a `defaultinput` or `default` value support the following input:
@@ -2172,14 +2171,11 @@ An input with a shader-semantic type may be given a value of "" to indicate no s
21722171

21732172

21742173

2175-
### Standard Shader-Semantic Operator Nodes
2174+
### Standard Library Shader Nodes
21762175

2177-
The Standard MaterialX Library defines the following nodes and node variants operating on "shader"-semantic types.
2176+
The Standard MaterialX Library defines the following nodes and node variants operating on "shader"-semantic types. Standard library shaders do not respond to external illumination; please refer to the [**MaterialX Physically Based Shading Nodes**](./MaterialX.PBRSpec.md#materialx-pbs-library) document for definitions of additional nodes and shader constructors which do respond to illumination.
21782177

2179-
* **`mix`**: linear blend between two surface/displacement/volumeshader closures.
2180-
* `bg` (surface/displacement/volumeshader): the name of the background shader-semantic node
2181-
* `fg` (surface/displacement/volumeshader): the name of the foreground shader-semantic node
2182-
* `mix` (float): the blending factor used to mix the two input closures
2178+
<a id="node-surfaceunlit"> </a>
21832179

21842180
* **`surface_unlit`**: an unlit surface shader node, representing a surface that can emit and transmit light, but does not receive illumination from light sources or other surfaces. Output type surfaceshader.
21852181
* `emission` (float): the surface emission amount; default is 1.0
@@ -2188,6 +2184,20 @@ The Standard MaterialX Library defines the following nodes and node variants ope
21882184
* `transmission_color` (color3): surface transmission color; default is (1, 1, 1)
21892185
* `opacity` (float): surface cutout opacity; default is 1.0
21902186

2187+
<a id="node-displacement"> </a>
2188+
2189+
* **`displacement`**: Constructs a displacement shader describing geometric modification to surfaces. Output type "displacementshader".
2190+
* `displacement` (float or vector3): Scalar (along the surface normal direction) or vector displacement (in (dPdu, dPdv, N) tangent/normal space) for each position. Default is 0.
2191+
* `scale` (float): Scale factor for the displacement vector. Default is 1.0.
2192+
2193+
<a id="node-mix-shader"> </a>
2194+
2195+
* **`mix`**: linear blend between two surface/displacement/volumeshader closures.
2196+
* `bg` (surface/displacement/volumeshader): the name of the background shader-semantic node
2197+
* `fg` (surface/displacement/volumeshader): the name of the foreground shader-semantic node
2198+
* `mix` (float): the blending factor used to mix the two input closures
2199+
2200+
21912201

21922202
### AOV Output Elements
21932203

0 commit comments

Comments
 (0)