Post · 16 min read· pp. 389–395

Transmittance

11.2 Transmittance

The scattering processes in Section 11.1 are all specified in terms of their local effect at points in space. However, in rendering, we are usually interested in their aggregate effects on radiance along a ray, which usually requires transforming the differential equations to integral equations that can be solved using Monte Carlo. The reduction in radiance between two points on a ray due to extinction is a quantity that will often be useful; for example, we will need to estimate this value to compute the attenuated radiance from a light source that is incident at a point on a surface in scenes with participating media.

Given the attenuation coefficient diagram, the differential equation that describes extinction,

diagram

(11.4)

can be solved to find the beam transmittance diagram, which gives the fraction of radiance that is transmitted between two points:

diagram

(11.5)

where diagram is the distance between diagram and diagram, and diagram is the normalized direction vector between them. Note that the transmittance is always between 0 and 1. Thus, if exitant radiance from a point diagram on a surface in a given direction diagram is given by diagram, then after accounting for extinction the incident radiance at another point diagram in direction diagram is

diagram

This idea is illustrated in Figure 11.9.

Figure 11.9: The beam transmittance diagram gives the fraction of light transmitted from one point to another, accounting for absorption and out scattering, but ignoring emission and in scattering. Given exitant radiance at a point diagram in direction diagram (e.g., reflected radiance from a surface), the radiance visible at another point diagram along the ray is diagram.

Not only is transmittance useful for modeling the attenuation of light within participating media, but accounting for transmittance along shadow rays makes it possible to accurately model shadowing on surfaces due to the effect of media; see Figure 11.10.

Figure 11.10: Shadow-Casting Volumetric Bunny. The bunny, which is modeled entirely with participating media, casts a shadow on the ground plane because it attenuates light from the sun (which is to the left) on its way to the ground. (Bunny courtesy of the Stanford Computer Graphics Laboratory; volumetric enhancement courtesy of the OpenVDB sample model repository.)

Two useful properties of beam transmittance are that transmittance from a point to itself is 1, diagram, and in a vacuum diagram and so diagram for all diagram. Furthermore, if the attenuation coefficient satisfies the directional symmetry diagram or does not vary with direction diagram and only varies as a function of position, then the transmittance between two points is the same in both directions:

diagram

This property follows directly from Equation (11.5).

Figure 11.11: A useful property of beam transmittance is that it is multiplicative: the transmittance between points diagram and diagram on a ray like the one shown here is equal to the transmittance from diagram to diagram times the transmittance from diagram to diagram for all points diagram between diagram and diagram.

Another important property, true in all media, is that transmittance is multiplicative along points on a ray:

diagram

(11.6)

for all points diagram between diagram and diagram (Figure 11.11). This property is useful for volume scattering implementations, since it makes it possible to incrementally compute transmittance at multiple points along a ray: transmittance from the origin to a point diagram can be computed by taking the product of transmittance to a previous point diagram and the transmittance of the segment between the previous and the current point diagram.

The negated exponent in the definition of diagram in Equation (11.5) is called the optical thickness between the two points. It is denoted by the symbol diagram:

diagram

In a homogeneous medium, diagram is a constant, so the integral that defines diagram is trivially evaluated, giving Beer’s law:

diagram

(11.7)

It may appear that a straightforward application of Monte Carlo could be used to compute the beam transmittance in inhomogeneous media. Equation (11.5) consists of a 1D integral over a ray’s parametric diagram position that is then exponentiated; given a method to sample distances along the ray diagram according to some distribution diagram, one could evaluate the estimator:

diagram

(11.8)

However, even if the estimator in square brackets is an unbiased estimator of the optical thickness along the ray, the estimate of transmittance is not unbiased and will actually underestimate its value: diagram. (This state of affairs is explained by Jensen’s inequality and the fact that diagram is a convex function.)

The error introduced by estimators of the form of Equation (11.8) decreases as error in the estimate of the beam transmittance decreases. For many applications, this error may be acceptable—it is still widespread practice in graphics to estimate diagram in some manner, e.g., via a Riemann sum, and then to compute the transmittance that way. However, it is possible to derive an alternative equation for transmittance that allows unbiased estimation; that is the approach used in pbrt.

First, we will consider the change in radiance between two points diagram and diagram along the ray. Integrating Equation (11.4) and dropping the directional dependence of diagram for notational simplicity, we can find that

diagram

(11.9)

where, as before, diagram is the distance between diagram and diagram and diagram is the normalized vector from diagram to diagram.

The transmittance is the fraction of the original radiance, and so diagram. Thus, if we divide Equation (11.9) by diagram and rearrange terms, we can find that

diagram

(11.10)

We have found ourselves with transmittance defined recursively in terms of an integral that includes transmittance in the integrand; although this may seem to be making the problem more complex than it was before, this definition makes it possible to apply Monte Carlo to the integral and to compute unbiased estimates of transmittance. However, it is difficult to sample this integrand well; in practice, estimates of it will have high variance. Therefore, the following section will introduce an alternative formulation of it that is amenable to sampling and makes a number of efficient solution techniques possible.

11.2.1 Null Scattering

