Scene Independent Real-Time Indirect Illumination
Total Page:16
File Type:pdf, Size:1020Kb
Scene Independent Real-Time Indirect Illumination Jeppe Revall Frisvad¤ Rasmus Revall Frisvady Niels Jørgen Christensenz Peter Falsterx Informatics and Mathematical Modelling Technical University of Denmark ABSTRACT 2 RELATED WORK A novel method for real-time simulation of indirect illumination is An extensive survey of techniques for interactive global illumina- presented in this paper. The method, which we call Direct Radiance tion is given in [3]. Most of these techniques handle only few scene Mapping (DRM), is based on basal radiance calculations and does changes. An example could be that only the camera and a few rigid not impose any restrictions on scene geometry or dynamics. This objects are allowed to move, while light sources, surface attributes, makes the method tractable for real-time rendering of arbitrary dy- object shapes, etc. are static. Such interactive methods usually re- namic environments and for interactive preview of feature anima- sort to interactive refinement of traditional global illumination solu- tions. Through DRM we simulate two diffuse reflections of light, tions or rely on parallel computations using multiple processors. To but can also, in combination with traditional real-time methods for the contrary the method presented in this paper imposes no restric- specular reflections, simulate more complex light paths. DRM is a tions on scene changes, therefore we call our method scene inde- GPU-based method, which can draw further advantages from up- pendent, and it recomputes the entire solution for each frame using coming GPU functionalities. The method has been tested for mod- a single CPU in cooperation with a GPU. erately sized scenes with close to real-time frame rates and it scales Light Mapping, originating in [22], is an approach which im- with interactive frame rates for more complex scenes. poses a minimum of restrictions on scene changes. The tradeoff is, CR Categories: I.3.3 [Computer Graphics]: Picture/Image Gener- as previously mentioned, that Light Mapping provides only static ation I.3.7 [Computer Graphics]: Three-Dimensional Graphics and global illumination. A disadvantage of Light Mapping and real- Realism time or interactive Radiosity approaches (such as those reviewed in [3]) is that they depend on mapping of textures onto objects. This Keywords: direct radiance mapping, global illumination, hard- complicates shape animation and such methods are, therefore, not ware acceleration, programmable graphics hardware, real-time ren- scene independent. dering Other approaches to global illumination on a single CPU cooper- ating with a GPU includes methods such as Precomputed Radiance 1 INTRODUCTION Transfer [25, 24] and Cube Map Rendering [14, 18], where radi- ance transfer functions are computed and represented in spherical A difficult step along the path towards real-time global illumination harmonics. The former relies on heavy precomputation of transfer is to model indirect light which is reflected diffusely. functions for individual objects, which results in support of rigid In this paper we introduce a method for real-time simulation of objects only and limitations when several objects start interacting indirect illumination. We call the method Direct Radiance Map- with their surroundings. The latter recomputes the spherical har- ping (DRM) and it models two diffuse reflections of light, that is, monics coefficients each frame by rendering cube maps at regularly a single diffuse bounce of indirect light. In order to simulate more spaced points throughout the scene. The placing of the cube maps complex light paths DRM can be combined with traditional real- and the following interpolation of the spherical harmonics coeffi- time methods for specular reflections. cients may give problems in oddly shaped scenes. Both methods Recently PDI/DreamWorks have successfully incorporated a sin- assume low-frequency lighting environments since they represent gle bounce of indirect light in a micro-polygon based scan line ren- their transfer functions in a spherical harmonics basis as proposed derer [26]. Since we simulate the same part of the global illumina- previously in [23]. tion problem, DRM may be useful for a real-time preview before an Another approach is Real-Time Simulation of Photon Mapping expensive micro-polygon based rendering. The idea of a real-time using the GPU. The method described in [20, 4] cannot afford a fi- method approximating a single bounce of indirect light is especially nal gathering step and uses a filtered direct evaluation of a global motivated by figure 6 in [26], which shows that the first bounce is photon map instead. This results in significant low-frequency noise indeed most visually significant. and the frame rates are hardly real-time. A method for real-time Another area of application is computer games. Games often photon mapping, which includes a final gathering step, was pre- make use of Light Mapping which provides a static global illumina- sented in [13]. This method is, however, dependent on scene tion of the background scenery. DRM makes dynamic diffuse indi- changes, since appropriate points must be chosen on the surfaces rect illumination available for real-time applications such as games. in the scene. Additionally a ray tracer is used for selective photon Even though DRM does not offer full global illumination, it is one tracing and therefore each dynamic object must be pointed out for step along the way and the implementation is easily accomplished efficient BSP (Binary Space Partitioning) tree optimized ray trac- using fragment programs. ing. The use of precalculated BSP trees means that all objects must be rigid. ¤e-mail: [email protected] Through DRM we seek a method which needs no time consum- ye-mail: [email protected] ing precomputations, no restrictions on scene dynamics such as ze-mail: [email protected] rigid objects only, and no placement of sample points throughout x e-mail: [email protected] the scene requiring one or several rendering passes each. In other °c IEEE, 2005. This is the authors' version of the work. It is posted here words we seek a method which is independent of scene dynamics for your personal use. Not for redistribution. The definitive version was and scene geometry while still able to simulate some of the light published in Proceedings of Computer Graphics International 2005. paths encompassed in global illumination. PSfrag replacements ¢!0 θ0 r Ap 0 Ap ® L 4 THE RESULTING METHOD ¯ Direct Radiance Map a Combining our method with stenciled planar reflections (see [12]) b and cube environment mapping (see [1]) as described in [17], V Image plane we will in the following describe how to model the light paths LD?Srt*E and LSrt*DDSrt*E in real-time, where Srt denotes re- D E flections under the usual limitations of the real-time reflection meth- LDE ods mentioned above and ? denotes one or zero events. photon LDDE To model the mentioned light paths we take a brief look at the D rendering equation, which was introduced in [11] and is given as follows: Lo(x; !) = Le(x; !) + Lr(x; !) (1) D importon where Lo is outgoing (or exitant) radiance at the surface location x in the direction !, Le is emitted radiance, and Lr is reflected Figure 1: An illustration of the conceptual idea. radiance. While Le is often merely modeled as a constant, the re- flected radiance (Lr) is an infinitely recursive term, which is given as follows: HE ONCEPT 3 T C 0 0 0 Lr(x; !) = fr(x; ! ; !)Li(x; ! ) cos θ d! (2) Think of the final gathering step employed in most multi-pass meth- Z ods for global illumination. Through a mapping of the radiance ar- where Li is incident radiance at the surface location x from the riving directly from the light sources to the surfaces in a scene, we direction !0 and is the hemisphere, which we integrate all in- can perform a simple final gathering using rasterization only. This coming directions across. θ is the angle between the normal n at simple final gathering captures a smooth approximation to single the surface location x and the direction towards the incoming light. bounce indirect illumination. fr is the BRDF as described in [15]. Explained differently the idea is on one hand to have a photon In [9] it is shown how the rendering equation can be split up map (see eg. [10, 9]), containing photons emitted directly from the 1 into four different terms: Direct illumination, specular and glossy light sources only, and on the other hand an importon map, con- reflections, caustics, and multiple diffuse reflections. In this paper taining importons emitted directly from the observer only. In light we partly simulate the direct illumination term, the reflections term, transport notation (introduced by Heckbert in [8]) the photon map and the multiple diffuse reflections. The caustics term is ignored. we describe will represent the light paths LD while the importon In other words DRM compromises the image quality and gain flex- map will represent the light paths DE. ibility and speed as compared to the methods mentioned in section Suppose we let each direct importon receive a contribution from 2. each direct photon according to a suitable BRDF, then we have per- formed the final gathering and accounted for the light paths LDDE. In order to avoid tracing a ray from each photon to each importon, Direct Illumination we must assume visibility between all photons and all importons. LD?E This means that our method does not account for indirect shadows. To simulate direct illumination (light paths ) we take two dif- Instead of ray tracing we employ a rasterization approach to con- ferent cases into account. (a) Direct illumination from isotropic struct the photon map and the importon map. The data structure of point light sources and (b) direct illumination from isotropic area a photon essentially contains a position, an RGB power value, and light sources assuming that the area light is very distant from the 0 an incident direction (see [9]).