Introduction Hair Geometry Hair Shading
Introduction 4,095 individual hairs 123,000 vertices (just for the hair rendering)
Hair Geometry
Data Flow
Tessellation
Interpolation Barycentric coefficients: b A + b B + b C = 1 Interpolated hair Y : Y = A x b A + B x b B + C x b C
Interpolation
The Effect of Tessellation and Interpolation
Modulate density across scalp
Curly Hair
Hair Shading a local reflectance model for hair a method for computing self-shadowing between hairs
A Real-Time Reflectance Model for Hair The Marschner Reflectance Model S(f i, q i ; f o, q o ) S = S R + S TT + S TRT S p = M p (q i, q o ) x N p (q d, f d ) for P = R, TT, TRT q d = ½(q i – q o ), f d = f i – f o
Lookup Textures for the Marschner Hair Reflectance Model
Reflectance
Pseudocode Summarizing the Shaders // In the Vertex Shader: SinThetaI = dot(light, tangent) ; SinThetaO = dot(eye, tangent) ; LightPerp = light – SinThetaI * tangent ; eyePerp = eye – SinThetaO * tangent ; CosPhiD = dot(eyePerp, lightPerp) * (dot(eyePerp, eyePerp) * dot(lightPerp, lightPerp))^-0.5 // In the Fragment Shader: (MR, MTT, MTRT, cosThetaD) = lookup1(cosThetaI, cosThetaO) (NTT, NR) = lookup2(CosPhiD, cosThetaD) NTRT = lookup3(CosPhiD, cosThetaD) S = MR * NR + MTT * NTT + MTRT * NTRT
Real-Time Volumetric Shadows in Hair Stencil Shadow Volumes Shadow Maps Opacity Shadow Maps !
Opacity Shadow Maps - T(x, y, z) is the fraction of light penetrating to depth z - σ is called the opacity thickness - r(x, y, z) is the extinction coefficient
Opacity Shadow Maps where z i < z < z i+1. To compute σ at a discrete set of z values z 0... z n-1 - n = 16 - z 0 being the near plane of the hair in light space - z 15 being the far plane of the hair in light space - z i = z 0 + i dz, dz = (z 15 – z 0 )/16
Opacity Shadow Maps
Results
Q & A