Download presentation
Presentation is loading. Please wait.
1
Advanced Global Illumination Brian Chen Thursday, February 12, 2004
2
Physical Simulation of Light Transport: Accuracy account for ALL light paths conservation of energy Prediction forward rendering calculate light meter readings Analysis inverse rendering ! find surface properties ! Realism? perceptually necessary? Global Illumination
3
“ Everything is lit by Everything Else” “ Everything is lit by Everything Else” Screen color = entire scene’s lighting * surface reflectance Screen color = entire scene’s lighting * surface reflectance Refinements: Models of area light sources, caustics, soft-shadowing, fog/smoke, photometric calibration, … Refinements: Models of area light sources, caustics, soft-shadowing, fog/smoke, photometric calibration, … H. Rushmeier et al., SIGGRAPH`98 Course 05 “A Basic Guide to Global Illumination”
4
Overview Physics (Optics) concepts Physics (Optics) concepts Models of Light Models of Light Radiometry Radiometry BRDFs & Rendering Equation BRDFs & Rendering Equation Monte Carlo Methods Monte Carlo Methods Photon Mapping Photon Mapping
5
Optics Definitions Reflection – when light bounces off a surface Reflection – when light bounces off a surface Refraction – the bending of light when it goes through different mediums (ex. air and glass) Refraction – the bending of light when it goes through different mediums (ex. air and glass) Diffraction – the phenomenon where light “bends” around obstructing objects Diffraction – the phenomenon where light “bends” around obstructing objects Dispersion – when white light splits into its components colors, result of refraction Dispersion – when white light splits into its components colors, result of refraction
6
Light’s Dual Nature Is light a wave? Or is it a beam of particles? Is light a wave? Or is it a beam of particles? Wave Theory of Light – Thomas Young’s double-slit experiment Wave Theory of Light – Thomas Young’s double-slit experiment Particle Theory of Light – Newton, refraction & dispersion Particle Theory of Light – Newton, refraction & dispersion
7
Light Models Models of light are used to capture/explain the different behaviors of light that stem from its dual nature Models of light are used to capture/explain the different behaviors of light that stem from its dual nature Quantum Optics Quantum Optics Wave Model Wave Model Geometric Optics Geometric Optics
8
Quantum Optics Explains dual wave-particle nature at the submicroscopic level of electrons Explains dual wave-particle nature at the submicroscopic level of electrons Way too detailed for purposes of image generation for computer graphics scenes Way too detailed for purposes of image generation for computer graphics scenes Therefore, it is not used Therefore, it is not used
9
Wave Model Simplification of Quantum Model Simplification of Quantum Model Captures effects that occur when light interacts with objects of size comparable to the wavelength of light (diffraction, polarization) Captures effects that occur when light interacts with objects of size comparable to the wavelength of light (diffraction, polarization) This model is also ignored, too complex and detailed This model is also ignored, too complex and detailed
10
Geometric Optics Simplest and most commonly used light model Simplest and most commonly used light model Assumes light is emitted, reflected, and transmitted (refraction) Assumes light is emitted, reflected, and transmitted (refraction) Also assumes: Also assumes: Light travels in straight lines, no diffraction Light travels in straight lines, no diffraction Light travels instantaneously through a medium (travels at infinite speed) Light travels instantaneously through a medium (travels at infinite speed) Light is not influenced by gravity, magnetic fields Light is not influenced by gravity, magnetic fields
11
Radiometry Radiometry – area of study involved in the physical measurement of light Radiometry – area of study involved in the physical measurement of light Goal of illumination algorithm is to compute the steady-state distribution of light energy in a scene Goal of illumination algorithm is to compute the steady-state distribution of light energy in a scene
12
Radiometric Quantities Radiant Power Radiant Power flux (in Watts = Joule/sec), Φ flux (in Watts = Joule/sec), Φ How much total energy flows from/to/through a surface per unit time How much total energy flows from/to/through a surface per unit time Irradiance (“ear”) Irradiance (“ear”) incoming radiant power on a surface per unit surface area (Watt/m 2 ) incoming radiant power on a surface per unit surface area (Watt/m 2 ) E = dΦ/dA E = dΦ/dA
13
More Radiometric Quantities Radiosity Radiosity Outgoing radiant power per unit surface area (Watt/m 2 ) Outgoing radiant power per unit surface area (Watt/m 2 ) B = dΦ/dA B = dΦ/dA
14
Radiance Flux per unit projected area per unit solid angle (W/(steradian x m 2 )) Flux per unit projected area per unit solid angle (W/(steradian x m 2 )) How much power arrives at (or leaves from) a certain point on a surface, per unit solid angle, and per unit projected area How much power arrives at (or leaves from) a certain point on a surface, per unit solid angle, and per unit projected area L(x, Ө) = d 2 Φ / (dω dA cosӨ) L(x, Ө) = d 2 Φ / (dω dA cosӨ) The most important quantity in global illumination because it captures the “appearance” of objects The most important quantity in global illumination because it captures the “appearance” of objects
15
Radiance cont’d Radiance: The Pointwise Measure of Light Free-space light power L ==(energy/time) Free-space light power L ==(energy/time) At least a 5D scalar function: L(x, y, z, , , …) At least a 5D scalar function: L(x, y, z, , , …) Position (x,y,z), Angle ( , ) and more (t,, …) Position (x,y,z), Angle ( , ) and more (t,, …) Power density units, but tricky… Power density units, but tricky… Taken with permission from Jack Tumblin
16
Yet More Radiance Tricky: think Hemispheres with a floor: Solid Angle (steradians) =d ω = fraction of a hemisphere’s area (4 ) dA Projected Area cos dA Taken with permission from Jack Tumblin
17
Properties of Radiance 1: Radiance is invariant along straight paths and does not attenuate with distance 1: Radiance is invariant along straight paths and does not attenuate with distance Radiance leaving point x directed towards point y is equal to the radiance arriving at point y from the point x Radiance leaving point x directed towards point y is equal to the radiance arriving at point y from the point x 2: Sensors, such as cameras and human eye, are sensitive to radiance 2: Sensors, such as cameras and human eye, are sensitive to radiance The response of our eyes is proportional to the radiance incident upon them. The response of our eyes is proportional to the radiance incident upon them. It is now clear that radiance is the quantity that global illumination algorithms must compute and display to the observer It is now clear that radiance is the quantity that global illumination algorithms must compute and display to the observer
18
BRDF (Bidirectional Reflectance Distribution Function) Intuitively the BRDF represents, for each incoming angle, the amount of light that is scattered in each outgoing angle Intuitively the BRDF represents, for each incoming angle, the amount of light that is scattered in each outgoing angle BRDF at a point x is defined as the ratio of the radiance reflected in an exitant direction (Ө), and the irradiance incident in a differential solid angle (Ψ). BRDF at a point x is defined as the ratio of the radiance reflected in an exitant direction (Ө), and the irradiance incident in a differential solid angle (Ψ). f r (x,Ψ->Ө) = dL(x->Ө) / (L(x Ө) = dL(x->Ө) / (L(x<-Ψ)cos(N x,Ψ)dω Ψ ) cos(N x,Ψ) = cos of angle formed by normal & incident direction vector cos(N x,Ψ) = cos of angle formed by normal & incident direction vector
19
Point-wise Reflectance: BRDF Bidirectional Reflectance Distribution Function ( i, i, r, r, i, r, … ) == (L r / L i ) a scalar (sr -1 ) ( i, i, r, r, i, r, … ) == (L r / L i ) a scalar (sr -1 ) Illuminant L i Reflected L r Infinitesimal Solid Angle
20
BRDF Properties Value of BRDF remains unchanged if the incident and outgoing directions are interchanged Value of BRDF remains unchanged if the incident and outgoing directions are interchanged Law of conservation of energy requires that the total amount of power reflected all directions must be less than or equal to the total amount of power incident on the surface Law of conservation of energy requires that the total amount of power reflected all directions must be less than or equal to the total amount of power incident on the surface
21
BRDF Examples, Diffuse Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Ψ Ө) = ρ d /π, constant F r = (x,Ψ Ө) = ρ d /π, constant ρ d is the fraction of incident energy that is reflected at a surface, 0-1
22
BRDF Examples, Specular Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Exitant direction: Ψ)N – Ψ R = 2(N dot Ψ)N – Ψ
23
For Most Surfaces Andrew Glassner et al.. SIGGRAPH`94 Course 18: “Fundamentals and Overview of Computer Graphics” Most Materials: Combination of Diffuse & Specular…their BRDF is difficult to model with formulas
24
Practical Shading Models (BRDF) Lambert: k d = ρd/π Lambert: k d = ρd/π Phong: fr = k s *((R·Ө n )/(N·Ψ)) + k d Phong: fr = k s *((R·Ө n )/(N·Ψ)) + k d Blinn-Phong = k s *((N·H)/(N·Ψ)) + k d, H=halfway vector between Ψ & Ө Blinn-Phong = k s *((N·H)/(N·Ψ)) + k d, H=halfway vector between Ψ & Ө Modified Blinn-Phong = k s *(N·H) n + k d Modified Blinn-Phong = k s *(N·H) n + k d Cook-Torrance Cook-Torrance Ward Ward
25
Lambert BRDF
26
Phong BRDF
27
Blinn-Phong BRDF
28
Ward Anisotropic BRDF
29
Rendering Equation Finally! Putting radiance and the BRDF together to get:
30
BRDF & Rendering Eq. For example, suppose that we wish to determine the illumination of a scene containing n light sources – light source 1 to light source n. In this case, the local illumination of a surface is given by, For example, suppose that we wish to determine the illumination of a scene containing n light sources – light source 1 to light source n. In this case, the local illumination of a surface is given by, where Lij is the intensity of the jth light source and wij = ( ij, ij) is the direction to the jth light source. where Lij is the intensity of the jth light source and wij = ( ij, ij) is the direction to the jth light source.
31
BRDF & Rendering Eq. For a single point light source, the light reflected in the direction of an observer is For a single point light source, the light reflected in the direction of an observer is This is the general BRDF lighting equation for a single point light source This is the general BRDF lighting equation for a single point light source
32
Rendering Equation Opportunities Scalar operations only: () and L(), indep. of, x,y,z, , … Scalar operations only: () and L(), indep. of, x,y,z, , … Linearity: Linearity: Solution = weighted sum of one-light solns. Solution = weighted sum of one-light solns. Many BRDFs weighted sum of diffuse, specular, gloss terms Many BRDFs weighted sum of diffuse, specular, gloss termsDifficulties Almost no nontrivial analytic solutions exist; MUST use approximate methods to solve Almost no nontrivial analytic solutions exist; MUST use approximate methods to solve Verification: tough to measure real-world () and L() well Verification: tough to measure real-world () and L() well Notable wavelength-dependent surfaces exist (iridescent insect wings & casing, CD grooves, oil) Notable wavelength-dependent surfaces exist (iridescent insect wings & casing, CD grooves, oil) BRDF doesn’t capture important subsurface scattering BRDF doesn’t capture important subsurface scattering
33
Review 1 Big Ideas: Radiance Measure Light: Radiance : BRDF Measure Light Attenuation: BRDF The Rendering Equation (intractable: must approximate) Light will ‘bounce around’ endlessly, decaying on each bounce:The Rendering Equation (intractable: must approximate)
34
Monte Carlo Techniques Mathematical techniques that use statistical sampling to simulate phenomena or evaluate values of functions Mathematical techniques that use statistical sampling to simulate phenomena or evaluate values of functions Use a probability distribution function (PDF) to generate random samples, p(x) Use a probability distribution function (PDF) to generate random samples, p(x)
35
Estimators Unbiased – when the expected value of the estimator is exactly the value of the integral Unbiased – when the expected value of the estimator is exactly the value of the integral Biased – when the above property is not true Biased – when the above property is not true Bias – the difference between the expected value of the estimator and the actual value of the integral Bias – the difference between the expected value of the estimator and the actual value of the integral As number of samples N increases, the estimate becomes closer As number of samples N increases, the estimate becomes closer
36
Monte Carlo Techniques The reliability of Monte-Carlo sampling is measured by the variance of the estimators. The variance of the estimators is given as The reliability of Monte-Carlo sampling is measured by the variance of the estimators. The variance of the estimators is given as where is the primary estimator, while its average is a secondary estimator where is the primary estimator, while its average is a secondary estimator
37
Monte Carlo Techniques As a consequence of the above formula, the Monte- Carlo technique requires a large number of samples to reduce the variance of the primary estimator As a consequence of the above formula, the Monte- Carlo technique requires a large number of samples to reduce the variance of the primary estimator The error of the approximation is itself a random variable with zero mean, i.e. the estimator is unbiased. The standard deviation of this estimator is reduced only proportional to which is known as the diminishing return of the Monte-Carlo technique, i.e. the number of samples must be quadrupled to reduce the standard deviation by one half. The error of the approximation is itself a random variable with zero mean, i.e. the estimator is unbiased. The standard deviation of this estimator is reduced only proportional to which is known as the diminishing return of the Monte-Carlo technique, i.e. the number of samples must be quadrupled to reduce the standard deviation by one half.
38
Monte Carlo Techniques For importance sampling we adjust the pdf p to be similar in shape to the integrand f. If we were able to choose p(x)= Cf(x), with a constant factor C= 1/I, the variance of the primary estimator would be zero and a single sample would always give the correct result. For importance sampling we adjust the pdf p to be similar in shape to the integrand f. If we were able to choose p(x)= Cf(x), with a constant factor C= 1/I, the variance of the primary estimator would be zero and a single sample would always give the correct result. Unfortunately, the constant C is determined by the integral we want to compute and is therefore unavailable. On the other hand, some a priori knowledge about the shape of f is often available and can be used to adjust p to reduce the variance of the estimators. Unfortunately, the constant C is determined by the integral we want to compute and is therefore unavailable. On the other hand, some a priori knowledge about the shape of f is often available and can be used to adjust p to reduce the variance of the estimators.
39
Monte Carlo Example Computing a one-dimensional integral Computing a one-dimensional integral Samples are selected randomly over the domain of the integral to get a close approximation (estimator Samples are selected randomly over the domain of the integral to get a close approximation (estimator = (1/N) Σ f(xi) / p(xi) = (1/N) Σ f(xi) / p(xi)
40
Another Example Integration over a hemisphere Integration over a hemisphere Estimate the radiance at a point by integrating the contribution of light sources in the scene Estimate the radiance at a point by integrating the contribution of light sources in the scene Light source L Light source L I = ∫L source cos dω = ∫ 0 2π ∫ 0 π/2 L source cos sin d dφ I = ∫L source cos dω = ∫ 0 2π ∫ 0 π/2 L source cos sin d dφ =(1/N)Σ (L source (ω i ) cos sin ) / p(ω i ) =(1/N)Σ (L source (ω i ) cos sin ) / p(ω i ) p(ω i ) = cos sin / π p(ω i ) = cos sin / π =(1/N)Σ L source (ω i ) =(1/N)Σ L source (ω i )
41
Steps General: General: Sampling according to a probability distribution function Sampling according to a probability distribution function Evaluation of the function at that sample Evaluation of the function at that sample Averaging these appropriately weighted sampled values Averaging these appropriately weighted sampled values Graphics: Graphics: Generate random photon paths from source (lights or pixels) Generate random photon paths from source (lights or pixels) Set a discrete random length for the path Set a discrete random length for the path Count how many photons terminate in state i, average radiances for that point Count how many photons terminate in state i, average radiances for that point
42
http://graphics.stanford.edu/courses/cs348b-02/lectures/lecture15/walk014.html
44
Advantages/Disadvantages Advantages Advantages Simple: just sample signal/function and average estimates Simple: just sample signal/function and average estimates Widely applicable: nuclear physics, graphics, high- dimensional integrations of complicated functions Widely applicable: nuclear physics, graphics, high- dimensional integrations of complicated functions Can be used with radiosity Can be used with radiosity Disadvantages Disadvantages Very slow, take many, many samples to converge to correct solution Very slow, take many, many samples to converge to correct solution Need 4x samples to decrease error by half Need 4x samples to decrease error by half
45
Monte Carlo Images
47
Photon Mapping One of the “fastest” algorithms available for global illumination One of the “fastest” algorithms available for global illumination Monte-Carlo based Monte-Carlo based 2-pass algorithm 2-pass algorithm
48
Photon Mapping, 1 st pass 1st pass 1st pass photons shot from the light into the scene photons shot from the light into the scene they bounce around interacting with all the types of surfaces they encounter they bounce around interacting with all the types of surfaces they encounter Clever twists Clever twists 1 st, instead of redoing those same computations over and over, a few thousand of time for each pixels, the photons are stored only once in a special data structure called a photon map for later reuse 1 st, instead of redoing those same computations over and over, a few thousand of time for each pixels, the photons are stored only once in a special data structure called a photon map for later reuse 2 nd, instead of trying to completely fill the whole scene with billions of photons, a few thousands to a million photons are sparsely stored and the rest is statistically estimated from the density of the stored photons. 2 nd, instead of trying to completely fill the whole scene with billions of photons, a few thousands to a million photons are sparsely stored and the rest is statistically estimated from the density of the stored photons. After all the photons have been stored in the map, a statistical estimate of the irradiance at each photon position is computed. After all the photons have been stored in the map, a statistical estimate of the irradiance at each photon position is computed.
49
Photon Mapping, 2 nd Pass Direct illumination is computed just like regular ray tracing, but the indirect illumination, which comes from the walls and other objects around, is computed from querying the stored photons in the photon map Direct illumination is computed just like regular ray tracing, but the indirect illumination, which comes from the walls and other objects around, is computed from querying the stored photons in the photon map At each secondary hit, the photon map is queried in order to gather the radiance coming from the objects around in the environment. At each secondary hit, the photon map is queried in order to gather the radiance coming from the objects around in the environment.
50
Photon Mapping Images
51
Summary Global illumination’s goal is to calculate the steady- state distribution of light energy in a scene Global illumination’s goal is to calculate the steady- state distribution of light energy in a scene BRDFs used to calculate reflection radiances BRDFs used to calculate reflection radiances Rendering Equation used to calculate the radiance sent out from an object Rendering Equation used to calculate the radiance sent out from an object Monte-Carlo techniques used to calculate irradiance at random locations throughout scene Monte-Carlo techniques used to calculate irradiance at random locations throughout scene Photon Maps used to accurately calculate caustics, inter-object reflections Photon Maps used to accurately calculate caustics, inter-object reflections
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.