# Shader and Layer Relations

The Hair Strand Builders' layer system allows you to manage your hair strands using Maya Display Layers built directly into the main UI. The layers and shaders of that layer are related, and we will go through them both on this page.

***

## **Shader Options**

<div align="left"><figure><img src="/files/NMScwymfuH8w1ZAWrs0Q" alt=""><figcaption></figcaption></figure></div>

### **Texture Toggles**

Texture toggles allows you to quickly display the texture assigned to the layer (if assigned).&#x20;

* Full - Display all textures on strands.
* Color Only - Display the color of layer on strands.
* Alpha Only - Display only the alpha + the color of the layer on strands. (Card Only)

### **Shader Swaps**

Changes the selected layers material type.

* Lambert, Surface, Blinn (Avaliable for both Tube and Card)
* Phong, Ramp (Tube Only)

***

### Vertex Painter

{% embed url="<https://youtu.be/oaQ3ktkAhc8>" %}

#### Vertex - Assign

* With strands selected, applie a root to tip gradient color
* Click on the option box, for more controls
  * Color ramp - you can pick the colors for your root to tip display on hair strands
    * While strands are selected, adjusting colors will automatically re-assign the colors live.
  * Apply to Selected Curves - apply the color ramp to selected strands
  * Clear Colors on Selected Curves - remove the color ramp from selected
  * Reset to Default - resets the color ramp to the default color&#x20;

<div align="left"><figure><img src="/files/KDr7fW1w4lAhUeyEfAbZ" alt=""><figcaption></figcaption></figure></div>

#### Vertex Color - Remove

* With strands selected, remove the root to tip gradient color

***

### **PFX Outline**

#### **Create New PFX Outline On Selection** (Tube Only)

* With strand curves selected, applies a new PFX outline node.

#### **Remove Assigned PFX Outlines**  (Tube Only)&#x20;

* with strand curves selected, removes the assigned PFX outline node.

#### **Delete PFX Outlines**  (Tube Only)

* opens a UI where we can select existing PFX outline nodes and delete them.

#### **Randomly Assign Cards To Layers** (Card Only)&#x20;

* A UI for randomizing card strands into layers.

***

## Layer and Shaders Relations

Each layer represents a shader. Every strand in that layer will be assigned to the same shader.&#x20;

Whenever a layer is created, from the Create button, PFX Draw Tool, or from the duplicate layer function, a shader network (with a random color) is created as well. The shader network will have:

* a shader, and
* condition nodes (for texture toggle purposes)

**Tube** Layer Material network:

<figure><img src="/files/tBJ9RjahJehodUMyP7oI" alt=""><figcaption></figcaption></figure>

**Card** Layer Material network:

<figure><img src="/files/MyzLEF1eoEri4E34H2ue" alt=""><figcaption></figcaption></figure>

***

## **Connecting Texture**

For **Tubes:**

* Diffuse: Connect '*OutColor'* of a map to '*\<layer>\_cond\_diffuse.ColorA*'

<figure><img src="/files/ehljdw6vfjjsuUVNgguF" alt=""><figcaption></figcaption></figure>

For **Cards:**

* Diffuse: Connect connect '*OutColor'* of a map to '*\<layer>\_cond\_diffuse.ColorA*'
* Specular: Connect connect '*OutColor'* of a map to '*\<layer>\_cond\_spec.ColorA*'
* Alpha: Connect connect '*OutTransparency*' of a map to '*\<layer>\_cond\_alpha.ColorA'*

<figure><img src="/files/Qk9mIYxxB5J7d1ZZ5Xlu" alt=""><figcaption></figcaption></figure>

Here's a quick video on how to connect an .png texture as alpha.

{% embed url="<https://youtu.be/jot7VrNqUJs>" %}

## **Moving Strands to Another Layer**

When a strand is moved from one layer to another, it will automatically assign the strand to the shader of that layer.

<figure><img src="/files/DIDhS8gzo5CiSQHqdTQ3" alt=""><figcaption><p>When moving a strand to another layer, the corresponding shader will be assigned</p></figcaption></figure>

***

## **Changing Layer Shader Type**

If the default lambert is not for you, you can change the shader type by:

* Selecting the layers
* Go to the Shader Toggle button, and pick a shader type.

<figure><img src="/files/J6wdlR9ZRIGrO9jF5odV" alt=""><figcaption></figcaption></figure>

***

## **Randomly Assign Strands to Layers (Card Only)**

* To give more variations to card strands. The tool allows you to randomize card strands into layers, with percentage.&#x20;
* To do that, click on the ![](/files/L3jjTUuBeFbMdExl3PPR) drop down, and select "Randomly Assign Cards to Layers" option. This will open a UI with all the layers and percentage input fields.
* With the card strands selected, now select all the layers to randomize. Enter a percentage for each selected layers, and click on Apply.
* To re-shuffle, click on Apply again.

{% hint style="info" %}
Only the highlighted layers will be used for randomizing cards into.
{% endhint %}

<figure><img src="/files/wfX5mgx41tjwVgV8vR2l" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nobraintools.gitbook.io/maya-groomers-tool/maya-tools/hair-strand-builders/shader-and-layer-relations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
