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> 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.