fast approximation to spherical harmonics rotation
DESCRIPTION
Computer. Graphics. Group. Fast Approximation to Spherical Harmonics Rotation. Jaroslav K řivánek Czech Technical University. Ja akko Konttinen University of Central Florida. Jiří Žára Czech Technical University. Sumanta Pattanaik University of Central Florida. Kadi Bouatouch - PowerPoint PPT PresentationTRANSCRIPT
Fast Approximation to Spherical Harmonics Rotation
Sumanta Pattanaik
University of Central Florida
Kadi Bouatouch
IRISA / INRIA Rennes
Jaroslav Křivánek
Czech Technical University
Jaakko Konttinen
University of Central Florida
Jiří Žára
Czech Technical University
ComputerGraphicsGroup
Jaroslav Křivánek – Fast Spherical Harmonics Rotation2/45
Presentation Topic Goal
Rotate a spherical function represented bySpherical Harmonics
Proposed method
Approximation through a truncated Taylor expansion
Jaroslav Křivánek – Fast Spherical Harmonics Rotation3/45
Spherical Harmonics Basis functions on the sphere
Jaroslav Křivánek – Fast Spherical Harmonics Rotation4/45
Spherical Harmonics
)(L 00c +
22c 1
2c 02c+ + +
12c 22c+
01c 11c+ + 11c +
Jaroslav Křivánek – Fast Spherical Harmonics Rotation5/45
Spherical Harmonics
Image Robin Green,Sony computer Entertainment
Jaroslav Křivánek – Fast Spherical Harmonics Rotation6/45
Spherical Harmonics
represented by a vector of coefficients:
Tnn
ml cccc 1
111
00][
1
0
)()(n
l
lm
lm
ml
ml YcL
Jaroslav Křivánek – Fast Spherical Harmonics Rotation7/45
Spherical Harmonics Basis functions on the sphere
l = 0
l = 1
l = 2
Jaroslav Křivánek – Fast Spherical Harmonics Rotation8/45
SH Rotation – Problem Definition
Given coefficients , representing a spherical
function
find coefficients for directly from coefficients .
Jaroslav Křivánek – Fast Spherical Harmonics Rotation9/45
Our Contribution Novel, fast, approximate rotation Based on a truncated Taylor Expansion of the
SH rotation matrix 4-6 times faster than [Kautz et al. 2002] O(n2) complexity instead of O(n3) Two applications
Global illumination (radiance interpolation) Real-time shading (normal mapping)
Jaroslav Křivánek – Fast Spherical Harmonics Rotation10/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusions
Jaroslav Křivánek – Fast Spherical Harmonics Rotation11/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusions
Jaroslav Křivánek – Fast Spherical Harmonics Rotation12/45
SH Rotation – Problem Definition
Given coefficients , representing a spherical
function
find coefficients for directly from coefficients .
Jaroslav Křivánek – Fast Spherical Harmonics Rotation13/45
SH Rotation Matrix
Rotation = linear transformation: R0R
1R
2R
0l 1l 2l 3l
Jaroslav Křivánek – Fast Spherical Harmonics Rotation14/45
SH Rotation
Given the desired 3D rotation, find the matrix R
R
Jaroslav Křivánek – Fast Spherical Harmonics Rotation15/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusions
Jaroslav Křivánek – Fast Spherical Harmonics Rotation16/45
Previous Work – Molecular Chemistry
[Ivanic and Ruedenberg 1996] Recurrent relations: Rl = f(R1,Rl-1)
[Choi et al. 1999] Through complex spherical harmonics Fast for complex harmonics Slow conversion to the real form
Jaroslav Křivánek – Fast Spherical Harmonics Rotation17/45
Previous Work – Computer Graphics
[Kautz et al. 2002] zxzxz-decomposition By far the fastest previous method
Jaroslav Křivánek – Fast Spherical Harmonics Rotation18/45
Previous Work – Summary
O(n3) complexity Slow Bottleneck in rendering applications
Jaroslav Křivánek – Fast Spherical Harmonics Rotation19/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusions
Jaroslav Křivánek – Fast Spherical Harmonics Rotation20/45
Our Rotation
Fast, approximate rotation
Based on replacing the SH rotation matrix by its Taylor expansion
4-6 times faster than [Kautz et al. 2002]
Jaroslav Křivánek – Fast Spherical Harmonics Rotation21/45
Rotation Decomposition
Decompose the 3D rotation into ZYZ Euler angles: R = RZ() RY() RZ()
Jaroslav Křivánek – Fast Spherical Harmonics Rotation22/45
Rotation Decomposition
R = RZ() RY() RZ()
Rotation around Z is simple and fast
Rotation around Y still a problem
Jaroslav Křivánek – Fast Spherical Harmonics Rotation23/45
Rotation Around Y
[Kautz et al. 2002] Decomposition of Y into X(+90˚), Z, and X(-
90˚) R = RZ() RX(+90˚) RZ() RX(-90˚) RZ()
Rotation around Z is simple and fast Rotation around X is fixed-angle
can be tabulated
The RXRZRX-part can still be improved…
Jaroslav Křivánek – Fast Spherical Harmonics Rotation24/45
Rotation Around Y – Our Approach
Second order truncated Taylor expansion of RY()
Jaroslav Křivánek – Fast Spherical Harmonics Rotation25/45
Taylor Expansion of RY()
)0(2
)0()(2
22
d
d
d
d yyy
RRIR
Jaroslav Křivánek – Fast Spherical Harmonics Rotation26/45
Rotation Procedure – Taylor Expansion
)0(2
)0()(2
22
d
d
d
d yyy
RRIR
Jaroslav Křivánek – Fast Spherical Harmonics Rotation27/45
Rotation Procedure – Taylor Expansion
)0(2
)0()(2
22
d
d
d
d yyy
RRIR
“1.5-th order Taylor expansion”
Very sparse matrix
Jaroslav Křivánek – Fast Spherical Harmonics Rotation28/45
Full Rotation Procedure
1. Decompose the 3D rotation into ZYZ Euler angles: R = RZ() RY() RZ()
2. Rotate around Z by
3. Use the “1.5-th order” Taylor expansion to rotate around Y by
4. Rotate around Z by
Jaroslav Křivánek – Fast Spherical Harmonics Rotation29/45
SH Rotation – Results L2 error for a
unit length input vector
Jaroslav Křivánek – Fast Spherical Harmonics Rotation30/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusion
Jaroslav Křivánek – Fast Spherical Harmonics Rotation31/45
Application in GI - Radiance Caching Sparse computation of indirect illumination Interpolation Enhanced with gradients
Jaroslav Křivánek – Fast Spherical Harmonics Rotation32/45
Incoming Radiance Interpolation
Interpolate coefficient vectors 1 and 2
p1
p2p
Jaroslav Křivánek – Fast Spherical Harmonics Rotation33/45
Interpolation on Curved Surfaces
Jaroslav Křivánek – Fast Spherical Harmonics Rotation34/45
Interpolation on Curved Surfaces Align coordinate frames in interpolation
p
p1
R
Jaroslav Křivánek – Fast Spherical Harmonics Rotation35/45
Results in Radiance Caching
Jaroslav Křivánek – Fast Spherical Harmonics Rotation36/45
Results in Radiance Caching
Jaroslav Křivánek – Fast Spherical Harmonics Rotation37/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusion
Jaroslav Křivánek – Fast Spherical Harmonics Rotation38/45
GPU-based Real-time Shading Original method by [Kautz et al. 2002]
Arbitrary BRDFs represented by SH in the local coordinate frame
Environment Lighting represented by SH in the global coordinate frame
Incident Radiance BRDF
= coeff. dot product( )Lout =
Jaroslav Křivánek – Fast Spherical Harmonics Rotation39/45
GPU-based Real-time Shading (contd.)
must be rotated from global to local frame
zxzxz - rotation too complicated on CPU
Jaroslav Křivánek – Fast Spherical Harmonics Rotation40/45
Our Extension – Normal Mapping Normal modulated by a texture Our rotation approximation
Rotation from the un-modulated to the modulated coordinate frame
Small rotation angle good accuracy
Jaroslav Křivánek – Fast Spherical Harmonics Rotation41/45
Normal Mapping Results
Rotation Ignored Our Rotation
Jaroslav Křivánek – Fast Spherical Harmonics Rotation42/45
Normal Mapping Results
Rotation Ignored Our Rotation
Jaroslav Křivánek – Fast Spherical Harmonics Rotation43/45
Normal Mapping Results
Rotation Ignored Our Rotation
Jaroslav Křivánek – Fast Spherical Harmonics Rotation44/45
Talk Overview SH rotation Previous Work Our Rotation Application in global illumination Application in real-time shading Conclusion
Jaroslav Křivánek – Fast Spherical Harmonics Rotation45/45
Conclusion and Future Work Summary
Fast, approximate rotation Truncated Taylor Expansion of the SH rotation matrix 4-6 times faster than [Kautz et al. 2002] O(n2) complexity instead of O(n3) Applications in global illumination and real-time
shading Future Work
Rotation for Wavelets Normal mapping for pre-computed radiance transfer
Jaroslav Křivánek – Fast Spherical Harmonics Rotation46/45
Thank You for your Attention
? ?
Jaroslav Křivánek – Fast Spherical Harmonics Rotation47/45
Appendix – Bibliography [Křivánek et al. 2005] Jaroslav Křivánek, Pascal Gautron, Sumanta
Pattanaik, and Kadi Bouatouch. Radiance caching for efficient global illumination computation. IEEE Transactions on Visualization and Computer Graphics, 11(5), September/October 2005.
[Ivanic and Ruedenberg 1996] Joseph Ivanic and Klaus Ruedenberg. Rotation matrices for real spherical harmonics. direct determination by recursion. J. Phys. Chem., 100(15):6342–6347, 1996.Joseph Ivanic and Klaus Ruedenberg. Additions and corrections : Rotation matrices for real spherical harmonics. J. Phys. Chem. A, 102(45):9099–9100, 1998.
[Choi et al. 1999] Cheol Ho Choi, Joseph Ivanic, Mark S. Gordon, and Klaus Ruedenberg. Rapid and stable determination of rotation matrices between spherical harmonics by direct recursion. J. Chem. Phys., 111(19):8825–8831, 1999.
[Kautz et al. 2002] Jan Kautz, Peter-Pike Sloan, and John Snyder. Fast, arbitrary BRDF shading for low-frequency lighting using spherical harmonics. In Proceedings of the 13th Eurographics workshop on Rendering, pages 291–296. Eurographics Association, 2002.