Title: Fast Approximation to Spherical Harmonics Rotation
1Fast Approximation to Spherical Harmonics Rotation
Jaroslav Krivánek Czech Technical University
Jaakko Konttinen University of Central Florida
Sumanta Pattanaik University of Central Florida
Kadi Bouatouch IRISA / INRIA Rennes
Jirà ára Czech Technical University
2Presentation Topic
- What?
- Rotate a spherical function represented
byspherical harmonics - How?
- Approximation by a truncated Taylor expansion
- Why?
- Applications in real-time rendering and global
illumination
3Unfortunate Finding
- Our technique is only MARGINALLY FASTER than a
previous technique.
4Questions You Might Want to Ask
- Q1 So why taking up a SIGGRAPH sketch slot?
- Found out only very recently.
- Q2 And before?
- Implementation of previous work was NOT
OPTIMIZED. - Q3 Does optimization change that much?
- In this case, it does (4-6 times speedup).
- Q4 How did you find out?
- Ill explain later.
5Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
6Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
7Spherical Harmonics
- Basis functions on the sphere
8Spherical Harmonics
9Spherical Harmonics
Function represented by a vector of coefficients
n order
10Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
11SH Rotation Problem Definition
- Given coefficients ?, representing a
sphericalfunction - find coefficients ? for directly from
coefficients ?.
12SH Rotation Matrix
- Rotation linear transformation by R
- R spherical harmonics rotation matrix
- Given the desired 3D rotation, find the matrix R
13Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
14Previous Work Molecular Chemistry
- Ivanic and Ruedenberg 1996
- Choi et al. 1999
- Slow
- Bottleneck in rendering applications
15Previous Work Computer Graphics
- Kautz et al. 2002
- zxzxz-decomposition
- THE fastest previous method
- THE method we compare against
- THE method nearly as fast as ours
- if properly optimized
16zxzxz-decomposition Kautz et al. 02
- Decompose the 3D rotation into ZYZ Euler angles
R RZ(a) RY(b) RZ(g)
17zxzxz-decomposition Kautz et al. 02
- R RZ(a) RY(b) RZ(g)
- Rotation around Z is simple and fast
- Rotation around Y still a problem
18zxzxz-decomposition Kautz et al. 02
- Rotation around Y
- Decomposition of RY(b) into
- RX(90)
- RZ(b)
- RX(-90)
- R RZ(a) RX(90) RZ(b) RX(-90) RZ(g)
- Rotation around X is fixed-angle
- pre-computed matrix
19zxzxz-decomposition Kautz et al. 02
- Optimized implementation unrolled code
20Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
21Our Rotation
- zyz decomposition R RZ(a) RY(b) RZ(g)
- RY(b) approximated by a truncated Taylor
expansion
22Taylor Expansion of RY(b)
23Taylor Expansion of RY(b)
- 1.5-th order Taylor exp.
- Fixed, sparse matrices
24SH Rotation Results
- L2 error for a unit length input vector
25Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
26Application 1 Radiance Caching
- Global illumination smooth indirect term
- Sparse computation
- Interpolation
27Incoming Radiance Interpolation
- Interpolate coefficient vectors ?1 and ?2
28Interpolation on Curved Surfaces
29Interpolation on Curved Surfaces
- Align coordinate frames in interpolation
R
30Radiance Caching Results
31Radiance Caching Results
Direct illumination
Direct indirect
32More radiance caching Temporal radiance caching,
345, room 210
33Application 2 Normal Mapping
- Original method by Kautz et al. 2002
- Environment map
- Arbitrary BRDF
- Extended with normal mapping
- Needs per-pixel rotation to align withthe
modulated normal - Rotation implemented in fragment shader
34Normal Mapping Results
Rotation Ignored
Our Rotation
35Normal Mapping Results
Rotation Ignored
Our Rotation
36Comparison Time per rotation (CPU)
Order 6
Order 10
T ms
T ms
- DirectX October 2004 1.8 x slower than Ivanic
37Talk Overview
- Spherical Harmonics
- Spherical Harmonics Rotation
- Previous Techniques
- Our Rotation Approximation
- Applications Results
- Conclusions
38Conclusion
- Proposed approximate SH rotation
- Slightly faster than previous technique
- SH Rotation Speed
- Our approximation
- DX 9.0c (up to order 6)
- zxzxz-decomposition with unrolled code
- Lesson learned
- Micro-optimization important for fair comparisons
39Future Work
- Fast approximate rotation for wavelets
40Questions
Code on-line (SH rotation, radiance
caching) http//moon.felk.cvut.cz/xkrivanj/projec
ts/rcaching
?
?
?
?
?
?
?
?
41Appendix Bibliography
- Krivánek et al. 2005 Jaroslav Krivá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)63426347,
1996.Joseph Ivanic and Klaus Ruedenberg.
Additions and corrections Rotation matrices for
real spherical harmonics. J. Phys. Chem. A,
102(45)90999100, 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)88258831, 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 291296. Eurographics
Association, 2002.