---
title: "Hair Sampler | VRayHairSampler"
canonical: "https://documentation.chaos.com/space/VRAYNUKE/110626546/Hair%20Sampler%20%7C%20VRayHairSampler"
format: markdown
---
## **Overview**

---


---


 

---

##   


## **Parameters**

---

 

![image](media://0f932f0d-fcb2-48e3-acc8-8f87af83bb68)

 

## **Sampling channel**

---

**Use V channel** – Uses the V channel of the connected texture.

**Use U channel** – Uses the U channel of the connected texture.

## **Mode**

---

**Distance Along Strand** – Provides information about the shaded part of the hair strand. For the base of the strand, the value is 0.0, and for the tip it is 1.0. With this option, a texture can be mapped along each strand regardless of each strand's length.

**Distance Along Strand Absolute** – Provides information about the shaded part of the hair strand using absolute distance. This option uses the **Hair Max Distance** parameter to allow length-dependent mapping. For instance, when used with a gradient, this allows for all hair strands (regardless of length) to have a root color all up to the same length followed by the rest of the ramp. Note that when **Hair Max Distance** is lower than the actual length of the hair strand, the gradient is repeated over the length of the hair strand.

**Hair Color** – Provides information about the diffuse color along the hair strand.

**Hair Incandescence** – Provides information about the incandescence color along the hair strand.

**Hair Transparency** – Provides information about the transparency along the hair strand.

**Random By Strand **– Provides an unique random floating point value for each strand in the hair system, which allows shading each strand with a random color sampled from a texture.

**Hair Max Distance** – Allows the user to set the max strand length when using **Distance Along Strand Absolute**. Typically, this value should be equal to the longest strand of hair. This option is mappable, allowing different parts in a hair system to have different max lengths.

 

## **Common Setup**

---

The V-Ray Hair Sampler is set up by connecting an output from VRayHairSampler to a 2D driven texture; which is most commonly a [VRayTexRamp](https://docs-chaos.atlassian.net/wiki/spaces/VRAYNUKE/pages/110626544) node. This example shows VRayHairSampler's** Random By Strand** attribute to control the V channel of a ramp connected to a VRayMtl's Diffuse Color parameter.

 

 

 

Here, VRayHairSampler is used to create variation in the color along the length of a hair's strand to give the hair a more natural look. This is done by using the VRayHairSampler's** Distance Along Strand** attribute to control the V channel of a ramp connected to a VRayMtl's Diffuse Color parameter. Note that the full ramp is mapped along each strand regardless of the strand's length. 

 

 

This final example uses the VRayHairSampler's** Distance Along Strand Absolute** attribute. Similar to the previous example, it controls the V channel of a ramp connected to a VRayMtl's Diffuse Color parameter. However, this attribute uses the **Hair Max Distance** to allow length-dependent mapping. The renders below use the same setup and ramp but with different **Hair Max Distance** values. Note that when **Hair Max Distance** is lower than the actual length of the hair strand, the gradient is repeated over the length of the hair strand.

![image](media://9e3fdeb0-469a-4601-a940-43e7fbfa5b44)

The ramp is driven by the** distanceAlongStrandAbsolute** parameter  
The ramp is connected to the VRayMtl's **Diffuse Color**   
Multiple Colors set with smooth interpolation

 

 

---

 

## **Notes**

---

- When using ramps, there is a strict correlation between plugging VRayHairSampler into a vCoord and using vRamp, as well as alternatively uCoord + uRamp.