Fabric Shading with Unity URP
C#, HLSL, Shader Graph, Substance Designer
To give artists the flexibility to create various types of fiber while using different pipeline standards, we created this Shader-Graph-based fabric shading solution. While shading fibers in a physically based manner, we guaranteed that artists can use shader graphs to process their inputs. For instance, artists can choose the sources as the normal input–from normal maps, thread maps, or detail maps. We created the master node with two types of BRDF for silk-like and cotton-like fibers. Also, we implemented the commonly used features for fabric shading–translucency, anisotropic specular, and an extended two-sided rendering option. I was responsible to build the Shader Graph nodes to support artists’ work. I was responsible for the C# and HLSL coding, BRDFs research, Shader Graph nodes creation, and Demo creation using Substance Designer.

Cotton Shading
For common cotton shading, we highlighted the following featured based on observations from reality:
Soft specular lobe with large smooth falloffs.
Fuzz on the rim from asperity scattering.
Low specular contribution at front facing angles.
One extreme example is Velvet:

Silk Shading
Silk-like fibers feature anisotropic specular highlights and separate specular color that gives the material an iridescent look:


Translucency
We implemented translucency effect for thin fibers:

Shader Graph Master Node Extension
We extended the Shader Graph material type in URP. Added the “Fabric” option in the Graph Inspector, users can convert their Lit shader to our Fabric shader.

To better mimic the surface feature of fiber, we implemented two types of BRDF–“Cotton: for rough fibers and “Silk” for smooth fibers in general.

Two-sided rendering options were extended to support flipped-normal and mirrored-normal.

Shader Graph Workflow
We provided a general Shader Graph for artists to create their own fibers. By blending the details and patterns, artists can easily create differentiated types of material using a few input textures.

Decoding surface information from Threadmap:
