148 lines
6.1 KiB
Markdown
148 lines
6.1 KiB
Markdown
# Hair
|
|
|
|
The Hair Master Stack enables you to render hair and fur in the High Definition Render Pipeline (HDRP). To create a realistic looking hair effect, it uses layers called hair cards. Each hair card represents a different section of hair. If you use semi-transparent hair cards, you must manually sort them so that they are in back-to-front order from every viewing direction.
|
|
|
|

|
|
|
|
## Creating a Hair Shader Graph
|
|
|
|
To create a Hair material in Shader Graph, you can either:
|
|
|
|
* Modify an existing Shader Graph.
|
|
1. Open the Shader Graph in the Shader Editor.
|
|
2. In **Graph Settings**, select the **HDRP** Target. If there isn't one, go to **Active Targets,** click the **Plus** button, and select **HDRP**.
|
|
3. In the **Material** drop-down, select **Hair**.
|
|
|
|
* Create a new Shader Graph.
|
|
1. Go to **Assets > Create >Shader Graph > HDRP** and click **Hair Shader Graph**.
|
|
|
|
## Contexts
|
|
|
|
[!include[](snippets/master-stacks-contexts-intro.md)]
|
|
|
|
### Vertex Context
|
|
|
|
#### Default
|
|
|
|
When you create a new Hair Master Stack, the Vertex Context contains the following Blocks by default:
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
<th>Setting Dependency</th>
|
|
<th>Default Value</th>
|
|
</tr>
|
|
[!include[](snippets/shader-graph-blocks/vertex-position.md)]
|
|
[!include[](snippets/shader-graph-blocks/vertex-normal.md)]
|
|
[!include[](snippets/shader-graph-blocks/vertex-tangent.md)]
|
|
</table>
|
|
|
|
#### Relevant
|
|
|
|
This Master Stack material type adds all its Vertex Blocks to the Vertex Context by default and has no extra relevant Blocks.
|
|
|
|
### Fragment Context
|
|
|
|
#### Default
|
|
|
|
When you create a new Hair Master Stack, the Fragment Context contains the following Blocks by default:
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
<th>Setting Dependency</th>
|
|
<th>Default Value</th>
|
|
</tr>
|
|
[!include[](snippets/shader-graph-blocks/base-color.md)]
|
|
[!include[](snippets/shader-graph-blocks/normal-tangent-space.md)]
|
|
[!include[](snippets/shader-graph-blocks/bent-normal.md)]
|
|
[!include[](snippets/shader-graph-blocks/hair-strand-direction.md)]
|
|
[!include[](snippets/shader-graph-blocks/transmittance.md)]
|
|
[!include[](snippets/shader-graph-blocks/rim-transmission-intensity.md)]
|
|
[!include[](snippets/shader-graph-blocks/smoothness.md)]
|
|
[!include[](snippets/shader-graph-blocks/ambient-occlusion.md)]
|
|
[!include[](snippets/shader-graph-blocks/alpha.md)]
|
|
[!include[](snippets/shader-graph-blocks/specular-tint.md)]
|
|
[!include[](snippets/shader-graph-blocks/specular-shift.md)]
|
|
[!include[](snippets/shader-graph-blocks/secondary-specular-tint.md)]
|
|
[!include[](snippets/shader-graph-blocks/secondary-specular-shift.md)]
|
|
[!include[](snippets/shader-graph-blocks/emission.md)]
|
|
</table>
|
|
|
|
#### Relevant
|
|
|
|
Depending on the [Graph Settings](#graph-settings) you use, Shader Graph can add the following locks to the Fragment Context:
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
<th>Setting Dependency</th>
|
|
<th>Default Value</th>
|
|
</tr>
|
|
[!include[](snippets/shader-graph-blocks/alpha-clip-threshold.md)]
|
|
[!include[](snippets/shader-graph-blocks/alpha-clip-threshold-depth-postpass.md)]
|
|
[!include[](snippets/shader-graph-blocks/alpha-clip-threshold-depth-prepass.md)]
|
|
[!include[](snippets/shader-graph-blocks/alpha-clip-threshold-shadow.md)]
|
|
[!include[](snippets/shader-graph-blocks/baked-back-gi.md)]
|
|
[!include[](snippets/shader-graph-blocks/baked-gi.md)]
|
|
[!include[](snippets/shader-graph-blocks/depth-offset.md)]
|
|
[!include[](snippets/shader-graph-blocks/normal-object-space.md)]
|
|
[!include[](snippets/shader-graph-blocks/normal-world-space.md)]
|
|
[!include[](snippets/shader-graph-blocks/specular-aa-screen-space-variance.md)]
|
|
[!include[](snippets/shader-graph-blocks/specular-aa-threshold.md)]
|
|
[!include[](snippets/shader-graph-blocks/specular-occlusion.md)]
|
|
</table>
|
|
|
|
## Graph Settings
|
|
|
|
### Surface Options
|
|
<table>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
[!include[](snippets/shader-properties/surface-options/surface-type.md)]
|
|
[!include[](snippets/shader-properties/surface-options/rendering-pass.md)]
|
|
[!include[](snippets/shader-properties/surface-options/blending-mode.md)]
|
|
[!include[](snippets/shader-properties/surface-options/receive-fog.md)]
|
|
[!include[](snippets/shader-properties/surface-options/depth-test.md)]
|
|
[!include[](snippets/shader-properties/surface-options/depth-write.md)]
|
|
[!include[](snippets/shader-properties/surface-options/cull-mode.md)]
|
|
[!include[](snippets/shader-properties/surface-options/sorting-priority.md)]
|
|
[!include[](snippets/shader-properties/surface-options/back-then-front-rendering.md)]
|
|
[!include[](snippets/shader-properties/surface-options/transparent-depth-prepass.md)]
|
|
[!include[](snippets/shader-properties/surface-options/transparent-depth-postpass.md)]
|
|
[!include[](snippets/shader-properties/surface-options/transparent-writes-motion-vectors.md)]
|
|
[!include[](snippets/shader-properties/surface-options/preserve-specular-lighting.md)]
|
|
[!include[](snippets/shader-properties/surface-options/alpha-clipping.md)]
|
|
[!include[](snippets/shader-properties/surface-options/use-shadow-threshold.md)]
|
|
[!include[](snippets/shader-properties/surface-options/alpha-to-mask.md)]
|
|
[!include[](snippets/shader-properties/surface-options/double-sided-mode.md)]
|
|
[!include[](snippets/shader-properties/surface-options/fragment-normal-space.md)]
|
|
[!include[](snippets/shader-properties/surface-options/receive-decals.md)]
|
|
[!include[](snippets/shader-properties/surface-options/receive-ssr.md)]
|
|
[!include[](snippets/shader-properties/surface-options/receive-ssr-transparent.md)]
|
|
[!include[](snippets/shader-properties/surface-options/geometric-specular-aa.md)]
|
|
[!include[](snippets/shader-properties/surface-options/ss-depth-offset.md)]
|
|
</table>
|
|
|
|
### Advanced Options
|
|
<table>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
[!include[](snippets/shader-properties/advanced-options/specular-occlusion-mode.md)]
|
|
[!include[](snippets/shader-properties/advanced-options/override-baked-gi.md)]
|
|
[!include[](snippets/shader-properties/advanced-options/support-lod-crossfade.md)]
|
|
[!include[](snippets/shader-properties/advanced-options/add-precomputed-velocity.md)]
|
|
[!include[](snippets/shader-properties/advanced-options/use-light-facing-normal.md)]
|
|
</table>
|
|
|
|
## Limitations
|
|
|
|
[!include[](snippets/area-light-material-support-disclaimer.md)]
|