1 / 41

Fast Approximation to Spherical Harmonics Rotation

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

kasie
Download Presentation

Fast Approximation to Spherical Harmonics Rotation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Graphics Group Fast Approximation to Spherical Harmonics Rotation Jaroslav Křivánek Czech Technical University Jaakko Konttinen University of Central Florida Jiří Žára Czech Technical University Sumanta Pattanaik University of Central Florida Kadi Bouatouch IRISA / INRIA Rennes

  2. Presentation 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 Jaroslav Křivánek – Spherical Harmonics Rotation

  3. Unfortunate Finding • Our technique is only MARGINALLYFASTER than a previous technique. Jaroslav Křivánek – Spherical Harmonics Rotation

  4. Questions 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? • I’ll explain later. Jaroslav Křivánek – Spherical Harmonics Rotation

  5. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  6. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  7. Spherical Harmonics • Basis functions on the sphere Jaroslav Křivánek – Spherical Harmonics Rotation

  8. + + + + + + + Spherical Harmonics + Jaroslav Křivánek – Spherical Harmonics Rotation

  9. Spherical Harmonics Function represented by a vector of coefficients: n … order Jaroslav Křivánek – Spherical Harmonics Rotation

  10. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  11. SH Rotation – Problem Definition • Given coefficients , representing a sphericalfunction • find coefficients  for directly from coefficients . Jaroslav Křivánek – Spherical Harmonics Rotation

  12. SH Rotation Matrix • Rotation = linear transformation by R: • R … spherical harmonics rotation matrix • Given the desired 3D rotation, find the matrix R Jaroslav Křivánek – Spherical Harmonics Rotation

  13. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  14. Previous Work – Molecular Chemistry • [Ivanic and Ruedenberg 1996] • [Choi et al. 1999] • Slow • Bottleneck in rendering applications Jaroslav Křivánek – Spherical Harmonics Rotation

  15. Previous 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 Jaroslav Křivánek – Spherical Harmonics Rotation

  16. zxzxz-decomposition [Kautz et al. 02] • Decompose the 3D rotation into ZYZ Euler angles: R = RZ(a) RY(b) RZ(g) Jaroslav Křivánek – Spherical Harmonics Rotation

  17. zxzxz-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 Jaroslav Křivánek – Spherical Harmonics Rotation

  18. zxzxz-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 Jaroslav Křivánek – Spherical Harmonics Rotation

  19. zxzxz-decomposition [Kautz et al. 02] • Optimized implementation – unrolled code • 4-6 x faster Jaroslav Křivánek – Spherical Harmonics Rotation

  20. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  21. Our Rotation • zyz decomposition: R = RZ(a) RY(b) RZ(g) • RY(b) approximated by a truncated Taylor expansion Jaroslav Křivánek – Spherical Harmonics Rotation

  22. Taylor Expansion of RY(b) Jaroslav Křivánek – Spherical Harmonics Rotation

  23. Taylor Expansion of RY(b) • “1.5-th order Taylor exp.” • Fixed, sparse matrices Jaroslav Křivánek – Spherical Harmonics Rotation

  24. SH Rotation – Results • L2 error for a unit length input vector Jaroslav Křivánek – Spherical Harmonics Rotation

  25. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  26. Application 1 – Radiance Caching • Global illumination: smooth indirect term • Sparse computation • Interpolation Jaroslav Křivánek – Spherical Harmonics Rotation

  27. p1 p2 p Incoming Radiance Interpolation • Interpolate coefficient vectors 1 and 2 Jaroslav Křivánek – Spherical Harmonics Rotation

  28. Interpolation on Curved Surfaces Jaroslav Křivánek – Spherical Harmonics Rotation

  29. p p1 Interpolation on Curved Surfaces • Align coordinate frames in interpolation R Jaroslav Křivánek – Spherical Harmonics Rotation

  30. Radiance Caching Results Jaroslav Křivánek – Spherical Harmonics Rotation

  31. Radiance Caching Results Direct illumination Direct + indirect Jaroslav Křivánek – Spherical Harmonics Rotation

  32. More radiance caching: Temporal radiance caching, 3:45, room 210 Jaroslav Křivánek – Spherical Harmonics Rotation

  33. Application 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 Jaroslav Křivánek – Spherical Harmonics Rotation

  34. Normal Mapping Results Rotation Ignored Our Rotation Jaroslav Křivánek – Spherical Harmonics Rotation

  35. Normal Mapping Results Rotation Ignored Our Rotation Jaroslav Křivánek – Spherical Harmonics Rotation

  36. Comparison – Time per rotation (CPU) • DirectX October 2004: 1.8 x slower than Ivanic Order 6 Order 10 T [ms] T [ms] Jaroslav Křivánek – Spherical Harmonics Rotation

  37. Talk Overview • Spherical Harmonics • Spherical Harmonics Rotation • Previous Techniques • Our Rotation Approximation • Applications & Results • Conclusions Jaroslav Křivánek – Spherical Harmonics Rotation

  38. Conclusion • 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 Jaroslav Křivánek – Spherical Harmonics Rotation

  39. Future Work • Fast approximate rotation for wavelets Jaroslav Křivánek – Spherical Harmonics Rotation

  40. Questions • Code on-line (SH rotation, radiance caching) • http://moon.felk.cvut.cz/~xkrivanj/projects/rcaching ? ? ? ? ? ? ? ? Jaroslav Křivánek – Spherical Harmonics Rotation

  41. 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 matricesfor 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 andstable determination of rotation matrices between spherical harmonics by directrecursion. 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. Jaroslav Křivánek – Spherical Harmonics Rotation

More Related