Overview
Samplers are used to visually build expressions that can drive the parameters of other nodes in a Graph - rather than acting on a data stream they assemble pseudo expressions which are validated and compiled on a per node basis and evaluated within each nodes individual context at runtime.
The same expression flow can be used to drive any number of parameters within the Graph, the only limitation is that any attribute variables referenced in the Sampler nodes need to exist on the geometry being processed.
For example, a Texture node might use the attribute variable $strandu as a V coordinate and the graph will succeed when evaluating fibre objects but will fail if particles are evaluated as it doesn't exist on that geometry type.
Here is a quick example using the new Expression Sampler node.
With a Grow node created the new Sampler node can be created and a simple expression is added.
The output from the Expression node expression0 is dragged to the Grow node labelled grow0, when hovering over the target node the right mouse button can be used to reveal a list of parameters to connect too.
Once selected the node graph will update to show the new connection made as well as the parameter being controlled.
Sampler Node Reference
Curve
The Curve node provides a visual representation of a curve that is modulated by the Curve Parameter.
Parameter | Description |
---|---|
Curve Parameter | The attribute/value that is used to determine the parameter along the curve, this is $strandu by default which is along the length of a fibre. |
Curve | The Curve data to be evaluated. |
Can be used to build a larger expression to be evaluated, multiple input float and vector parameters can be defined in the Parameters tab and referenced within the expression using $f0..$f3 (for floats) and $v0..$v3 (for vectors). These input parameters can also be wired up to additional Sampler nodes.
Parameter | Description |
---|---|
Expression | The expression to be evaluated, please refer to Expression Reference for details on the expression language used. |
Float and Vector Inputs | Inputs that can be referenced within the expression using $f0..$f3 (for floats) and $v0..$v3 (for vectors). |
A Sampler node that generates noise patterns based on common noise algorithms.
Parameter | Description |
---|---|
Position | The input position for the noise. |
Time | An additional parameter that can be used for 4D noise. |
Scale | Overall scale of the noise. |
Offset | Offset value for the input. |
Algorithm
Parameter | Description |
---|---|
Noise Type | Choose between noise, cell or fBM noise algorithms. |
Input | 3d or 4d (with time) input. |
Output | 1d (float) or 3d (vector) output. |
The texture node is used to sample an external texture image file to drive downstream parameters.
Parameter | Description |
---|---|
File | The input filename which can reference environment variables using the ${ENV} format as well as UDIM substitution for different coordinate spaces. Standard string modifiers can be used to set a frame time, ie. myTexture.%04d.exr on frame 10 would be resolved as myTexture.0010.exr. |
Frame | The desired frame number to use if referenced in the filename. |
Channels | What color channel to reference, regardless of mutple or single channels the result will always be a vector. |
U/V Coordinate | What attribute/value should be used for the texture coordinate. |
UDIM Texture Atlases
Texture atlases can be referenced using filenames that are expanded during lookup via UDIM patterns. The substitutions will occur if the texture filename passed does not exist as a concrete file and contains one or more of the following substrings:
Pattern | Numbering scheme | Example expansion if u=0.5, v=2.5 |
---|---|---|
<UDIM> | 1001 + utile + vtile * 10 | 1021 |
<u> | utile | u0 |
<v> | vtile | v2 |
<U> | utile + 1 | u1 |
<V> | vtile + 1 | v3 |
<UVTILE> | equivalent to <U>_<V> | u1_v3 |
_u##v## | utile,vtile | _u00v02 |
%(UDIM)d | synonym for <UDIM> | 1021 |
Example:
A texture request at coordinates (1.4, 3.8) using the filename paint.<UDIM>.tif will attempt to retrieve the texture sample from a file named paint.1032.tif at coordinates (0.4, 0.8).
Used to sample Groom attributes.
Parameter | Description |
---|---|
Groom | The input groom. |
Attribute | The name of the attribute to sample. "length" is a specialized option that doesn't need to exist on the groom and will instead use each strands length value. |
Sample Count | How many samples should be taken and weighted, the default is 9 but there may be cases where only a single sample would be desireable (ie. selecting instance or feather id's) |