Silk shader
The Silk shader is your starting point for rendering anisotropic fabrics in the High Definition Render Pipeline (HDRP). You can use the Silk shader to create fabrics like silk, satin, nylon, and polyester. Silk and other synthetic fibers are usually smoother than natural fibres because they're produced as a single smooth filament. When these fibres are woven together, it produces a fabric with anisotropic specular highlights.
The Silk shader is a pre-configured Shader Graph. To learn more about the Silk shader implementation, or to create your own Silk shader variant, see the Shader Graph documentation about the Fabric Master Stack.
Importing the Silk Fabric Sample
The High Definition Render Pipeline (HDRP) also comes with Silk Material samples to further help you get started. To find this Sample:
- Go to Windows > Package Manager, and select High Definition RP from the package list.
- In the main window that shows the package's details, find the Samples section.
- To import a Sample into your Project, click the Import into Project button. This creates a Samples folder in your Project and imports the Sample you selected into it. This is also where Unity imports any future Samples into.
- In the Asset window, go to Samples > High Definition RP > 11.0 and open the Fabric scene. Here you can see the silk sample material set up in-context in the scene, and available for you to use.
Creating a Silk Material
New Materials in HDRP use the Lit shader by default. To create a Silk Material from scratch, create a Material and then make it use the Silk shader. To do this:
In the Unity Editor, navigate to your Project's Asset window.
Right-click the Asset Window and select Create > Material. This adds a new Material to your Unity Project’s Asset folder.
Click the Shader drop-down at the top of the Material Inspector, and select HDRP > Fabric > Silk.
Thread maps
The Fabric shaders can use a thread map for the high-frequency details that fabrics exhibit. This is similar to the detail map found in HDRP's Lit shaders. The Thread Map input is channel-packed to optimise memory and is arranged in a way to optimise precision for the normal map. The Fabric Material Sample includes some pre-authored Thread Maps for you.
The format of the thread map texture:
- Red: Ambient Occlusion
- Green & Alpha: Normals.
- Blue: Smoothness.
Under the hood, the fabric shaders apply thread maps using a SubGraph Operator. To learn more about the thread map implementation, or to use it yourself:
- In the Unity Editor, open a Shader Graph asset’s Shader Editor.
- Right-click anywhere in the graph view, and select Create Node.
- Navigate to Utility > High Definition Render Pipeline > Fabric > Thread Map Detail and select. This adds the Thread Map operator into your graph.
Fuzz Maps
The fabric shaders can use a fuzz map to provide additional fuzz detail to the surface. A fuzz map is a single-channel texture. To apply it, the fabric shader mixes it in with the base color map to produce a final color used for shading the fabric material.
Properties
Surface Options
Surface Options control the overall look of your Material's surface and how Unity renders the Material on screen.
[!include[](surface-type.md)] [!include[](rendering-pass.md)] [!include[](blending-mode.md)] [!include[](preserve-specular-lighting.md)] [!include[](sorting-priority.md)] [!include[](receive-fog.md)] [!include[](back-then-front-rendering.md)] [!include[](transparent-depth-prepass.md)] [!include[](transparent-depth-postpass.md)] [!include[](transparent-writes-motion-vectors.md)] [!include[](depth-write.md)] [!include[](depth-test.md)] [!include[](cull-mode.md)] [!include[](alpha-clipping.md)] [!include[](alpha-clipping-threshold.md)] [!include[](use-shadow-threshold.md)] [!include[](shadow-threshold.md)] [!include[](alpha-to-mask.md)] [!include[](prepass-threshold.md)] [!include[](postpass-threshold.md)] [!include[](double-sided.md)] [!include[](normal-mode.md)] [!include[](double-sided-GI.md)] [!include[](material-type.md)] [!include[](transmission.md)] [!include[](receive-decals.md)] [!include[](receive-ssr.md)] [!include[](receive-ssr-transparent.md)] [!include[](geometric-specular-aa.md)] [!include[](screen-space-variance.md)] [!include[](gsaa-threshold.md)] [!include[](displacement-mode.md)] [!include[](lock-with-object-scale.md)] [!include[](lock-with-height-map-tiling-rate.md)] [!include[](displacement-minimum-steps.md)] [!include[](displacement-maximum-steps.md)] [!include[](displacement-fading-mip-start.md)] [!include[](displacement-primitive-length.md)] [!include[](displacement-primitive-width.md)] [!include[](displacement-depth-offset.md)]Property | Description |
---|
Exposed Properties
Property | Description |
---|---|
Base UV Mask | Set the Base UV channel, by typing "1" in the column that corresponds to the channel desired and 0 in the others. |
Base UV Scale Transform | Sets the tiling rate (xy) and offsets (zw) for the base UV. |
Base Color Map | Assign a Texture that controls the base color of your material. |
Base Color | Set the color of the Material. If you don't assign a Texture, this is the absolute color of the Material. If you do assign a Texture, the final color of the Material is a combination of the Texture you assign and the color you select. The alpha value of the color controls the transparency level for the Material if you select Transparent from the Surface Type drop-down. |
Mask Map AO(G) S(A) | Assign a channel-packed Texture with the following Material maps in its RGBA channels. • Green: Stores the ambient occlusion map. • Alpha: Stores the smoothness map. For more information on channel-packed Textures and the mask map, see mask map. |
Smoothness Min | Sets the minimum smoothness of your Material. |
Smoothness Max | Sets the maximum smoothness of your Material. |
Specular Color | Sets the color of the specular highlight. |
Normal Map | Assign a Texture that defines the normal map for this Material in tangent space. |
Normal Map Strength | Modulates the normal intensity between 0 and 8. |
Use Thread Map | Set whether the thread map details will be applied to your Material. |
Thread Map AO(R) Ny(G) S(B) Nx(A) | Assign a Texture that defines parameters for fabric thread, with the following maps in its RGBA channels. • Red: Stores the ambient occlusion map.• Green: Stores the normal’s Y component.• Blue: Stores the smoothness map.• Alpha: Stores the normal’s X component. For more information on channel-packed Textures and the mask map, see mask map. |
Thread UV Mask | Set the Thread UV channel, by typing "1" in the column that corresponds to the channel desired and 0 in the others. |
Thread UV Scale Transform | Sets the tiling rate (xy) and offsets (zw) for the thread UV. |
Thread AO Strength | Modifies the strength of the AO stored in the Thread Map. |
Thread Normal Strength | Modifies the strength of the Normal stored in the Thread Map. |
Thread Smoothness Scale | Modifies the scale of the Smoothness stored in the Thread Map. |
Fuzz Map | Assign a Texture that adds fuzz detail to the Base Color of your Material. |
Fuzz Map UV Scale | Sets the scale of the Thread UV used to sample the Fuzz Map. |
Fuzz Strength | Sets the strength of the Fuzz Color added to the Base Color. |
Diffusion Profile | Sets the Diffusion Profile, controlling the Subsurface Scattering properties of your Material. |
Advanced Options
[!include[](enable-gpu-instancing.md)] [!include[](baked-emission.md)] [!include[](motion-vector-for-vertex-animation.md)] [!include[](add-precomputed-velocity.md)]Property | Description |
---|