Hair Rendering

By "Equation (5.9)" of PBR Book, we have the reflectance equation L o ( ω o ) = Ω f ( ω i , ω o ) L i ( ω i ) ( cos θ i ) + d ω i \displaystyle \operatorname{L_o}(\overrightarrow{\omega_o}) = \int_\Omega \operatorname{f}(\overrightarrow{\omega_i}, \overrightarrow{\omega_o}) \operatorname{L_i}(\overrightarrow{\omega_i}) (\cos \theta_i)^+ \, d \overrightarrow{\omega_i} .

HairMaterial in PBRT-V3

HairShading in UE4

EvaluateBSDF in Unity3D

PxrMarschnerHair in RenderMan

Micro-Cylinder Models

The name micro-cylinder models is from "9.10.3 Micro-Cylinder Cloth Models" of Real-Time Rendering Fourth Edition.

By [Kajiya 1998], at any given position of the cylinder, there are infinite number of normals which point in all directions perpendicular to the tangent.

Let t \displaystyle \overrightarrow{t} be the tangent, ω i \displaystyle \overrightarrow{{\omega_i}^{\perp}} be the (normalized) projection of the incident direction ω i \displaystyle \overrightarrow{\omega_i} onto the plane perpendicular to the tangent, and b = ω i × t \displaystyle \overrightarrow{b} = \overrightarrow{{\omega_i}^{\perp}} \times \overrightarrow{t} be the bitangent.

Let ϕ \displaystyle \phi be the azimuth, and n ( ϕ ) = ω i sin ϕ + b cos ϕ \displaystyle \operatorname{\overrightarrow{n}}(\phi) = \overrightarrow{{\omega_i}^{\perp}} \sin \phi + \overrightarrow{b} \cos \phi be the normal points in one direction perpendicular to the tangent.

By [Kajiya 1998], the ( cos θ i ) + \displaystyle (\cos \theta_i)^+ is no longer calculated as max ( 0 , n ω i ) \displaystyle \max (0, \overrightarrow{n} \cdot \overrightarrow{\omega_i}) , but as the integral along the circumference of the cylinder intead. This means that ( cos θ i ) + = 0 π n ( ϕ ) ω i d ϕ = 0 π ( ω i sin ϕ + b cos ϕ ) ω i d ϕ = ω i ω i 0 π sin ϕ d ϕ = ω i ω i = sin ( t , ω i ) = 1 ( t ω i ) 2 \displaystyle (\cos \theta_i)^+ = \int_0^\pi \operatorname{\overrightarrow{n}}(\phi) \cdot \overrightarrow{\omega_i} \, d \phi = \int_0^\pi (\overrightarrow{{\omega_i}^{\perp}} \sin \phi + \overrightarrow{b} \cos \phi) \cdot \overrightarrow{\omega_i} \, d \phi = \overrightarrow{{\omega_i}^{\perp}} \cdot \overrightarrow{\omega_i} \int_0^\pi \sin \phi \, d \phi = \overrightarrow{{\omega_i}^{\perp}} \cdot \overrightarrow{\omega_i} = \sin(\overrightarrow{t}, \overrightarrow{\omega_i}) = 1 - {(\overrightarrow{t} \cdot \overrightarrow{\omega_i})}^2 . The ( cos θ i ) + \displaystyle (\cos \theta_i)^+ is calculated by FakeNormal in UE4 and _USE_LIGHT_FACING_NORMAL in Unity3D.

Let reflect ( ω i ) \displaystyle \operatorname{reflect}(\overrightarrow{\omega_i}) be the reflected direction of the incident direction, and ω o \displaystyle \overrightarrow{\omega_o} be the outgoing direction.

By [Kajiya 1998], the half-angle vector ω h \overrightarrow{\omega_h} should be independent of the azimuth ϕ \displaystyle \phi . This means that the incident direction ω i \displaystyle \overrightarrow{\omega_i} is rotated about the tangent t \displaystyle \overrightarrow{t} to make sure that the incident direction ω i \displaystyle \overrightarrow{\omega_i} , the reflected direction reflect ( ω i ) \displaystyle \operatorname{reflect}(\overrightarrow{\omega_i}) , and the outgoing direction ω o \displaystyle \overrightarrow{\omega_o} are coplanar before the half-angle vector is calculated.

References

[Kajiya 1998] James Kajiya, Timothy Kay. "Rendering Fur with Three Dimensional Textures." SIGGRAPH 1998.
[Marschner 2003] Stephen Marschner, Henrik Jensen, Mike Cammarano. "Light Scattering from Human Hair Fibers." SIGGRAPH 2003.
[Scheuermann 2004] Thorsten Scheuermann. "Practical Real-Time Hair Rendering and Shading." SIGGRAPH 2004.
[Nguyen 2005] Hubert Nguyen, William Donnelly. "Hair Animation and Rendering in the Nalu Demo." GPU Gems 2.
[Yuksel 2010] Cem Yuksel, Sarah Tariq. "Advanced Techniques in Real-time Hair Rendering and Simulation." SIGGRAPH 2010.
[Pekelis 2015] Leonid Pekelis, Christophe Hery, Ryusuke Villemin, Junyi Ling. "A Data-Driven Light Scattering Model for Hair." Pixar Technical Memo 2015.
[Pharr 2016] Matt Pharr. "The Implementation of a Hair Scattering Model." PBRT V3.
[Karis 2016] Brian Karis. "Physically Based Hair Shading in Unreal." SIGGRAPH 2016.
[Hery 2017] Christophe Hery, Junyi Ling. "Pixar's Foundation for Materials: PxrSurface and PxrMarschnerHair." SIGGRAPH 2017.