= Using clumping = NOTE: This tutorial is a detailed look into what goes on at the network level. An automatic way to create the same effect is to use the [Paint Clumping|/shelf/paintclumping] tool on the shelf. == Using clumping with guides == This tutorial is a continuation of [Using guide hairs|usingguides]. The third input on the [Fur SOP|Node:sop/fur] is for clump geometry. In order to use clumping, the fur will need a `clumporigin` attribute and another [Fur SOP|Node:sop/fur]. NOTE: When using guides with clumping, each guide hair is a clump. # Insert an [Icon:SOP/attribute][AttribCreate|Node:sop/attribcreate] node in your network and connect the [Icon:SOP/grid][Grid SOP|Node:sop/grid] to its input. # Change the __Name__ parameter to `clumporigin`, set the __Type__ to __Vector__, and set a __Value__. In this example, we will set the __Value__ parameters to: `$RESTX`, `$RESTY`, and `$RESTZ`. NOTE: When animating the skin of a character, do not animate the `clumporigin`. # Insert a [Icon:SOP/rest][Rest SOP|Node:sop/rest] between the [Icon:SOP/grid][Grid SOP|Node:sop/grid] and the two [Icon:SOP/attribute][AttribCreate|Node:sop/attribcreate] nodes. This eliminates the problem of fur being added and subtracted when the skin is deformed during animation. # Insert another [Icon:SOP/fur][Fur SOP|Node:sop/fur] after the `clumporigin` attribute and connect it to the third input of the [Fur SOP|Node:sop/fur] you created in [Basic fur setup|basicsetup]. The Fur SOP picks up attributes from the clump geometry, then guide geometry, then skin geometry (from right to left). Therefore, you must clear the `*` from the __Skin Attributes__ and __Guide Attributes__ parameters in this node, and specify only the attributes that are required for clumping. (If you do not clear the `*` from the __Skin Attributes__ and __Guide Attributes__ parameters, the final Fur SOP will pick up the skin and guide attributes from the clump geometry instead of the skin and guide geometry.) # Wire the `GUIDE_OUT` node to the guide geometry input (second input) of the [Fur SOP|Node:sop/fur] you just created. [Image:/images/fur/clump_nodes.png] # Set the __Skin Attributes__ parameter on the [Fur SOP|Node:sop/fur] you just created to `clumporigin`. # Double-click the SHOP network you created in [Basic fur setup|basicsetup], and insert a Fur Style shader. For better visualization of the clumps, set the __Randomize Length__ parameter on the __Shape__ tab to `0`, and the __Amplitude__ parameter on the __Frizz__ tab to `0`. NOTE: The __Clump__ parameter on the __Shape__ tab allows you to scale the amount of clumping. For example, a value of `1` will result in fur being fully clumped, and a value of `0` will result in no clumping. # Click `Fur` in the path at the top of the network editor to return to the geometry level. # On the [Fur SOP|Node:sop/fur] you created in [Basic fur setup|basicsetup], set the __Guide Shader__ to the Fur Style shader by clicking the [Icon:BUTTONS/chooser_node] node chooser and selecting it from the tree. Also, increase the __Density__ to `1000`, because clumping will not work if you have the same amount of fur on both fur nodes. # To better visualize the clumps, set the __Display Ratio__ to 0.1 on both fur SOP nodes. This will only display 10% of the fur density in the viewport. [Image:/images/fur/clump_origin.png] When clumping is used, each hair is associated with a clump, which is determined by the __Clump Radius__. If a hair is not close to a clump, it will be trimmed out. You can scale the __Clump Radius__ on the [Fur SOP|Node:sop/fur] to determine the size of the clump. Remember, the [Fur SOP|Node:sop/fur] should only be used for visualization in the viewport. In order to render, it is highly recommended that you use a [fur procedural shader|/nodes/shop/vm_geo_fur], which will delay the generation of fur until render time. For more information on setting this up, see [Basic fur setup|basicsetup]. == Using clumping without guides == This procedure is a continuation of [Basic Fur Setup|basicsetup], which explains how to create some basic fur. The third input on the [Fur SOP|Node:sop/fur] is for clump geometry. In order to clump the fur will need a `clumporigin` attribute and another [Fur SOP|Node:sop/fur]. # Insert an [Icon:SOP/attribute][AttribCreate|Node:sop/attribcreate] node in your network. # Change the __Name__ parameter to `clumporigin`, set the __Type__ to __Vector__, and set a __Value__. In this example, we will set the __Value__ parameters to: `$RESTX`, `$RESTY`, and `$RESTZ`. # Insert a [Icon:SOP/rest][Rest SOP|Node:sop/rest] between the [Icon:SOP/grid][Grid SOP|Node:sop/grid] and the two [Icon:SOP/attribute][AttribCreate|Node:sop/attribcreate] nodes. This eliminates the problem of fur being added and subtracted when the skin is deformed during animation. # Insert another [Icon:SOP/fur][Fur SOP|Node:sop/fur] after the `clumporigin` attribute and connect it to the third input of the [Fur SOP|Node:sop/fur] you created in [Basic fur setup|basicsetup]. [Image:/images/fur/clump_nodes1.png] # Set the __Skin Attributes__ parameter on the [Fur SOP|Node:sop/fur] you just created to `clumporigin` and increase the __Segments__ to `10`. # Double-click the SHOP network you created in [Basic fur setup|basicsetup], and insert a Fur Style shader. For better visualization of the clumps, set the __Randomize Length__ parameter on the __Shape__ tab to `0`, and the __Amplitude__ parameter on the __Frizz__ tab to `0`. NOTE: The __Clump__ parameter on the __Shape__ tab allows you to scale the amount of clumping. For example, a value of `1` will result in fur being fully clumped, and a value of `0` will result in no clumping. # Click `Fur` in the path at the top of the network editor to return to the geometry level. # On the [Fur SOP|Node:sop/fur] you created in [Basic fur setup|basicsetup], set the __Guide Shader__ to the Fur Style shader by clicking the [Icon:BUTTONS/chooser_node] node chooser and selecting it from the tree. Also, set the __Segments__ to `10`, and the __Density__ to `1000`. Clumping will not work if you have the same amount of fur on both fur nodes. # To better visualize the clumps, set the __Display Ratio__ to 0.1 on both [Fur SOPs|Node:sop/fur]. This will only display 10% of the fur density in the viewport. [Image:/images/fur/clump_origin.png] It is important to note that when clump is used, each hair is associated with a clump, which is determined by the __Clump Radius__. If a hair is not close to a clump, it will be trimmed out. You can scale the __Clump Radius__ on the [Fur SOP|Node:sop/fur] to determine the size of the clump. Remember, the [Fur SOP|Node:sop/fur] should only be used for visualization in the viewport. In order to render, it is highly recommended that you use a [fur procedural shader|/nodes/shop/vm_geo_fur], which will delay the generation of fur until render time. For more information on setting this up, see [Basic fur setup|basicsetup]. == Shaping the clump == You can also shape the clumps by inserting a `clumpshape` attribute between the two [Fur SOPs|Node:sop/fur]. This attribute works independently of guides, so you can use it for clumping with or without guides. [Image:/images/fur/clump_nodes2.png] The default behavior of clumping is to simply pull the fur towards the clump. Using `clumpshape` allows you to specify exactly how the fur looks as it is being pulled towards the clump. Change the __Name__ parameter to `clumpshape`, set the __Class__ to __Vertex__, and set a __Value__. In this example, we will set the first __Value__ parameter to: `pow($VTX/($NVTX - 1), 2)`, which will cause the hairs to be relatively straight at the base and curve toward the clump at the tip. [Image:/images/fur/clump_shape.png] NOTE: If you are using clumping with guides, in order for this attribute to work, your [line|Node:sop/line] (guide hair) must have more than 2 points.