**Page updated:**
April 14, 2020 **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 photon packets 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 reﬂected photon packet whenever a photon packet hits the bottom. This is a tricky business, and the step-by-step process is as follows.

Given: A photon packet with weight ${w}_{i}$ is incident onto the surface in direction $\left({\mathit{\theta}}_{i},{\varphi}_{i}\right)$. The BRDF of the surface is known.

Needed: The weight ${w}_{r}$ and direction $\left({\mathit{\theta}}_{r},{\varphi}_{r}\right)$ of the reﬂected photon packet.

Since the input direction $\left({\mathit{\theta}}_{i},{\varphi}_{i}\right)$ is known, $BRDF\left({\mathit{\theta}}_{i},{\varphi}_{i},{\mathit{\theta}}_{r},{\varphi}_{r}\right)$ can be viewed as an (unnormalized) bivariate PDF for the reﬂected angles ${\mathit{\theta}}_{r}$ and ${\varphi}_{r}$. Note that, in general, these angles are correlated. Proceed as follows:

- 1.
- Compute the directional-hemispherical reﬂectance for the given $\left({\mathit{\theta}}_{i},{\varphi}_{i}\right)$:
- 2.
- The reﬂected packet weight is then ${w}_{r}={\rho}^{dh}\left({\mathit{\theta}}_{i},{\varphi}_{i}\right){w}_{i}$.
- 3.
- Compute the cumulative distribution function (CDF) for
${\varphi}_{r}$
by
Note that the directional-hemispherical reﬂectance is being used to convert the BRDF into a normalized bivariate PDF for ${\mathit{\theta}}_{r}$ and ${\varphi}_{r}$. We are then ”integrating out” the ${\mathit{\theta}}_{r}$ dependence to leave a PDF for ${\varphi}_{r}$, which is then being used to construct the CDF for ${\varphi}_{r}$.

- 4.
- Draw a random number $\Re $
from a uniform [0,1] distribution. Solve the equation
$$\Re \phantom{\rule{1em}{0ex}}=\phantom{\rule{1em}{0ex}}CD{F}_{\varphi}\left({\varphi}_{r}\right)$$ (4) for ${\varphi}_{r}$. This is the randomly determined azimuthal angle of the reﬂected photon packet.

- 5.
- Compute the CDF for angle ${\mathit{\theta}}_{r}$
from
Note that the angle ${\varphi}_{r}$ determined in step 4 is used in the BRDF in Eq. (4) when evaluating the $\mathit{\theta}$ integrals. This is how the correlation between ${\mathit{\theta}}_{r}$ and ${\varphi}_{r}$ is accounted for in the determination of the reﬂection angles.

- 6.
- Draw a new random number $\Re $
from a uniform [0,1] distribution and solve the equation
$$\Re \phantom{\rule{1em}{0ex}}=\phantom{\rule{1em}{0ex}}CD{F}_{\mathit{\theta}}\left({\mathit{\theta}}_{r}\right)$$ (6) for ${\mathit{\theta}}_{r}$. This is the randomly determined polar angle of the reﬂected photon packet. You can now send the new photon packet on its way.

For all but the simplest BRDFs, Eqs. (1) to (5) all must be evaluated numerically for each photon packet, which can be an enormous computer cost when millions of photon packets are being traced.

#### A Simple Example

The Minnaert BRDF is

[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 reﬂector, 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 $k=0$ this reduces to the Lambertian BRDF. Equations (1) to (5) can be evaluated analytically for the Minnaert BRDF. Equation (1) evaluates to

which reduces to ${\rho}^{dh}=\rho $ for a Lambertian surface. Equation (2) gives just

Inserting this into Eq. (3) and solving for ${\varphi}_{r}$ gives

Thus the azimuthal angle is uniformly distributed over 2$\pi $ radians. The CDF for ${\mathit{\theta}}_{r}$ as given by (4) is

Equation (5) then gives

after noting that $1-\Re $ has the same uniform distribution as $\Re $. For a Lambertian surface, the randomly generated ${\mathit{\theta}}_{r}$ angles are distributed as ${cos}^{-1}\left(\sqrt{\Re}\right)$, which certainly is not intuitive. However, this distribution is precisely what is necessary to make the number of reﬂected photons per unit solid angle proportional to $cos{\mathit{\theta}}_{r}$, as required for a Lambertian surface.