A Brief Overview of Global Illumination Thomas Larsson, Afshin Ameri Mälardalen University 1
What is Global illumination? Global illumination is a general name for realistic rendering algorithms Global illumination methods handle indirect illumination In particular diffuse inter-reflections This produces realistic (global) effects Reflections, refractions, and shadows 2
Realistic Lighting Physical correct model Photons are emitted from light sources. Photons hitting surfaces are scattered or absorbed. What we see is actually photons hitting the eye! Far to expensive to simulate A light source may emit e.g. 10 20 photons/second A tiny fraction of these emitted photons hit the eye Need to solve simultaneously for incoming and outgoing light at all surface points This is a massive integral equation Radiosity deals with the easy case of purely diffuse scenes Alternatively, try to sample a huge number of complete paths from light source to camera. 3
Reflectance Reflectance is all about the way light interacts with surfaces A field of study on its own Reflectance modeling Essential for deciding what surfaces look like Also related to the light transport problem The most important quantity is the BRDF BRDF really just means the way light bounces off of something. 4
BRDF BRDF = Bidirectional Reflectance Distribution Function A function of a point on the surface, an incoming light direction, and an outgoing light direction Tells you how much of the light that comes in from one direction goes out in another direction General BRDFs are difficult to work with, so simplifications are made 5
Example Materials BRDF database Each reflectance function is stored as a densely measured Bidirectional Reflectance Distribution Function (BRDF). See http://www.merl.com/brdf/ 6
The rendering equation Introduced into computer graphics by Kajiya 1986 Based on the law of conservation of energy in physics Realistic rendering is about solving (approximately) the rendering equation (or parts of it) 7
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da ω' x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da L(x',ω') is the radiance from a point on a surface in a given direction ω' ω' x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da E(x',ω') is the emitted radiance from a point: E is non-zero only if x' is emissive x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da Sum the contribution from all of the other surfaces in the scene ω' x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da For each x, compute L(x, ω), the radiance at point x in the direction ω (from x to x') ω' x ω x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da scale the contribution by ρx'(ω,ω'), the reflectivity (BRDF) of the surface at x' ω' x ω x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da For each x, compute V(x,x'), the visibility between x and x': 1 when the surfaces are unobstructed along the direction ω, 0 otherwise x ω ω' x'
The Rendering Equation, AGAIN! L(x',ω') = E(x',ω') + ρ x' (ω,ω')l(x,ω)g(x,x')v(x,x') da For each x, compute G(x, x'), which describes the on the geometric relationship between the two surfaces at x and x ω' x ω x'
Classifying Rendering Methods Consider the type of light interactions they capture Classifying the interactions: light paths Where from, where to What they do along the way 16
Light paths Assume only two types of surface interactions Pure diffuse, D Pure specular, S Assume all paths of interest Start at a light source, L End at the eye, E Describe paths using regular expressions Valid paths are L(D S)*E Light, followed by either diffuse or specular, zero or more times, ending at the eye 17
Supported light paths examples What light paths are supported in the traditional OpenGL pipeline Simple ray tracing 18
LSDE LSE LDE LDDE
Path Types Ray Casting: LDE Ray Tracing: LDS*E Radiosity: LD*E LSDE LSE LDE LDDE
Progressive Radiosity An object space algorithm View independent Can be pre-computed and used later Surfaces are assumed to be perfectly Lambertian The scene is divided into smaller areas called patches The radiosity, B i, of patch i is the total rate of energy leaving a surface. The radiosity over a patch is constant.
Progressive Radiosity Simulates diffuse interreflections Radiosity of each surface depends on radiosity of all other surfaces Gives effects such as color bleeding Divide scene into patches Find formfactors (visibility factors for each pair) Solve system iteratively in terms of bounce levels Results are viewpoint independent 22
Distributed Ray Tracing Suggeste by Cook et al., 1984. Distribute rays throughout a pixel to get spatial antialiasing Distribute rays in time to get temporal antialiasing (Motion blur) Distribute rays in reflected ray direction to simulate glossy reflections Distribute rays across area light source to simulate soft shadows Distribute rays throughout lens area to simulate depth of field Distribute rays across hemisphere to simulate diffuse interreflection (Radiosity) 23
Path tracing Introduced by Kajiya in 1986 Shoot recursive rays randomly Diffuse reflection spawns infinite rays Pick one ray at random Simulates many advanced effects quite naturally soft shadows, depth of field, motion blur, caustics, ambient occlusion, and indirect lighting Photo-realistic results Path tracing can be used as reference for other rendering methods But only if many paths per pixel are traced 24
Bi-directional path tracing Introduced by Lafortune 1993 Faster convergence (compared to path tracing) Traces rays both from the eye and the light source Improved method: Metropolis light transport Main idea: when a path has been found from light to eye, then try to explore nearby paths See youtube Two Minute Papers - Metropolis Light Transport 25
Photon mapping Introduced by Henrik Wann Jensen Bi-directional path tracing with a cache Simulates transport of individual photons Photons emitted from source Photons deposited on surfaces Photons reflected between surfaces Photons collected by rendering Two pass algorithm Pass one: photon tracing Build the photon map data structure Pass two: rendering Similar to ray tracing: Query both object and nearby photons to determine color 26
Caustics (Images by Henrik Wann Jensen) 27