Fast Local Approximation to Global Illumination
Total Page:16
File Type:pdf, Size:1020Kb
FAST LOCAL APPROXIMATION TO GLOBAL ILLUMINATION by Christopher R. Wyman A dissertation submitted to the faculty of The University of Utah in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science School of Computing The University of Utah August 2004 Copyright c Christopher R. Wyman 2004 All Rights Reserved THE UNIVERSITY OF UTAH GRADUATE SCHOOL SUPERVISORY COMMITTEE APPROVAL of a dissertation submitted by Christopher R. Wyman This dissertation has been read by each member of the following supervisory committee and by majority vote has been found to be satisfactory. Chair: Charles Hansen Elaine Cohen Victoria Interrante Steven Parker Peter Shirley THE UNIVERSITY OF UTAH GRADUATE SCHOOL FINAL READING APPROVAL To the Graduate Council of the University of Utah: I have read the dissertation of Christopher R. Wyman in its final form and have found that (1) its format, citations, and bibliographic style are consistent and acceptable; (2) its illustrative materials including figures, tables, and charts are in place; and (3) the final manuscript is satisfactory to the Supervisory Committee and is ready for submission to The Graduate School. Date Charles Hansen Chair, Supervisory Committee Approved for the Major Department Christopher R. Johnson Director Approved for the Graduate Council David S. Chapman Dean of The Graduate School ABSTRACT Interactive global illumination remains an elusive goal in rendering, as energy from every portion of the scene contributes to the final image. Integrating over a complex scene, with a polygon count in the millions or more, proves difficult even for static techniques. Interacting with such complex environments while maintaining high quality rendering generally requires recomputing the paths of countless photons using a small number of CPUs. This dissertation examines a simplified approach to interactive global illumination. Observing that local illumination computations can be performed inter- actively even on fairly simple graphics accelerators, a reduction of global illumination problems to local problems would allow interactive rendering. A number of techniques are suggested that simplify global illumination to specific global illumination effects (e.g., diffuse interreflection, soft shadows, and caustics), which can individually be sampled at a local level. Rendering these simplified global illumination effects reduces to a few lookups, which can easily be done at interactive rates. While some tradeoffs exist between rendering speed, rendering quality, and memory consumption, these techniques show that approximating global illumination locally allows interactivity while still maintaining significant realism. CONTENTS ABSTRACT : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : iv LIST OF FIGURES : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : vii LIST OF TABLES : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : x ACKNOWLEDGMENTS : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : xi CHAPTERS 1. INTRODUCTION : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1.1 Local Illumination . 2 1.2 Global Illumination . 5 1.2.1 Radiometry . 5 1.2.2 Reflectance of Light . 7 1.2.3 The Rendering Equation . 8 1.3 Motivation for Global Illumination . 8 1.4 Overview of this Work . 13 2. PREVIOUS WORK : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 15 2.1 Radiosity Approaches . 16 2.2 Ray-based Approaches . 17 2.3 Hybrid Radiosity-Raytraced Approaches . 20 2.3.1 Interactive Hybrid Approaches . 21 2.4 Soft Shadow Techniques . 22 2.5 Caustic Techniques . 26 2.6 Other Interactive Global Illumination Approaches . 27 3. INTERACTIVE SOFT SHADOWS USING PENUMBRA MAPS : : 31 3.1 Shadow Plateaus . 32 3.2 Penumbra Maps . 34 3.3 Implementation . 39 3.3.1 Discussion of Limitations . 40 3.4 Results . 41 4. INTERACTIVE RENDERING OF CAUSTICS : : : : : : : : : : : : : : : : : : 45 4.1 Caustics . 47 4.1.1 Caustic Behavior . 47 4.1.2 Simplifying the Problem . 48 4.2 Caustic Sampling . 49 4.2.1 Sampling the Light . 49 4.2.2 Sampling Space . 50 4.2.3 Data Representation . 51 4.3 Caustic Rendering . 53 4.3.1 Rendering Algorithm . 53 4.3.2 Issues Rendering Caustic Data . 54 4.4 Results . 57 4.5 Discussion . 61 5. INTERACTIVE RENDERING OF ISOSURFACES WITH GLOBAL ILLUMINATION : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 63 5.1 Background . 65 5.2 Overview . 66 5.3 Algorithm . 70 5.3.1 Illumination Computation . 70 5.3.2 Interactive Rendering . 73 5.4 Results . 74 6. CONCLUSIONS AND FUTURE WORK : : : : : : : : : : : : : : : : : : : : : : : : 85 APPENDICES A. SHADER CODE FOR PENUMBRA MAPS : : : : : : : : : : : : : : : : : : : : : 88 B. SPHERICAL HARMONICS : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 93 REFERENCES : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 110 vi LIST OF FIGURES 1.1 Examples of local illumination models . 3 1.2 The Phong illumination model uses four vectors to determine lighting for each point . 4 1.3 Radiance is the energy per unit area per unit time per unit solid angle d~! . 6 1.4 Renderings using local, direct, and global illumination . 10 1.5 An object's shadow affects the perception of object location . 11 1.6 Refraction of light through the cup and water introduces apparent bends, discontinuities, and other artifacts to a typical wooden pencil . 12 1.7 Common caustics from everyday life . 13 3.1 The shadow umbra includes regions where the light is completely occluded, and the penumbra occurs in regions where objects only partially occlude the light . 32 3.2 Penumbra maps in a scene with multiple lights . 33 3.3 Approximate soft shadows using shadow plateaus . 34 3.4 Rendering using penumbra maps . 36 3.5 Explanation of penumbral sheets and cones . 37 3.6 Computing per-fragment intensity from cone or sheet geometry . 37 3.7 Pseudocode for penumbra map fragment program . 38 3.8 These pathtraced images show three different types of interactions between overlapping penumbra . 40 3.9 Penumbra map results for the Stanford bunny . 42 3.10 Penumbra map results for the dragon model . 43 4.1 A scene with caustics from a glass bunny . 46 4.2 The eight dimensions of a caustic . 48 4.3 Popping between adjacent light samples . 50 4.4 Sampling space on either a uniform grid or a set of concentric shells . 51 4.5 Sharper caustics come at the expense of denser sampling . 52 4.6 L^ intersects the spherical triangle formed by L^i, L^j, and L^k . 55 4.7 Ghosting happens when the caustic changes significantly between neighbor- ing light samples L^i, L^j, and L^k . 55 4.8 Alternative approach to caustic lookups . 56 4.9 Caustic rendering techniques on a metal ring and glass cube . 58 4.10 Caustic rendering techniques on a glass prism . 59 4.11 Casting caustics on complex objects . ..