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.


ParameterDescription
Curve ParameterThe 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.
CurveThe Curve data to be evaluated.



Expression


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.


ParameterDescription
ExpressionThe expression to be evaluated, please refer to Expression Reference for details on the expression language used.
Float and Vector InputsInputs that can be referenced within the expression using $f0..$f3 (for floats) and $v0..$v3 (for vectors). 



Noise


A Sampler node that generates noise patterns based on common noise algorithms.  


ParameterDescription
PositionThe input position for the noise.
TimeAn additional parameter that can be used for 4D noise.
ScaleOverall scale of the noise.
OffsetOffset value for the input.


Algorithm

ParameterDescription
Noise TypeChoose between noise, cell or fBM noise algorithms.
Input3d or 4d (with time) input.
Output1d (float) or 3d (vector) output.


Texture


The texture node is used to sample an external texture image file to drive downstream parameters. 


ParameterDescription
FileThe 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. 
FrameThe desired frame number to use if referenced in the filename.
ChannelsWhat color channel to reference, regardless of mutple or single channels the result will always be a vector. 
U/V CoordinateWhat 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:


PatternNumbering schemeExample expansion if u=0.5, v=2.5
<UDIM>1001 + utile + vtile * 101021
<u>utileu0
<v>vtilev2
<U>
utile + 1u1
<V>vtile + 1
v3
<UVTILE>equivalent to <U>_<V>u1_v3
_u##v##utile,vtile_u00v02
%(UDIM)dsynonym 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).



Groom


Used to sample Groom attributes.  


ParameterDescription
GroomThe input groom.
AttributeThe 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 CountHow 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)