14.4 The Light Transport Equation
The light transport equation (LTE) is the governing equation that describes the equilibrium distribution of radiance in a scene. It gives the total reflected radiance at a point on a surface in terms of emission from the surface, its BSDF, and the distribution of incident illumination arriving at the point. For now we will continue only to consider the case where there are no participating media in the scene. (Chapter 15 describes the generalizations to this process necessary for scenes that do have participating media.)
The detail that makes evaluating the LTE difficult is the fact that incident radiance at a point is affected by the geometry and scattering properties of all of the objects in the scene. For example, a bright light shining on a red object may cause a reddish tint on nearby objects in the scene, or glass may focus light into caustic patterns on a tabletop. Rendering algorithms that account for this complexity are often called global illumination algorithms, to differentiate them from local illumination algorithms that use only information about the local surface properties in their shading computations.
In this section, we will first derive the LTE and describe some approaches for manipulating the equation to make it easier to solve numerically. We will then describe two generalizations of the LTE that make some of its key properties more clear and serve as the foundation for some of the advanced integrators that will be implemented in Chapter 16.
14.4.1 Basic Derivation
The light transport equation depends on the basic assumptions we have already made in choosing to use radiometry to describe light—that wave optics effects are unimportant and that the distribution of radiance in the scene is in equilibrium.
The key principle underlying the LTE is energy balance. Any change in energy has to be “charged” to some process, and we must keep track of all the energy. Since we are assuming that lighting is a linear process, the difference between the amount of energy going out and energy coming in of a system must also be equal to the difference between energy emitted and energy absorbed. This idea holds at many levels of scale. On a macro level we have conservation of power:
The difference between the power leaving an object, , and the power entering it, , is equal to the difference between the power it emits and the power it absorbs, .
In order to enforce energy balance at a surface, exitant radiance must be equal to emitted radiance plus the fraction of incident radiance that is scattered. Emitted radiance is given by , and scattered radiance is given by the scattering equation, which gives
Because we have assumed for now that no participating media are present, radiance is constant along rays through the scene. We can therefore relate the incident radiance at to the outgoing radiance from another point , as shown by Figure 14.14. If we define the ray-casting function as a function that computes the first surface point intersected by a ray from in the direction , we can write the incident radiance at in terms of outgoing radiance at :
In case the scene is not closed, we will define the ray-casting function to return a special value if the ray doesn’t intersect any object in the scene, such that is always 0.
Dropping the subscripts from for brevity, this relationship allows us to write the LTE as
The key to the above representation is that there is only one quantity of interest, exitant radiance from points on surfaces. Of course, it appears on both sides of the equation, so our task is still not simple, but it is certainly better. It is important to keep in mind that we were able to arrive at this equation simply by enforcing energy balance in our scene.
14.4.2 Analytic Solutions to the LTE
The brevity of the LTE belies the fact that it is impossible to solve analytically in general. The complexity that comes from physically based BSDF models, arbitrary scene geometry, and the intricate visibility relationships among objects all conspire to mandate a numerical solution technique. Fortunately, the combination of ray-tracing algorithms and Monte Carlo integration gives a powerful pair of tools that can handle this complexity without needing to impose restrictions on various components of the LTE (e.g., requiring that all BSDFs be Lambertian or substantially limiting the geometric representations that are supported).
It is possible to find analytic solutions to the LTE in extremely simple settings. While this is of little help for general-purpose rendering, it can help with debugging the implementations of integrators. If an integrator that is supposed to solve the complete LTE doesn’t compute a solution that matches an analytic solution, then clearly there is a bug in the integrator. As an example, consider the interior of a sphere where all points on the surface of the sphere have a Lambertian BRDF, , and also emit a constant amount of radiance in all directions. We have
The outgoing radiance distribution at any point on the sphere interior must be the same as at any other point; nothing in the environment could introduce any variation among different points. Therefore, the incident radiance distribution must be the same at all points, and the cosine-weighted integral of incident radiance must be the same everywhere as well. As such, we can replace the radiance functions with constants and simplify, writing the LTE as
While we could immediately solve this equation for , it’s interesting to consider successive substitution of the right-hand side into the term on the right-hand side. If we also replace with , the reflectance of a Lambertian surface, we have
In other words, exitant radiance is equal to the emitted radiance at the point plus light that has been scattered by a BSDF once after emission, plus light that has been scattered twice, and so forth.
Because due to conservation of energy, the series converges and the reflected radiance at all points in all directions is
This process of repeatedly substituting the LTE’s right-hand side into the incident radiance term in the integral can be instructive in more general cases. For example, the DirectLightingIntegrator integrator effectively computes the result of making a single substitution:
where
and further scattering is ignored.
Over the next few pages, we will see how performing successive substitutions in this manner and then regrouping the results expresses the LTE in a more natural way for developing rendering algorithms.
14.4.3 The Surface Form of the LTE
One reason why the LTE as written in Equation (14.13) is complex is that the relationship between geometric objects in the scene is implicit in the ray-tracing function . Making the behavior of this function explicit in the integrand will shed some light on the structure of this equation. To do this, we will rewrite Equation (14.13) as an integral over area instead of an integral over directions on the sphere.
First, we define exitant radiance from a point to a point by
if and are mutually visible and . We can also write the BSDF at as
where and (Figure 14.15).
Rewriting the terms in the LTE in this manner isn’t quite enough, however. We also need to multiply by the Jacobian that relates solid angle to area in order to transform the LTE from an integral over direction to one over surface area. Recall that this is .
We will combine this change-of-variables term, the original term from the LTE, and also a binary visibility function ( if the two points are mutually visible, and otherwise) into a single geometric coupling term, :
Substituting these into the light transport equation and converting to an area integral, we have
where is all of the surfaces of the scene.
Although Equations (14.13) and (14.15) are equivalent, they represent two different ways of approaching light transport. To evaluate Equation (14.13) with Monte Carlo, we would sample a number of directions from a distribution of directions on the sphere and cast rays to evaluate the integrand. For Equation (14.15), however, we would choose a number of points on surfaces according to a distribution over surface area and compute the coupling between those points to evaluate the integrand, tracing rays to evaluate the visibility term .
14.4.4 Integral over Paths
With the area integral form of Equation (14.15), we can derive a more flexible form of the LTE known as the path integral formulation of light transport, which expresses radiance as an integral over paths that are themselves points in a high dimensional path space. One of the main motivations for using path space is that it provides an expression for the value of a measurement as an explicit integral over paths, as opposed to the unwieldy recursive definition resulting from the energy balance equation, (14.13).
The explicit form allows for considerable freedom in how these paths are found—essentially any technique for randomly choosing paths can be turned into a workable rendering algorithm that computes the right answer given a sufficient number of samples. This form of the LTE provides the foundation of the bidirectional light transport algorithms in Chapter 16.
To go from the area integral to a sum over path integrals involving light-carrying paths of different lengths, we can now start to expand the three-point light transport equation, repeatedly substituting the right-hand side of the equation into the term inside the integral. Here are the first few terms that give incident radiance at a point from another point , where is the first point on a surface along the ray from in direction :
Each term on the right side of this equation represents a path of increasing length. For example, the third term is illustrated in Figure 14.16. This path has four vertices, connected by three segments. The total contribution of all such paths of length four (i.e., a vertex at the camera, two vertices at points on surfaces in the scene, and a vertex on a light source) is given by this term. Here, the first two vertices of the path, and , are predetermined based on the camera ray origin and the point that the camera ray intersects, but and can vary over all points on surfaces in the scene. The integral over all such and gives the total contribution of paths of length four to radiance arriving at the camera.
This infinite sum can be written compactly as
gives the amount of radiance scattered over a path with vertices,
where is on the film plane or front lens element and is on a light source, and
Before we move on, we will define one additional term that will be helpful in the subsequent discussion. The product of a path’s BSDF and geometry terms is called the throughput of the path; it describes the fraction of radiance from the light source that arrives at the camera after all of the scattering at vertices between them. We will denote it by
so
Given Equation (14.16) and a particular length , all that we need to do to compute a Monte Carlo estimate of the radiance arriving at due to paths of length is to sample a set of vertices with an appropriate sampling density in the scene to generate a path and then to evaluate an estimate of using those vertices. Whether we generate those vertices by starting a path from the camera, starting from the light, starting from both ends, or starting from a point in the middle is a detail that only affects how the weights for the Monte Carlo estimates are computed. We will see how this formulation leads to practical light transport algorithms throughout this and the following two chapters.
14.4.5 Delta Distributions in the Integrand
Delta functions may be present in terms due to both BSDF components described by delta distributions as well as certain types of light sources (e.g., point lights and directional lights). If present, these distributions need to be handled explicitly by the light transport algorithm. For example, it is impossible to randomly choose an outgoing direction from a point on a surface that would intersect a point light source; instead, it is necessary to explicitly choose the single direction from the point to the light source if we want to be able to include its contribution. (The same is true for sampling BSDFs with delta components.) While handling this case introduces some additional complexity to the integrators, it is generally welcome because it reduces the dimensionality of the integral to be evaluated, turning parts of it into a plain sum.
For example, consider the direct illumination term, , in a scene with a single point light source at point described by a delta distribution:
In other words, must be the same as the light’s position in the scene; the delta distribution in the numerator cancels out due to an implicit delta distribution in (recall the discussion of sampling delta distributions in Section 14.1.3), and we are left with terms that can be evaluated directly, with no need for Monte Carlo. An analogous situation holds for BSDFs with delta distributions in the path throughput ; each one eliminates an integral over area from the estimate to be computed.
14.4.6 Partitioning the Integrand
Many rendering algorithms have been developed that are particularly good at solving the LTE under some conditions but don’t work well (or at all) under others. For example, the Whitted integrator only handles specular reflection from delta BSDFs and ignores multiply scattered light from diffuse and glossy BSDFs. Section 16.2.2 will introduce the concept of density estimation, which is used to implement a rendering algorithm known as stochastic progressive photon mapping (SPPM). The underlying density estimation that algorithm uses works well on diffuse surfaces because scattered radiance only depends on the surface position in this case to store a 2D radiance discretization, but for glossy surfaces it becomes preferable to switch to other techniques such as path tracing.
Because we would like to be able to derive correct light transport algorithms that account for all possible modes of scattering without ignoring any contributions and without double-counting others, it is important to carefully account for which parts of the LTE a particular solution method accounts for. A nice way of approaching this problem is to partition the LTE in various ways. For example, we might expand the sum over paths to
where the first term is trivially evaluated by computing the emitted radiance at , the second term is solved with an accurate direct lighting solution technique, but the remaining terms in the sum are handled with a faster but less accurate approach. If the contribution of these additional terms to the total reflected radiance is relatively small for the scene we’re rendering, this may be a reasonable approach to take. The only detail is that it is important to be careful to ignore and with the algorithm that handles and beyond (and similarly with the other terms).
It is also useful to partition individual terms. For example, we might want to split the emission term into emission from small light sources, , and emission from large light sources, , giving us two separate integrals to estimate:
The two integrals can be evaluated independently, possibly using completely different algorithms or different numbers of samples, selected in a way that handles the different conditions well. As long as the estimate of the integral ignores any emission from large lights, the estimate of the integral ignores emission from small lights, and all lights are categorized as either “large” or “small,” the correct result is computed in the end.
Finally, the BSDF terms can be partitioned as well (in fact, this application was the reason why BSDF categorization with BxDFType values was introduced in Section 8.1). For example, if denotes components of the BSDF described by delta distributions and denotes the remaining components,
Note that because there are BSDF terms in the product, it is important to be careful not to count only terms with only components or only components; all of the terms like must be accounted for as well if a partitioning scheme like this is used.