Mantra: Fur Procedural shader
Creates a set of hair-like curves across a surface at render time.
The Mantra Fur Procedural creates a set of curves to represent hairs growing out from a surface polygon. CVEX shaders can be applied to manipulate attributes and the shape of the generated curves.
The number of generated curves is a result of the density multiplied by the area of the skin polygons. The area of the skin polygons is taken from the optional “area” attribute or calculated from the vertex positions described by the optional “rest” attribute or point positions.
The optional second input provides guide curves. The shape of the guide curves are interpolated to determine the shape of the generated curves (before CVEX shaders are applied) ignoring the “Length” and “Vertices”, on the Mantra Fur Procedural.
The optional third input provides clump curves. The “clumporigin” and “clumpradius” attributes on the clump curves are used to map each generated curve to a clump.
Attributes
The Mantra Fur Procedural uses the following attributes from the input geometries.
| Name | Source | Class | Type | Description |
|---|---|---|---|---|
area | Skin | Primitive | Float | This attribute describes the area of each polygon in the skin geometry. This affects the number of curves generated by the primitive. This attribute is optional, if missing the area of each primitive will be computed. |
clumporigin | Clumps | Primitive | Float[3] | describes where each clump originates on the rest skin |
clumpradius | Clumps | Primitive | Float | maximum distance from the clump origin hairs may originate and still be a member of the clump |
furdensity | Skin | Any | Float | This attribute is used as a scalar multiplier to the “Density” parameter and affects the number of generated curves. If this value is reduced by a CVEX skin shader, some curves will be removed to reflect the lowered density value. This attribute is optional, if missing a value of 1 is used. |
furlength | Skin | Any | Float | This attribute is used as a scalar multiplier to the “Length” parameter and affects the length of the generated curves. This attribute is optional, if missing a value of 1 is used. |
rest | Skin | Point or Vertex | Float[3] | This attribute describes the rest position of each point in the skin geometry. This affects the calculation of each polygon’s area when determining the number of generated curves. This value is also used to map each generated curve to a clump. This attribute is optional, if missing the point’s position is used. |
The Mantra Fur Procedural makes the following special attributes available to the CVEX shaders.
| Name | Class | Type | Description |
|---|---|---|---|
clumpP | Vertex | Float[3] | Describes the position of each vertex in the associated clump hair. This attribute is only available in the Guide Shader. |
clumproot | Primitive | Float[3] | Describes the position on the skin from which each clump hair is grown. |
hairid | Primitive | Integer | Contains a unique ID for each generated curve. This is a read-only attribute. |
hairroot | Primitive | Float[3] | Describes the position on the skin from which each hair is grown. |
hairdist | Vertex | Float | Describes each vertex’s parameterized distance along the curve in the [0, 1] range. This attribute is only available in the Guide Shader. |
P | Point | (point position) | Describes the position of each vertex in the generated hairs. This attribute is only available in the Guide Shader. |
restxdir | Primitive | Float[3] | Describes the x-axis direction of the “rest” attribute as a world space direction. |
restydir | Primitive | Float[3] | Describes the y-axis direction of the “rest” attribute as a world space direction. |
restzdir | Primitive | Float[3] | Describes the z-axis direction of the “rest” attribute as a world space direction. |
The Mantra Fur Procedural can be used to interpolate (and manipulate using CVEX shaders) any attribute. The following are some related attributes used by mantra.
| Name | Type | Description |
|---|---|---|
orient | Float[3] | hint direction for orienting the ribbons used to represent curves |
width | Float | width of the rendered curves |
Parameters
Main
Skin | path to an object containing skin geometry | ||||
Guides | path to an object containing guide hairs | ||||
Clumps | path to an object containing clump center geometry | ||||
Group | primitives in the skin geometry from which to grow hair | ||||
Primitive Type | Type of geometry to create.
| ||||
Vertices | number of vertices in each generated curve (ignored if geometry is provided by the “Guides” input) | ||||
Length | Specifies the length of the generated curves (ignored if geometry is provided by the “Guides” input). The value of this parameter acts as a scalar multiplier to the optional “furlength” attribute to determine the length of the generated curves. | ||||
Seed | seed value for the random number generator | ||||
Density | The number of generated curves is a result of the density multiplied by the area of the skin polygons. The value of this parameter acts as a scalar multiplier to the optional “furdensity” attribute to determine the curve density. | ||||
Display Ratio | Specifies a fraction of the curves to display. | ||||
Clump Radius | Maximum distance a hair can be from a clump and still be a member of the clump. | ||||
Use Closest Clump | Associates each hair with its closest clump. | ||||
Skin Shader | The “Skin Shader” parameter specifies a CVEX SHOP to manipulate attributes interpolated from the skin geometry. Each attribute has a single value for each generated curve. A unique value for each curve is available for reading in the “hairid” value. In the case of the “furdensity” variable, reducing the value will result in hairs being removed but increasing the value has no effect. | ||||
Guide Shader | The “Guide Shader” parameter specifies a CVEX SHOP to manipulate attributes interpolated from the guide and clump geometries. Each attribute has a separate value for each vertex in the generated curves. The special “P” variable may be used to manipulate the vertex position. | ||||
Skin Attributes | Specifies a list of attributes from the skin geometry that will be transferred to the generated curves. All attributes will be created as primitive attributes on the generated curves and contain any modifications made by CVEX shaders. | ||||
Guide Attributes | Specifies a list of attributes from the guide and clump curves that will be transferred to the generated curves. All attributes will be created as vertex attributes on the generated curves and contain any modifications made by CVEX shaders. | ||||
Expand Bounds | Allows you to adjust the bounds of the bounding box to compensate for any fur that may have been moved outside of the original bounds by a shader. |
IFD Bounds
Bounding Box | The bounding box controls let you specify a bounding box for the referenced geometry. Only when this bounding box is “on screen” will mantra load the referenced geometry. You can set Bounding box to No bounding box required, in which case mantra will always load the references geometry regardless. You can also specify the bounding box by referencing the SOP’s bounding box in the SOP Bounds parameter. |
SOP Bounds | The geometry whose bounding box you want to reference. |
Min Bounds | The minimum bounding box dimensions, when setting explicit bounds. |
Max Bounds | The maximum bounding box dimensions, when setting explicit bounds. |
Examples
The following examples use this node:
FurBallWorkflow
$HFS/mozilla/documents/examples/nodes/sop/fur/FurBallWorkflow.otl
