A game about forced loneliness, made by TACStudios
1# ThreadMapDetail node
2
3The ThreadMapDetail node adds tileable thread map detail information to a fabric material. The node outputs a thread map that you can apply to a fabric material.
4
5
6
7[!include[nodes-subgraph-node](./snippets/nodes-subgraph-node.md)]
8
9A thread map is a Texture with 4 channels. Like a detail map, a thread map contains information about ambient occlusion, the normal x-axis and normal y-axis, and smoothness.
10
11For more information on Detail maps, see [Secondary Maps (Detail Maps) & Detail Mask](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterDetail.html) in the Unity User Manual.
12
13## Create Node menu category
14
15The ThreadMapDetail node is under the **Utility** > **High Definition Render Pipeline** > **Fabric** category in the Create Node menu.
16
17## Compatibility
18
19[!include[nodes-compatibility-hdrp](./snippets/nodes-compatibility-hdrp.md)]
20
21[!include[hdrp-latest-link](./snippets/hdrp-latest-link.md)]
22
23[!include[nodes-all-contexts](./snippets/nodes-all-contexts.md)]
24
25## Inputs
26
27[!include[nodes-inputs](./snippets/nodes-inputs.md)]
28
29<table>
30 <thead>
31 <tr>
32 <th><strong>Name</strong></th>
33 <th><strong>Type</strong></th>
34 <th><strong>Binding</strong></th>
35 <th><strong>Description</strong></th>
36 </tr>
37 </thead>
38 <tbody>
39 <tr>
40 <td><strong>Use Thread Map</strong></td>
41 <td>Boolean</td>
42 <td>None</td>
43 <td>Use the port's default input to enable or disable the ThreadMapDetail node. You can also connect a node that outputs a Boolean to choose when to enable or disable the thread map.</td>
44 </tr>
45 <tr>
46 <td><strong>ThreadMap</strong></td>
47 <td>Texture 2D</td>
48 <td>None</td>
49 <td>The texture that contains the detailed information of a fabric's thread pattern. The texture should contain 4 channels:
50 <ul>
51 <li>R - The ambient occlusion</li>
52 <li>G - The normal Y-axis</li>
53 <li>B - The smoothness</li>
54 <li>A - The normal X-axis</li>
55 </ul>
56 </td>
57 </tr>
58 <tr>
59 <td><strong>UV</strong></td>
60 <td>Vector 2</td>
61 <td>UV</td>
62 <td>The UV coordinates the ThreadMapDetail node should use to map the ThreadMap texture on the geometry.</td>
63 </tr>
64 <tr>
65 <td><strong>Normals</strong></td>
66 <td>Vector 3</td>
67 <td>None</td>
68 <td>The base normal map that you want your Shader Graph to apply to the geometry before it applies the thread map.</td>
69 </tr>
70 <tr>
71 <td><strong>Smoothness</strong></td>
72 <td>Float</td>
73 <td>None</td>
74 <td>The base smoothness value that you want your Shader Graph to apply to the geometry before it applies the thread map.</td>
75 </tr>
76 <tr>
77<td><strong>Alpha</strong></td>
78<td>Float</td>
79<td>None</td>
80<td>The base alpha value that you want your Shader Graph to apply to the geometry before it applies the thread map.</td>
81</tr>
82<tr>
83<td><strong>Ambient Occlusion</strong></td>
84<td>Float</td>
85<td>None</td>
86<td>The base ambient occlusion value that you want your Shader Graph to apply to the geometry before it applies the thread map.</td>
87</tr>
88<tr>
89<td><strong>Thread AO Strength</strong></td>
90<td>Float</td>
91<td>None</td>
92<td>Specify a value of <code>0</code> or <code>1</code> to determine how the <strong>ThreadMap</strong>'s ambient occlusion should impact the final shader result:
93<ul>
94<li>If you provide a value of <code>0</code>, the <strong>ThreadMap</strong>'s ambient occlusion has no effect on the final output of the shader.</li>
95<li>If you provide a value of <code>1</code>, Shader Graph multiplies your base <strong>Ambient Occlusion</strong> value by the ambient occlusion value specified in your <strong>ThreadMap</strong> to determine the final output of the shader.</li></ul></td>
96</tr>
97<tr>
98<td><strong>Thread Normal Strength</strong></td>
99<td>Float</td>
100<td>None</td>
101<td>Specify a value of <code>0</code> or <code>1</code> to determine how the <strong>ThreadMap</strong>'s normal should impact the final shader result:
102<ul>
103<li>If you provide a value of <code>0</code>, the <strong>ThreadMap</strong>'s normal has no effect on the final output of the shader.</li>
104<li>If you provide a value of <code>1</code>, Shader Graph blends the values from your base <strong>Normals</strong> with the normal specified in your <strong>ThreadMap</strong> to determine the final output of the shader.</li></ul></td>
105</tr>
106<tr>
107<td><strong>Thread Smoothness Strength</strong></td>
108<td>Float</td>
109<td>None</td>
110<td>Specify a value of <code>0</code> or <code>1</code> to determine how the <strong>ThreadMap</strong>'s smoothness should impact the final shader result:
111<ul>
112<li>If you provide a value of <code>0</code>, the <strong>ThreadMap</strong>'s smoothness value has no effect on the final output of the shader.</li>
113<li>If you provide a value of <code>1</code>, Shader Graph adds the smoothness value specified in your <strong>ThreadMap</strong> to your base <strong>Smoothness</strong> value to determine the final output of the shader. For this calculation, Shader Graph remaps the value of your <strong>ThreadMap</strong>'s smoothness from (0,1) to (-1, 1).</li></ul></td>
114</tr>
115</tbody>
116</table>
117
118## Outputs
119
120[!include[nodes-outputs](./snippets/nodes-outputs.md)]
121
122<table>
123<thead>
124<tr>
125<th><strong>Name</strong></th>
126<th><strong>Type</strong></th>
127<th><strong>Description</strong></th>
128</tr>
129</thead>
130<tbody>
131<tr>
132<td><strong>Normal</strong></td>
133<td>Vector 3</td>
134<td>The final normal output of the thread map.</td>
135</tr>
136<tr>
137<td><strong>Smoothness</strong></td>
138<td>Float</td>
139<td>The final smoothness output of the thread map.</td>
140</tr>
141<tr>
142<td><strong>Ambient Occlusion</strong></td>
143<td>Float</td>
144<td>The final ambient occlusion output of the thread map.</td>
145</tr>
146<tr>
147<td><strong>Alpha</strong></td>
148<td>Float</td>
149<td>The final alpha output of the thread map. Shader Graph calculates this alpha value by multiplying the input <strong>Alpha</strong> value by the <strong>Thread AO Strength</strong> value.</td>
150</tr>
151</tbody>
152</table>
153
154
155## Example graph usage
156
157For an example use of the ThreadMapDetail node, see either of the HDRP's Fabric shaders.
158
159To view these Shader Graphs:
160
1611. Create a new material and assign it the **HDRP** > **Fabric** > **Silk** or **HDRP** > **Fabric** > **CottonWool** shader, as described in the Unity User Manual section [Creating a material asset, and assigning a shader to it](https://docs.unity3d.com/Documentation/Manual/materials-introduction.html).
162
1632. Next to the **Shader** dropdown, select **Edit**.
164
165Your chosen Fabric's Shader Graph opens. You can view the ThreadMapDetail node, its Subgraph, and the other nodes that create HDRP's Fabric shaders.