The key idea that makes it possible to derive a more easily sampled transmittance integral is an approach known as null scattering. Null scattering is a mathematical formalism that can be interpreted as introducing an additional type of scattering that does not correspond to any type of physical scattering process but is specified so that it has no effect on the distribution of light. In doing so, null scattering makes it possible to treat inhomogeneous media as if they were homogeneous, which makes it easier to apply sampling algorithms to inhomogeneous media. (In Chapter 14, we will see that it is a key foundation for volumetric light transport algorithms beyond transmittance estimation.)

Figure 11.12: If the null-scattering coefficient is defined using a majorant diagram as in Equation (11.11), then it can be interpreted as taking (a) an inhomogeneous medium (dark circles) and (b) filling it with fictitious particles (light circles) until it reaches a uniform density.

We will start by defining the null-scattering coefficient diagram. Similar to the other scattering coefficients, it gives the probability of a null-scattering event per unit distance traveled in the medium. Here, we will define diagram via a constant majorant diagram that is greater than or equal to diagram at all points in the medium:

diagram

(11.11)

Thus, the total scattering coefficient diagram is uniform throughout the medium. (This idea is illustrated in Figure 11.12.)

With this definition of diagram, we can rewrite Equation (11.4) in terms of the majorant and the null-scattering coefficient:

diagram

(11.12)

We will not include the full derivation here, but just as with Equation (11.10), this equation can be integrated over the segment of a ray and divided by the initial radiance diagram to find an equation for the transmittance. The result is:

diagram

(11.13)

Note that with this expression of transmittance and a homogeneous medium, diagram and the integral disappears. The first term then corresponds to Beer’s law. For inhomogeneous media, the first term can be seen as computing an underestimate of the true transmittance, where the integral then accounts for the rest of it.

To compute Monte Carlo estimates of Equation (11.13), we would like to sample a distance diagram from some distribution that is proportional to the integrand and then apply the regular Monte Carlo estimator. A convenient sampling distribution is the probability density function (PDF) of the exponential distribution that is derived in Section A.4.2. In this case, the PDF associated with diagram is

diagram

and a corresponding sampling recipe is available via the SampleExponential() function.

Because diagram is nonzero over the range diagram, the sampling algorithm will sometimes generate samples diagram, which may seem to be undesirable. However, although we could define a PDF for the exponential function limited to diagram, sampling from diagram leads to a simple way to terminate the recursive evaluation of transmittance. To see why, consider rewriting the second term of Equation (11.13) as the sum of two integrals that cover the range diagram:

diagram

(11.14)

If the Monte Carlo estimator is applied to this sum, we can see that the value of diagram with respect to diagram determines which integrand is evaluated and thus that sampling diagram can be conveniently interpreted as a condition for ending the recursive estimation of Equation (11.13).

Given the decision to sample from diagram, perhaps the most obvious approach for estimating the value of Equation (11.13) is to sample diagram in this way and to directly apply the Monte Carlo estimator, which gives

diagram

(11.15)

This estimator is known as the next-flight estimator. It has the advantage that it has zero variance for homogeneous media, although interestingly it is often not as efficient as other estimators for inhomogeneous media.

Other estimators randomly choose between the two terms of Equation (11.13) and only evaluate one of them. If we define diagram as the discrete probability of evaluating the first term, transmittance can be estimated by

diagram

(11.16)

The ratio tracking estimator is the result from setting diagram. Then, the first case of Equation (11.16) yields a value of 1. We can further combine the choice between the two cases with sampling diagram using the fact that the probability that diagram is equal to diagram. (This can be seen using diagram’s cumulative distribution function (CDF), Equation (A.17).) After simplifying, the resulting estimator works out to be:

diagram

(11.17)

If the recursive evaluations are expanded out, ratio tracking leads to an estimator of the form

diagram

where diagram are the series of diagram values that are sampled from diagram and where successive diagram values are sampled starting from the previous one until one is sampled past the endpoint. Ratio tracking is the technique that is implemented to compute transmittance in pbrt’s light transport routines in Chapter 14.

A disadvantage of ratio tracking is that it continues to sample the medium even after the transmittance has become very small. Russian roulette can be used to terminate recursive evaluation to avoid this problem. If the Russian roulette termination probability at each sampled point is set to be equal to the ratio of diagram and diagram, then the scaling cancels and the estimator becomes

diagram

(11.18)

Thus, recursive estimation of transmittance continues either until termination due to Russian roulette or until the sampled point is past the endpoint. This approach is the track-length transmittance estimator, also known as delta tracking.

A physical interpretation of delta tracking is that it randomly decides whether the ray interacts with a true particle or a fictitious particle at each scattering event. Interactions with fictitious particles (corresponding to null scattering) are ignored and the algorithm continues, restarting from the sampled point. Interactions with true particles cause extinction, in which case 0 is returned. If a ray makes it through the medium without extinction, the value 1 is returned.

Delta tracking can also be used to sample positions diagram along a ray with probability proportional to diagram. The algorithm is given by the following pseudocode, which assumes that the function u() generates a uniform random number between 0 and 1 and where the recursion has been transformed into a loop:

optional DeltaTracking(Point p, Vector w, Float sigma_maj, Float d) { Float t = SampleExponential(u(), sigma_maj); while (t < d) { Float sigma_n = /* evaluate sigma_n at p + t * w */; if (u() < sigma_n / sigma_maj) t += SampleExponential(u(), sigma_maj); else return p + t * w; } return {}; /* no sample before d */ }