Radiosity Overview 1 Radiometry
Total Page:16
File Type:pdf, Size:1020Kb
CS174b Computer graphics Radiosity Handout Radiosity Overview In order to create realistic images, one must understand the properties of light and the human visual system. This handout attempts to characterize the prop- erties of light and visual perception in order to provide a firm basis for the development of image synthesis algortihms. 1 Radiometry Radiometry is the study of the physical measurement of electromagnetic energy. Since light is simply one form of electromagnetic energy, the field of radiometry offers many theories and algorithms regarding the properties of light. 1.1 Radiance One of the most fundamental quantities that radiometry brings to image syn- thesis is radiance. Radiance is the power per unit projected area perpendicular to the ray, per unit solid angle in the direction of the ray and is denoted L(x, ω). We note that radiance is a function of five independant variables, three specify position and two specify direction. Radiance is extremely useful in image syn- thesis in that all other radiometric quantities can be calculated from it. We can now define the differential flux contained within a small beam as: dΦ= L(x, ω) cosθ dω dA (1.1) Where θ is the angle between the surface normal and the beam direction, dω is the differential solid angle of the beam, and dA is the differential cross-sectional area of the beam. It is important to note that the radiance in the direction of a ray is constant along the ray. This can be shown by considering the total flux contained within a differential pencil of light (see Figure 1): dΦ= L1 dω1 dA1 = L2 dω2 dA2 (1.2) 1 Figure 1: Invariance of radiance within a pencil of light 2 2 but since dω1 = dA2/r and dω2 = dA1/r , we can define: dA dA T = dω dA = dω dA = 1 2 (1.3) 1 1 2 2 r2 T is the throughput of the beam. Note that the throughput is purely a function of the geometry of the beam, therefore it directly follows that: L1 = L2 (1.4) 1.2 Irradiance Another important quantity related to radiance is irradiance. Irradiance, E, is the radiant energy per unit area incident on a surface. E = Li cosθ dω (1.5) Z Ω We can define the term cosθ dω to be the projected solid angle. This quantity can be thought of as the projection of the differential area on the surface of a sphere onto the base of the sphere (see figure Figure 2). One can note that the integral of this projected solid angle is simply the area of the base of the unit hemisphere, π. 1.3 Radiosity Radiosity, B, is similiar to irradiance. However, instead of computing the energy incident on a surface, radiosity is the energy per unit area exiting a surface. 2 Figure 2: Projected Solid Angle B = Lo cosθ dω (1.6) Z Ω 1.4 Radiant Intensity While the above quatities are extremely useful in categorizing the transport of light between surfaces, they all prove to be inadequate in describing the energy distribution of point light sources. We can easily overcome this problem by simply defining a new radiometric quantity, radiant intensity. The flux in a small beam of of differential solid angle dω is given by: dΦ ≡ I(ω)dω (1.7) 3 Where I is the radiant intensity of the light source (power per solid angle) The total flux of the light source is given by: Φ= I(ω)dω (1.8) Z Ω For an isotropic point light we can see that: Φ I = (1.9) 4π One can now determine the irradiance on a differential surface caused by a point light source by determining the solid angle of the differential area from the view of the light source. This gives: dω Φ cosθ E = I = 2 (1.10) dA 4π |x − xs| Where x denotes the position of the surface element and xs denotes the position of the light source. From this equation, one can easily see the 1/r2 fall-off of the inverse square law. 2 Rendering Equations One may now ask, given these radiometric quantities, how does one categorize the distribution of light in a given envionment? In the following sections, we will derive the rendering equation, a unified equation of light transport for a given environment as well as a simplified version of this equation known as the radiosity equation. We begin by examining how to mathematically categorize the reflection of light from surfaces. 2.1 Bidirectional Reflectance Distribution Functions Given a certain amount of light incident on a surface, we wish to calculate the amount of light reflected in a given direction. The amount of light reflected in a direction ωr is proportional to the incident irradiance from the direction ωi. More succintly: dLr(ωr) ∝ dE(ωi) (2.1) 4 The exact amount that this incident irradiance is scaled by is called the bidi- rectional reflection distribution function (BRDF). The BRDF if the ratio of reflected radiance in the direction ωr to the differential irradiance in the direc- tion ωi that creates it. Lr(ωr) fr(ωi → ωr) ≡ (2.2) Li cosθ dωi If the BRDF is physically-based, then the incident and reflected directions are interchangeable. fr(ωi → ωr)= fr(ωr → ωi) (2.3) One can also note that the BRDF is a high dimensional function (4 dimensional for the two directions and another 3 if the BRDF varies with position). However, if the BRDF is isotropic (rotating the surface about its normal does not change the BRDF), the dimensionality of the BRDF can be reduced. An isotropic surface implies: fr((θi, φi + φ) → (θr, φr + φ)) = fr((θi, φi) → (θr, φr)) (2.4) From this, one can see that an isotropic BRDF has only three degrees of freedom for direction (and possibly three for position). One can see that adding light from one incident direction has no effect on the amount reflected from other incident directions. The linearity of reflection allows one to express the total amount of light reflected by a surface in a given direction by the hemispherical integration over all possible incident directions. This is known as the reflectance equation: Lr(ωr)= fr(ωi → ωr)Li(ωi) cosθ dωi (2.5) Z Ωi 2.1.1 Mirror Reflection We now derive the BRDFs for two common reflection models, mirror reflection and pure Lambertian diffuse reflection. For a perfect mirror, all of the incoming irradiance is reflected along the mirror direction: θr = θi φr = φi ± π Lr(θr, φr) = Li(θi, φr ± π) 5 One can express this with the following BRDF: δ(θr − θi) fr,mirror = δ(φr − (φi ± π)) (2.6) cosθi The above function shows that, even for relatively simple reflection models, the BRDF can be infinite. Many times, it is easier to use a quantity ranging from 0 to 1, representing the percent of reflection. This leads to the notion of reflectance. Reflectance is defined as the ratio of reflected flux to incident flux: Lr(ωr) cosθr dωr Z dΦ Ωr r = (2.7) dΦi Li(ωi) cosθi dωi Z Ωi fr(ωi → ωr)Li(ωi) cosθi cosθr dωi dωr Z Z Ωr Ωi = (2.8) Li(ωi) cosθi dωi Z Ωi While the reflectance now is bounded from 0 to 1, it also now depends on the incoming radiance distribution, Li. This restriction can be removed if Li is assumed to be constant (uniform and isotropic). It can then be removed from the integrals yielding a relationship between reflectance and the BRDF: fr(ωi → ωr) cosθi dωi dωr Z Z Ωr Ωi = (2.9) cosθi dωi Z Ωi 2.1.2 Lambertian Diffuse Reflection In the diffuse reflection model, light is assumed to be scattered equally in all directions (independent of incident direction). This means that the BRDF is constant, giving: Lr,diffuse = fr,diffuse Li(ωi) cosθi dωi Z Ωi 6 = fr,diffuse Li(ωi) cosθi dωi Z Ωi = fr,diffuse E (2.10) The above equation shows that the reflected radiance is constant (the same in all directions). This immediately leads to a simplified equation for the radiosity: B = π Lr,diffuse (2.11) Since the reflected radiance is constant, one can show that the reflectivity is also constant: Lr(ωr) cosθr dωr Z Ωr ρdiffuse = Li(ωi) cosθi dωi Z Ωi Lr,diffuse cosθr dωr Z Ωr = E π L = r,diffuse E = π fr,diffuse (2.12) And the reflectance is related to the radiosity by: B ρ = (2.13) diffuse E 2.2 The Rendering Equation The last concept needed for the development of a comprehensive rendering equa- tion is the ability to compute the incident radiance distribution at a point, or the illumination model. Local illumination models examine only the current surface and light sources, while global models consider the entire environment to compute the incident radiance. We will begin with a look at local models, followed by a derivation of global models and conclude by incorporating these into the unifying rendering equation. 7 2.2.1 Local Illumination Local illumination models depend solely on the properties of the light sources and the surface to be shaded. For this reason, local models cannot be used to determine many lighting features such as shadows, reflections, and color bleeding. Since local models have no concept of the surrounding environment, it is assumed that all of the light reaches the surface. In order to derive the local model for point light sources, we restate the reflectance equation and the irradiance from a point light source: Lr(ωr) = fr(ωi → ωr)Li(ωi) cosθ dωi (2.14) Z Ωi Φ cosθ E = 2 (2.15) 4π |x − xs| The radiance from the point light source can then be expressed as Φ 1 Li(ωi) = 2 δ(θi − θs)δ(φi − φs) (2.16) 4π |x − xs| Where (θs, φs) defines the direction to the light source.