Interactive Hair Rendering and Appearance Editing
under Environment Lighting
Kun Xu1, Li-Qian Ma1, Bo Ren1, Rui Wang2, Shi-Min Hu1
1Tsinghua University2University of Massachusetts
Hair Appearance Editing under Environment Lighting
β’ Motivationβ’ hair appearance editingβ’ Natural illumination
β’ Challengesβ’ Light integration complexity
Related Works
β’ Hair scattering function/models
β’ Self Shadowingβ’ deep shadow maps [Lokovic & Veach 2000]β’ opacity shadow maps [Kim & Neumann 2001]β’ density clustering [Mertens et al. 2004]β’ deep opacity maps [Yuksel & Keyser 2008]β’ occupancy maps [Sintorn & Assarson 2009]
[Kajiya & Kay 89] [Marschner 03] [Zinke & Webber 07] [Sadeghi 10] [dβEon 11]
Related Works
β’ Multiple scatteringβ’ Photon Mapping [Moon & Marschner 2006]β’ Spherical Harmonics [Moon et al. 2008]β’ Dual Scattering [Zinke et al. 2008]
β’ Environment lighting [Ren 2010]β’ Model lighting using SRBFsβ’ Precomputed light transport into
4D tablesβ’ Fix hair scattering properties
hair appearance editing under environment
lighting remains unsolved
Light Integration
πΏ (ππ )=π·β«Ξ©
β
πΏ (ππ )π (ππ )π(ππ ,ππ)cosπ π πππ
Single scattering
β’ : environment lightingβ’ : self shadowingβ’ : hair scattering function
Light Integration
πΏ (ππ )=π·β«Ξ©
β
πΏ (ππ )π (ππ )π(ππ ,ππ)cosπ π πππ
Single scattering
β’ Approximate by a set of SRBFs [Tsai and Shih 2006]
πΏ (ππ )βπ·β«Ξ©
β
(βπ π ππΊ π (ππ ))π (ππ )π (ππ ,ππ)cosπ πππππΏ (ππ )βπ·βππ πβ«Ξ©
β
πΊ π (ππ )π (ππ )π (ππ ,ππ ) cosππ ππ π
Light Integration
Single scattering
β’ Approximate by a set of SRBFs [Tsai and Shih 2006]
β’ Move T out from the integral [Ren 2010]
πΏ (ππ )βπ·βππ π~πβ«
Ξ©
β
πΊ π (ππ )π (ππ ,ππ )cosπ π ππππΏ (ππ )βπ·βππ πβ«Ξ©
β
πΊ π (ππ )π (ππ )π (ππ ,ππ ) cosππ ππ π
Problem: evaluate scattering Integral
Single ScatteringIntegral
β’ Previous Approach [Ren 2010]β’ Precompute the integral into 4D table
β’ Our key insight β’ Is there an approximated analytic solution? β’ YES
β’ Decompose SRBF into products of circular Gaussiansβ’ Approximate scattering function by circular Gaussians
β«Ξ©
β
πΊ π (ππ )π (ππ ,ππ ) cosπ ππππ
Circular Gaussian
β’ SRBF (Spherical Radial Basis Function)β’ Typically spherical Gaussianβ’ Widely used in rendering
β’ Environment lighting [Tsai and Shih 2006]
β’ Light Transport [Green 2007]
β’ BRDF [Wang 2009]
β’ Circular Gaussian β’ 1D case of SRBF β’ Share all benefits of SRBFs
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
Circular Gaussian
ππ (π₯ ;π’ , π )=π2 [cos (π₯βπ’)β1]
π2
bandwidthcenter
β’ Useful Propertiesβ’ Local approximation by Gaussian
, error < 1.3%,
β’ Closed on product
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
Circular Gaussianβ’ SRBF Decomposition
1D Longitudinalcircular Gaussian
1D Azimuthalcircular Gaussian
= *
ΒΏππ (π π ;π π , π π ) β ππ (ππ ;π π ,π π /βcosπππππ π π )
2D SRBF
Scattering Function
β’ Sum of three modes: R, TT, TRT [Marschner03]
hair fiber longitudinal
angle
R mode: Reflection
(p=0)
TT Mode:Transmission-Transmission
(p=1)
TRT Mode:Transmission-Reflection-
Transmission (p=2)
tilted angle
Scattering Function
β’ Sum of three modes: R, TT, TRT [Marschner03]
hair fiber cross section azimuthal angle
R mode: Reflection
(p=0)
TT Mode:Transmission-Transmission
(p=1)
TRT Mode:Transmission-Reflection-
Transmission (p=2)
Scattering Function
β’ Definition [Marschner03]
Scattering Function
β’ Definition [Marschner03]
β’ Longitudinal function : normalized Gaussian
simulates specular reflection along longitudinal direction
Scattering Function
β’ Definition [Marschner03]
β’ Azimuthal function β’ Complex analytic functionsβ’ Different for each mode
β Fresnel reflection termβ exponential attenuation term
Azimuthal Functions
β’ R mode
β’ Fresnel term (Schlickβs approximation)
β’ Approximated by polynomial of
Azimuthal Functions
β’ TT mode
β’ Simple shape: look like Gaussianβ’ approximated by 1 circular Gaussian centered at
β’ Parameters fitted by preserving energy
ππ=0 ππ=π6 ππ=
π3
TT mode approximation
β’ : coefficient β’ set as the peak value,
β’ : bandwidthβ’ Preserving energy
π ππ (π )βπππππ (π ;π ,πππ)
β« πππ (π )ππΒΏ12 β« (1βF (π ,ππ , h ))2π (π π
β² , h )π hβ’ : fresnel reflectionβ’ : attenuation function
TT mode approximation
β’ : coefficient β’ set as the peak value,
β’ : bandwidthβ’ Preserving energy
π ππ (π )βπππππ (π ;π ,πππ)
β« πππ (π )ππΒΏ12 β« (1βF (π ,ππ , h ))2π (π π
β² , h )π hβ’ : fresnel reflectionβ’ : attenuation function 4-th order Taylor expansion
ΒΏ12 β« (1βF (π ,ππ , h ))2( β
π=0,2,4ππ (ππ ,ππ )hπ)π hΒΏ
12 βπ=0,2,4
ππ (ππ ,ππ )β« (1βF (π ,ππ , h ))2hπ hπ
Precompute into 2D tables
Azimuthal Functionsβ’ TRT mode:
β’ Shape: sum of Circular Gaussians β’ : approximated by 3 circular Gaussiansβ’ approximated by 1 circular Gaussian
β’ Fitted by preserving energy similar as TT mode
ππ=0 ππ=π6 ππ=
π3
Single ScatteringIntegral
β’ =: SRBF decompositionβ’ : scattering func. def.
Circular Gaussian
Circular Gaussian Gaussian Cosine /
Circular Gaussian
Analytic Integral
Light Integration
Multiple scattering
πΏ (ππ )βπ·βππ ππ πβ«
Ξ©
β
Ο (β )ππ· (ππ ,ππ ) cosπ π πππ[Ren 2010]
β’ Spread function: β’ BCSDF: [Zinke 2010]
β’ Approximate scattering function similarly
Analytic Integral
Results
Results
Results
Performance
hair model #fibers #segments FPSanimation 10K 270K 8.3ponytail 6K 100K 8.9natural 10K 1.6M 4.8
β’ Testing Machineβ’ Intel Core 2 Duo 3.00 GHz CPU, 6 GB RAM NVIDIA
GTX 580β’ 720 * 480 with 8x antialias
Conclusion
β’ 1D circular Gaussianβ’ Accurate and compact for representing hair
scattering functionsβ’ Closed form integral with SRBF lights
β’ New effects β’ interactive hair appearance editing under
environment lighting β’ Rendering of spatially varying hair scattering
parameters under environment lighting
Future works
β’ View transparency effects [Sintorn and Assarsson 2009]
β’ Other hair scattering modelsβ’ Artist friendly model [Sadeghi 2010]
β’ Energy conserving model [dβEon 2011]
β’ Near-field light sourcesβ’ Accelerate off-line hair rendering
Acknowledgement
β’ Anonymous Siggraph and Siggraph Asia reviewers β’ Ronald Fedkiw, Cem Yuksel, Arno Zinke, Steve
Marschner β’ Sharing their hair data
β’ Zhong Renβ’ Useful discussion
Thank you for your attention.
Circular Gaussian vs Gaussianβ’ 1D Circular Gaussian
β’ Defined on unit circle :
β’ 1D Gaussian β’ Defined on x-axis
Single ScatteringIntegral
N π (β )=β«β
β
π π‘ (ππβππ )ππ (π π )ππ π
β’ =: SRBF seperationβ’ : scattering func. def.β’ Two dimensional integral over and
ΒΏββ«ππ
β
ππ (ππ)π π‘ (πh )cos2ππ
cos2ππNπ (β )πππ Outer integral
inner integral:
Inner Integral R Modeβ’ Hair scattering function approx.
β’ polynomial of : β’ Inner integral
Precompute into 2D tables
Inner IntegralTT & TRT modesβ’ Hair scattering function approx.
β’ sum of circular Gaussians : β’ Inner integral
Analytic Integral
N π (β )ββ ππβ«β
β
ππ(π πβππ ;ππ ,ππ)ππ (π π ;π π ,π π )πππ
Outer Integral
Piecewise Linear approximation
Smooth FunctionGaussian
Analytic Integral
Summary ofSingle Scattering β’ Hair scattering function approximation
β’ R mode: polynomial of cosine β’ TT/TRT mode: circular Gaussian
β’ Inner integralβ’ R mode: 2D tables β’ TT/TRT mode: 2D tables, analytic integral
β’ Outer integralβ’ Piecewise linear approximation for smooth func.β’ Analytic integral.