Page updated:
May 21, 2021
Author: Curtis Mobley
View PDF
The BRDF as a PDF
Equation (4) of The BRDF page,
shows how the BRDF is used in the radiative transfer equation (e.g., in HydroLight), which is always working with radiances. In Monte Carlo simulations, you are tracking many individual rays as they interact with the medium and its boundary surfaces. In this case, the BRDF must be used as a probability distribution function (PDF) to determine the direction and weight of the reflected ray whenever a ray hits the boundary surface. This is a tricky business, and the step-by-step process is as follows.
Computing the Reflected Ray Weight and Direction from a BRDF
Given: A ray with weight is incident onto the surface in direction . The BRDF of the surface is known.
Needed: The weight and direction of the reflected ray.
Since the input direction is known, can be viewed as an (unnormalized) bivariate PDF for the reflected angles and . Note that, in general, these angles are correlated. Proceed as follows:
- 1.
- Compute the directional-hemispherical reflectance for the given :
- 2.
- The reflected ray weight is then
(2) - 3.
- Compute the cumulative distribution function (CDF) for
by
(3) Note that the directional-hemispherical reflectance is being used to convert the BRDF into a normalized bivariate PDF for and . We are then “integrating out” the dependence to leave a PDF for , which is then being used to construct the CDF for .
- 4.
- Draw a random number
from a uniform [0,1] distribution. Solve the equation
(4) for . This is the randomly determined azimuthal angle of the reflected ray.
- 5.
- Compute the CDF for angle
from
(5) Note that the angle determined in step 4 is used in the BRDF in Eq. (5) when evaluating the integrals. This is how the correlation between and is accounted for in the determination of the reflection angles.
- 6.
- Draw a new random number
from a uniform [0,1] distribution and solve the equation
(6) for . This is the randomly determined polar angle of the reflected ray. You can now send the new ray on its way.
For all but the simplest BRDFs, Eqs. (1) to (6) all must be evaluated numerically for each ray, which can be an enormous computer cost when billions of rays are being traced.
A Simple Example
The Minnaert BRDF is
(7) |
[Comment: This BRDF was invented to explain the curious fact that the full moon appears almost uniformly bright from the center to the edge of the lunar disk. If the lunar dust were a Lambertian reflector, the full moon would appear bright at the center and darker at the edge. However, the Minnaert BRDF agrees with observation over only a limited range of angles.]
Note that for this reduces to the Lambertian BRDF. Equations (1) to (6) can be evaluated analytically for the Minnaert BRDF. Equation (1) evaluates to
which reduces to for a Lambertian surface. Equation (3) gives just
Inserting this into Eq. (4) and solving for gives
Thus the azimuthal angle is uniformly distributed over 2 radians. The CDF for as given by (5) is
Equation (6) then gives
after noting that has the same uniform distribution as . For a Lambertian surface, the randomly generated angles are distributed as , which certainly is not intuitive. However, this distribution is precisely what is necessary to make the number of reflected rays per unit solid angle proportional to , as required for a Lambertian surface. See the additional discussion of this on the Lambertian BRDFs page.