Interactive Hair Rendering Under Environment Lighting
Valentin JANIAUTZhong Ren, Kun Zhou, Tengfei Li, Wei Hua,
Baining Guo
2
Hair Rendering● Hair fiber represented with lines
primitives● Basic shading model is not realistic at
all.
Basic OpenGL illumination
Deep Opacity Map [YUK08]
1 fiber4 strands
3
Environment Lighting● Natural Illumination● No directional light
Environment LightingSingle Light
4
Spherical Function
How to represent a spherical function?
SRBF
5
Spherical Radial Basis Function● Useful to approximate spherical
function
€
f (θ ,ϕ ) ≈ c jj =1
N
∑ R(θ ,ϕ,ξ j ,λ j )
Spherical Coordinate of the
Spherical Function
Number of SRBF to use for the
approximation
Coefficient depending of the
problemSRBF with actually
5 parameters
Spherical Coordinate of the
center of the SRBF
Bandwidth of the center of the SRBF
● Same idea than Fourier Series.
6
SRBF Light● A SRBF function can represent a light
in graphic rendering.
€
R j (ω i,ξ j ,λ j ) = L jG(ω i,ξ j ,λ j )Expression of the SRBF light j.
Intensity of the light j.
Gaussian distribution Result on the sphere
2D 3D
€
exp(−λ j ) × exp(λ j × (ω i • ξ j ))Gaussian distribution.
7
SRBF and Environment Lighting● We can now represent the
environment lighting as the sum of the SRBF lights, as following:
€
L(ω i) ≈ L jj =1
N
∑ G(ω i,ξ j ,λ j )
8
Outgoing Curved Intensity
€
L(ωo) = D L(ω i)T(ω i)Ω∫ S(ω i,ωo)cosθ idω i
Diameter of the hair fiber Environment Lighting Transmittance Bidirectional
scattering function
9
Transmittance or Absorbtance
Transmittance is the fraction of incident light that passes through a
sample.
€
T(x,ω i) = exp(−σ a ρ(x)dxx
∞ω∫ )
Attenuation coefficient. Density function:
• 1 if covered by hair fiber.• 0 otherwise
10
Bidirectional scattering function
● S(ωi,ωo) will be the bidirectional scattering function, similar to BRDF in surface reflectance.
● The scattering is the deviation of the straight trajectory of a ray light due to an obstacle.
● Kajiya and Kay model [1989]
€
S(ω i,ωo) = Kd + Kscosp (θ i +θ o)
cosθ i
11
Environment Lighting Approximation
● Remember SRBF? It’s time to use it.
€
L(ω i) ≈ L jj =1
N
∑ G(ω i,ξ j ,λ j )
€
L(ωo) = D L jj =1
N
∑ G j (ω i)T(ω i)Ω∫ S(ω i,ωo)cosθ idω i
12
Effective Transmittance● Last step of our simplification● Average attenuation of the SRBF
Lighting j.
€
˜ T (ξ j ,λ j ) =G j (ω i)T(ω i)Ω∫ S(ω i,ωo)cosθ idω i
G j (ω i)Ω∫ S(ω i,ωo)cosθ idω i
€
L(ωo) = D L jj =1
N
∑ ˜ T (ξ j ,λ j ) G j (ω i)Ω∫ S(ω i,ωo)cosθ idω i
● How to compute this equation?
13
Splitting the equation
€
L(ωo) = D L jj =1
N
∑ ˜ T (ξ j ,λ j ) G j (ω i)Ω∫ S(ω i,ωo)cosθ idω i
€
˜ T (ξ j ,λ j )
€
G j (ω i)Ω∫ S(ω i,ωo)cosθ idω i
Transmittance Convolution of SRBF and scattering function.
€
I(ωo,ξ,λ )
14
€
G j (ω i)Ω∫ S(ω i,ωo)cosθ idω i
Convolving SRBF and Scattering Function
● Marschner et al. model [2003]
€
S(ω i,ωo) = M t (θ h )N t (θ d ,φ)t
∑
€
θh =(θ i +θ o)
2;
θ d =(θ i −θ o)
2;
φ = φo + φi
With:
€
IM (cosθξ ,cosθ o,cos(φξ − φo), 1λ )
cos(ϕξ-ϕo)
15
Computing Effective Transmittance
€
L(ωo) = D L jj =1
N
∑ ˜ T (ξ j ,λ j ) G j (ω i)Ω∫ S(ω i,ωo)cosθ idω i
Precomputed in a table• Sampled at the SRBF center
• Use of the Deep Opacity Map technique
16
Self-shadowing
Opacity Shadow Map Deep Opacity Map
17
Deep Opacity Map
z
T
z1 z2 z3
Compute the optical depth
Zo
Z1
Z2
Z3
18
Multiple Scattering
€
LD (ω o) = D L j (ξ j )Tfj =1
N
∑ (ξ j ) ψ f (ξ j ,ω i,σ f )Ω∫ SD (ω i,ωo)cosθ idω i
€
Tf (ξ j )
€
ψ f (ξ j ,ω i,σ f )Ω∫ SD (ω i,ωo)cosθ idω i
Transmittance Convolution of SRBF and scattering function.
€
IG (ωo,ξ,σ f )
● More realistic model.
19
Multiple Scattering Computation● Voxelize Hair Model
● For each voxel store:● ϖ : Average Fiber
Direction● ν : Standard Deviation of
fiber direction● ςt
Τ : Perpendicular Attenuation Coefficient
● Sample Tf and σf on a rough grid
● Store as 3D texture● Hardware tri-linear
interpolation
20
Algorithm OverviewSingle Scattering● Precompute
● SRBF decomposition
● Single Scattering integration table
● Runtime● Generate Deep
Opacity Depth Map (DODM)
● Construct the Summed Area Table
● Sample the effective transmittance
● Sample the single scattering integral
21
Results
hair model #fibers #segments
FPSSingle
scatteringanimation 10K 270K 16.2
straight 10K 160K 17.8
ponytail 20K 900K 11.1
curly 50K 3.4M 2.30
wavy 10K 687K 12.3
natural 10K 1.6M 9.20
22
Limitations● Runtime change of hair properties
● precomputation is costly (~50 minutes)● Eccentricity of hair scattering is
omitted● Additional video memory for the
integral tables● 12MB for single scattering● 24MB for single + multiple scattering● no per-fiber hair property
23
References● http://www.kunzhou.net/ (Author of
the main paper, some of his slides are used in this slideshow)
● http://www.cemyuksel.com/ (Author of the Deep Opacity Maps and numerous other paper about hair rendering)
● Illustration on slide 10 comes from wikipedia.
● http://www.cse.cuhk.edu.hk/~ttwong/papers/srbf/srbf.html Lecture about SRBF.
24
Q/A