---
title: "Hair Sampler Texture Setup"
canonical: "https://documentation.chaos.com/space/VMAYA/111741659/Hair%20Sampler%20Texture%20Setup"
format: markdown
---
This page includes details on the hair Sampler node used with V-Ray hair.

## **Overview**

---



## **Tutorial Assets**

---

To download the files used in this tutorial, please click on the button below.

> Macro (refined-button)




## **Tutorial Steps**

---

### **Apply VRayHair3Mtl to hair system**

** **1.  Select the Hair System in the Outliner and add the V-Ray Hair Shader Attributes. This is done by navigating to the **hairSystemShape **tab in the Attribute Editor, and selecting **Attributes > VRay > Hair Shader**.

![image](media://ed9534b0-9ac8-4491-89a3-e0e49e2fe409)

  
** **

2.  Apply a VRayHairMtl3 shader to the **HairShader **slot in the Extra VRay Attributes rollout.

![image](media://33997bfe-7d1d-435c-8512-080f8b117f7c)


3.  For clarity later in this tutorial, set the **preset** to **White (matted). **This will make the hair a natural white.


4.  Do a quick render for reference.


> Macro (inline-media-image)

   
Resulting Render



### **Set up the Ramp**

1.  Create both a **ramp** and a **VRayHairSampler** node in the Hypershade.

![image](media://a9f080a0-089e-4ef8-a05a-bdccc0a34804)



2.  Disconnect the **place2dtexture** node from the **ramp** by selecting and deleting the inputs.

![image](media://e327a2ff-28ec-42fb-9d07-bd62d04b2ff2)


3.  Click on VRayHairSampler's white output and select **Other... **to bring up the output selection window. From here, either **distanceAlongStrand**, **distanceAlongStrandAbsolute**, or **randomByStrand** can be selected.

![image](media://d18415ee-bb18-4d99-a282-e64ca204c75d)


4.  Connect this output from the **VRayHairSampler **to the** V Coord** input of the **Ramp**.


![image](media://78b023d8-0c6b-49b2-a95c-443f7e3f5a48)



### **Color the Hair**

1.  Connect the ramp to the desired **VRayHair3Mtl** channel(s). Here, we connect the **Out Color** channel to both the **Diffuse Color** and **Primary Specular** channels to affect both the color and shininess of the hair.

![image](media://34cefe5a-c6c4-45ca-9785-803bebbc04be)



2.  Finally, select the desired colors for the ramp. Here are a couple of examples:


> Macro (inline-media-image)

  
The ramp is driven by the **randomByStrand ** parameter.  
Multiple colors set with no interpolation.


> Macro (inline-media-image)

   
With **randomByStrand**, each hair strand recieves one color from the ramp.



> Macro (inline-media-image)

  
This ramp is used for both the ** distanceAlongStrand ** and **distanceAlongStrandAbsolute **parameters.   
Multiple colors set with no interpolation.



### Using the Hair Max Distance

1.  The **Hair Max Distance** parameter allows you to set the max strand length when using **distanceAlongStrandAbsolute**. This option is mappable, allowing different parts in a hair system to have different max lengths.

![image](media://b7b976f6-5356-477d-ab31-d37668dfd42c)



2.  It can also be set in the **Extra Attributes** rollout when the **VRayHairSampler** node is selected. Typically, this value should be equal to the longest strand of hair.

  
> Macro (inline-media-image)

  
  
  
The following examples demonstrate length-dependent effects that can be produced.


> Macro (inline-media-image)

  
This ramp is driven by the ** distanceAlongStrandAbsolute ** parameter.   
Three colors set with linear interpolation.