Understand fabrics
Cotton/Wool shader
The Cotton/Wool shader is your starting point for rendering diffuse fabrics in the High Definition Render Pipeline (HDRP). You can use the Cotton/Wool shader to create fabrics like cotton, wool, linen, or velvet.
The type of fibers that make up the fabric, as well as the fabric's knit or weave, influence the appearance of the fabric. Natural fibers are typically rougher so they diffuse light.
The Cotton/Wool shader is a pre-configured Shader Graph. To learn more about the Cotton/Wool shader implementation, or to create your own Fabric shader variant, see the Shader Graph documentation about the Fabric Master Stack.
Refer to Create a fabric material for more information.
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.
Refer to Create a fabric material for more information.
Fabric Shader Graph
The Fabric Master Stack enables you to render various types of fabric in the High Definition Render Pipeline (HDRP). It uses either cotton wool or anisotropic silk as its base, and supports various additional effects such as Subsurface Scattering to create realistic looking fabrics.
Refer to Create a fabric material for more information.
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.