Design and Implementation of Parallel Light Transport Algorithms Based on Quasi-Monte Carlo Ray Tracing
Total Page:16
File Type:pdf, Size:1020Kb
AGH University of Science and Technology Faculty of Electrical Engineering, Automatics, Computer Science and Electronics Institute of Computer Science Dissertation for the degree of Doctor of Philosophy in Computer Science Design and Implementation of Parallel Light Transport Algorithms based on quasi-Monte Carlo Ray Tracing mgr in_z. Micha lRadziszewski supervisor: dr hab. in_z. Krzysztof Boryczko, prof. n. AGH Krak´ow,June 2010 Abstract Photorealistic rendering is a part of computer graphics, which concentrates on creating images and animations based on 3D models. Its goal is creation of pictures that are indistinguishable from real world scenes. This work is dedicated to a particular class of photorealistic rendering algorithms { quasi-Monte Carlo ray tracing based global illumination. Global illumination is a very useful concept for creating realistically lit images of artificial 3D scenes. Using automatic and correct computation of vast diversity of optical phenomena, it enables creating a rendering software, which allows specification of what is to be rendered instead of detailed description of how to render a given scene. Its current applications range from many CAD systems to special effects in movies. In future, when computers become sufficiently powerful, real time global illumination may be the best choice for computer games and virtual reality. Currently, only Monte Carlo and quasi-Monte Carlo ray tracing based algorithms are general enough to support full global illumination. Unfortunately, they are very slow compared to other techniques, e.g. hardware accelerated rasterization. The main purpose of this thesis is an im- provement of efficiency of physically correct rendering. The thesis concentrates on enhancement of robustness of rendering algorithms, as well as parallel realization of them. These two elements together can substantially increase global illumination applicability, and are a step towards the ultimate goal of being able to run true global illumination in real time. i Acknowledgements I am deeply indebted to my supervisor, Prof. Krzysztof Boryczko. Without his inspiration, advice and encouragement this work would not have been completed. I would like to sincerely thank Dr Witold Alda from the AGH University of Science and Technology. During work on this dissertation we have spent many hours in conversations. The expertise I gathered working with him contributed substantially to the dissertation. I would like to acknowledge the financial support from the AGH University of Science and Technology { a two one year scholarships for PhD students. Finally, I also would like to acknowledge ZPORR (Zintegrowany Program Operacyjny Rozwoju Regionalnego) for scholarship \Ma lopolskie Stypendium Doktoranckie", co-founded by European Union. ii Contents Abstract i Acknowledgements ii 1 Introduction 1 1.1 Global Illumination and its Applications........................1 1.2 Thesis Purpose and Original Contributions......................2 1.3 Thesis Organization...................................3 2 Light Transport Theory4 2.1 Geometric Optics.....................................4 2.1.1 Assumptions...................................4 2.1.2 Radiometric Quantities.............................5 2.2 Light Transport Equation................................7 2.2.1 Surface Only Scattering.............................7 2.2.2 Volumetric Scattering Extension........................7 2.2.3 Properties of Scattering Functions.......................9 2.2.4 Analytic Solutions................................ 10 2.2.5 Simplifications.................................. 10 2.3 Image Formation..................................... 11 2.3.1 Importance.................................... 11 2.3.2 Integral Formulation............................... 12 2.3.3 Image Function.................................. 13 3 Monte Carlo Methods 14 3.1 Monte Carlo Integration................................. 14 3.1.1 Statistical Concepts............................... 14 3.1.2 Estimators of Integrals.............................. 16 3.1.3 Biased and Unbiased Methods......................... 16 3.2 Variance Reduction Techniques............................. 17 3.2.1 Importance and Multiple Importance Sampling................ 17 3.2.2 Russian Roulette and Splitting......................... 18 3.2.3 Uniform Sample Placement........................... 18 3.3 Quasi-Monte Carlo Integration............................. 19 3.3.1 Desired Properties and Quality of Sample Sequences............. 20 3.3.2 Low Discrepancy Sequences........................... 21 3.3.3 Randomized Quasi-Monte Carlo Sampling................... 23 3.3.4 Comparison of Monte Carlo and Quasi-Monte Carlo Integration....... 23 3.3.5 Quasi-Monte Carlo Limitations......................... 24 4 Light Transport Algorithms 26 4.1 Ray Tracing vs. Other Algorithms........................... 27 4.1.1 View Dependent vs. View Independent Algorithms.............. 27 4.1.2 Ray Tracing Algorithms............................. 28 iii CONTENTS iv 4.1.3 Hardware Accelerated Rasterization...................... 28 4.1.4 Radiosity Algorithms.............................. 29 4.2 Light Transport Paths.................................. 29 4.2.1 Classification of Paths.............................. 30 4.2.2 Construction of Paths.............................. 30 4.2.3 Local Path Sampling Limitation........................ 31 4.3 Full Spectral Rendering................................. 32 4.3.1 Necessity of Full Spectrum........................... 33 4.3.2 Representing Full Spectra............................ 35 4.3.3 Efficient Sampling of Spectra.......................... 36 4.3.4 Results and Discussion.............................. 39 4.4 Analysis of Selected Light Transport Algorithms................... 42 4.4.1 Path Tracing................................... 42 4.4.2 Bidirectional Path Tracing........................... 46 4.4.3 Metropolis Light Transport........................... 49 4.4.4 Irradiance and Radiance Caching........................ 51 4.4.5 Photon Mapping................................. 52 4.5 Combined Light Transport Algorithm......................... 57 4.5.1 Motivation.................................... 57 4.5.2 Merging of an Unbiased Algorithm with Photon Mapping.......... 58 4.5.3 Results and Conclusion............................. 59 5 Parallel Rendering 61 5.1 Stream Processing.................................... 62 5.1.1 Stream Processing Basics............................ 62 5.1.2 Extended Stream Machines with Cache.................... 62 5.1.3 Stream Monte Carlo Integration........................ 64 5.2 Parallel Ray Tracing................................... 65 5.2.1 Algorithm Initialization and Scene Description................ 65 5.2.2 Frame Buffer as an Output Stream....................... 65 5.2.3 Multipass Rendering............................... 66 5.2.4 Ray Tracing on an Extended Stream Machine................. 66 5.2.5 Results and Conclusions............................. 68 5.3 Choice of Optimal Hardware.............................. 69 5.3.1 Shared Memory vs. Clusters of Individual Machines............. 70 5.3.2 Multiprocessor Machines vs. Graphics Processors............... 70 5.3.3 Future-proof Choice............................... 71 5.4 Interactive Visualization of Ray Tracing Results.................... 71 5.4.1 Required Server Output............................. 72 5.4.2 Client and Server Algorithms.......................... 74 5.4.3 MIP-mapping Issues............................... 78 5.4.4 Results and Discussion.............................. 79 6 Rendering Software Design and Implementation 82 6.1 Core Functionality Interface............................... 82 6.1.1 Quasi-Monte Carlo Sampling.......................... 83 6.1.2 Ray Intersection Computation......................... 85 6.1.3 Spectra and Colors................................ 86 6.1.4 Extension Support................................ 89 6.2 Procedural Texturing Language............................. 90 6.2.1 Functional Languages.............................. 91 6.2.2 Syntax and Semantic............................... 92 6.2.3 Execution Model and Virtual Machine API.................. 93 6.2.4 Results and Conclusion............................. 95 6.3 New Glossy Reflection Models.............................. 96 6.3.1 Related Work................................... 97 CONTENTS v 6.3.2 Properties of Reflection Functions....................... 98 6.3.3 Derivation of Reflection Function........................ 99 6.3.4 Results and Conclusions............................. 101 7 Results 104 7.1 Image Comparison.................................... 104 7.2 Full Spectral Rendering................................. 105 7.3 Comparison of Rendering Algorithms.......................... 105 8 Conclusion 109 8.1 Contributions Summary................................. 109 8.2 Final Thoughts and Future Work............................ 110 Bibliography 112 Index 121 List of Symbols Φ radiant flux E irradiance L radiance W importance λ wavelength fr bidirectional reflection distribution function (BRDF) ft bidirectional transmission distribution function (BTDF) fs bidirectional scattering distribution function (BSDF) fp phase function N normal direction ! unit directional vector !i incident ray direction !o outgoing ray direction θ angle between ! and N x; y points { either on a surface A or in a volume V x\2 − x1 normalized vector pointing from x1 to x2, x1 6= x2 x; x[k] a light transport path, path with k segments, k + 1 vertexes Λ space of all visible