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: