The Rendering Equation and BRDFs

The Lambertian Diffuse BRDF is one of the most commonly used BRDFs in computer graphics as it is very cheap to evaluate while providing decent results visually. Most people who have dabbled into computer graphics or written shaders will know the BRDF as 1/\pi

The aim of this blog post is to explore the 1/\pi further and consider its physical implications as well as provide insight on how it was derived to get a better understanding of BRDFs in general.

Before proceeding further, a general recap of radiometry is necessary. The intent with BRDFs is to simulate light interaction, and so it pays off to think of this interaction in terms of physical quantities.

  • Radiant flux, denoted by \Phi _{e}. Radiant flux is the radiant energy emitted, reflected, transmitted or received, per unit time. It has units of J s^{-1}. which is also known as watts.
  • Radiant intensity, denoted by I _{e, \Omega}. Radiant flux is the radiant flux per unit solid angle. As such, it has units W sr^{-1}.
  • Irradiance, denoted by E_{e}. Irradiance is the radiant energy received by a surface, per unit area. As such it has units W m^{-2}.
  • Radiance, denoted by L _{e, \Omega}. Radiance is the radiant flux emitted, reflected, transmitted or received by a given surface, per unit solid angle per unit projected area. As such it has units W sr^{-1} m^{-2}.

The above, and the rest of this post, assumes you have a working understanding of what solid angles are, if not it then it is recommended to read about that first.

 

Armed with the above information, let us now consider what a BRDF actually is. To do this, it helps to look at the rendering equation:

L_{o} = L_{e} + \int_\Omega L_{i} \cdot f_{r} \cdot cos\theta_{i}  \, \mathrm{d} \omega_{i}       Eq.1

L_{o} is the out going radiance in the direction o. L_{e} is the out going radiance emitted by the surface. The last term is the integral of the incoming radiance weighted by the cosine of the angle between the surface normal and the incoming direction and also weighted by the BRDF. The integral is over the hemisphere oriented around the surface normal.

The integral basically says, collect the incoming radiance from all directions visible to the hemisphere, which is why we integrate over \Omega. Remember that we said that the units of radiance was W sr^{-1} m^{-2}, if we look at the measure of the integral, we have \mathrm{d} \omega_{i}, which has units sr. If we multiply those 2 units together, we find that the sr cancels out, and we are left with W m^{-2}, which we previously said is the units for irradiance. This should make intuitive sense, the aim of this integral is to collect all the radiant flux incoming to this surface, which has some finite area. Now what does the cos\theta term exist for? Let us look at the following image:

Untitled Diagram

Assume the green surface has an area of A. However in the slanted direction, the apparent surface area of the green surface is different, it is larger. Imagine a beam of photons being emitted perpendicular to the green surface. The area of the black surface that receives these photons is much larger from the slanted direction, than it is from the straight direction. If the green surface is emitting a constant radiant flux, then at grazing angles, the same radiant flux is spread over a larger receiving surface area, and thus we have less radiant flux per unit area. This can also be thought of in another way; given a fixed size receiving surface of area A, then the apparent size of A changes from the lights perspective based on the angle between the light direction and receiving surface normal. At grazing angles, the receiving surface appears smaller to the light, by a factor of cos\theta_{i}, and in L_{i} the m^{-2} component is the area of the receiving surface as seen by the light in the direction i.

A notion that might help make this intuitive is thinking about what happens if you have a torch light. If you point the torch directly perpendicular to the floor, the light received by the floor appears bright. If however you point the torch light at a grazing angle , the light smears across a larger surface area, and appears dimmer.

We can see all of the above reflected in the standard units of radiance, which is radiant flux per unit solid angle per unit projected area. We note that L_{i} is the incoming radiance seen if the normal of the receiving surface is parallel to the incoming direction i. However, as shown, at grazing angles, the incoming radiance is weaker as perceived by the receiving surface. We account for this with cos\theta_{i}.

Knowing all this, we can say the following:

E_{e} = \int_\Omega L_{i}  \cdot cos\theta_{i} \, \mathrm{d} \omega_{i}      Eq.2

The irradiance is given by integrating over all incoming radiance weighted by the projected area of the receiving surface in the direction of the incoming light directions. This makes physical sense, we collect all incoming radiant energy per unit area over the hemisphere, and this gives us the outgoing radiant energy per unit area.

The last term in the rendering equation is the BRDF, which was denoted by f_{r}. The BRDF can be described mathematically as the ratio of differential outgoing radiance, to the differential irradiance:

f_{r} = \frac{\partial L_{o}(\omega_{o})}{\partial E_{e}(\omega_{i})}     Eq.3

Differential radiance can be thought of as the infinitesimal quantity of radiance reflected in a very small solid angle around the outgoing direction. Differential irradiance can be thought of as the infinitesimal quantity of irradiance received from a direction in a very small solid angle around the incoming direction.

We can rewrite differential irradiance as:

{\partial E_{e}(\omega_{i})} = L_{i}  \cdot cos\theta_{i} \, \mathrm{d} \omega_{i}     Eq.4

And then we can substitute Eq.4 into Eq.3 for differential irradiance, and then rearrange the terms to get the following:

{\partial L_{o}(\omega_{o})} = f_{r} \cdot L_{i}  \cdot cos\theta_{i} \, \mathrm{d} \omega_{i}     Eq.5

Eq.5 gives us the differential radiance, and clearly if we integrate this over the hemisphere, we will get the total radiance in the outgoing direction, which brings us back to Eq.1 (ignoring the emitted radiance of the surface, as that is not relevant to the BRDF).

So thus we see that the BRDF relates irradiance to outgoing radiance. It is worth mentioning that, radiance and irradiance differ in units by  sr^{-1}, which means the BRDF must have units sr^{-1}. The BRDF typically depends both on the incoming direction, and the outgoing direction, and so we can rewrite it as f_{r}(\omega_{o}, \omega_{i}).

The key about BRDFs is that they must be energy conserving. We cannot reflect more radiant flux than we receive as that would violate the laws of energy conservation, and so too must our BRDF follow if we wish for it to be physically plausible. Let us consider a simplified case for incoming light from a single direction.

Assume we have the differential irradiance L_{i}(\omega_{i})  \cdot cos\theta_{i} \, \mathrm{d} \omega_{i},  where if light is only coming from a single direction \omega_{i} then if we also assume some constant area for the receiving surface, then the entire expression becomes a constant, where we have radiance * unit of area * unit of solid angle, which will leave us with watts.

Now let us look back at what BRDFs actually are. Earlier we said that mathematically they are the ratio of differential outgoing radiance, to differential irradiance. We can describe this physically in another way;  Walter et al 2007 describes the BRDF as the “fraction of incident energy scattered in a mode”, I will extend it further to say “fraction of incident energy scattered in an outgoing direction weighted by the inverse of the projected area in the outgoing direction”. What I mean when I say this is, a bunch of energy is incident onto our receiving area, and based on the properties of the receiving surface, different quantities of energy are scattered across all outgoing directions of the hemisphere. However, energy reflected in an outgoing direction is radiant intensity, the BRDF must produce radiance, and thus it must also account for the projected area of the surface in the outgoing direction. The last part is important and can be observed fundamentally in the derivations of BRDFs, as we will now explore.

We will try to observe this description of the BRDF by looking at the Lambertian BRDF. The Lambertian BRDF is known as a BRDF that has constant radiance, independent of viewing direction, but how this was derived is not always understood. The foundation of it lies in Lambert’s cosine law. Wikipedia reads “Lambert’s cosine law says that the radiant intensity or luminous intensity observed from an ideal diffusely reflecting surface or ideal diffuse radiator is directly proportional to the cosine of the angle θ between the direction of the incident light and the surface normal.” Note that in this description, direction of incident light is with respect to the observer, which means it is the direction of outgoing light with respect to the surface. This basically says that the number of photons per unit solid angle is dependent on the viewing direction and the surface normal, following a cosine distribution. The following image more clearly illustrates this:

aaj0u

As we can see, the outgoing radiant intensity forms a cosine lobe around the surface normal. So we can start forming our Lambertian BRDF with this, we can say that there is some irradiance, and then the radiant intensity reflected from that irradiance follows a cosine distribution, so we have cos(\theta_{o}) so far as the function that determines the fraction of incident energy reflected in a direction. However, as stated before, the BRDF must relate incident energy (irradiance) to radiance, so it is not enough to just define the distribution of energy, we must also factor in projected area. The question now is, how do we bring projected area into our incomplete BRDF? Well, at viewing directions that are almost orthogonal to the emitting surface normal, the apparent surface area of the emitting surface from the viewers perspective is very small. In fact, the emitting surface appears the largest when viewing it from a direction parallel to its normal, and then it drops off the greater the angle between the normal and the viewing direction. However, for a given radiant intensity, the smaller the apparent area of the emitting surface, the larger the radiance. Thus radiance is inversely proportional to cos(\theta_{o}), and we must incorporate it into our BRDF as such. Using Lambert’s cosine law, and accounting for projected area, we have \frac{cos(\theta_{o})}{cos(\theta_{o})}, which is just 1. This matches what we know about Lambertian diffuse, that radiance is independent of viewing direction.

However we do not yet have the well known \frac{1}{\pi} In order to reach that form, we need to go ahead and normalize the BRDF, by forcing an energy conserving constraint on it. There are many different explanations for the energy conservation constraint, I will present the one that makes most physical sense for me. If the BRDF is fundamentally a fraction of incident energy scattered in an outgoing direction weighted by its apparent area, then if we undo the apparent area weighting, we should be left with a function that gives the fraction of incident energy scattered in an outgoing direction. Thus that would form f_{r}(\omega_{i}, \omega_{o}) \cdot cos\theta_{o} as our function relating incident energy and outgoing energy. Energy conservation dictates that total outgoing energy must be equal to total incident energy, where total outgoing energy is obtained by integrating the outgoing energy in all directions over the hemisphere. If f_{r}(\omega_{i}, \omega_{o}) \cdot cos\theta_{o} is fundamentally a distribution of energy, then it must integrate to 1. So we have the constraint:

1 \geq \int_\Omega f_{r}(\omega_{i}, \omega_{o}) \cdot cos\theta_{o} \, \mathrm{d} \omega_{o}

For the Lambertian BRDF we have built so far, we have f_{r}(\omega_{i}, \omega_{o}) = 1, which we can plug into our constraint above and then solve the resulting integral to find our normalization factor for energy conservation. We transform from solid angle to spherical coordinates to make the integral easier to solve, where the jacobian determinant of this transformation is sin(\omega_{o}) giving us the integral:

\int_0^{\pi/2} \int_0^{2\pi} 1 \cdot cos(\theta) \cdot sin(\theta) \, \mathrm{d}\phi \mathrm{d}\theta

If we evaluate this integral, the result will be \pi, and since our energy conservation constraints dictates that this must evaluate to 1, it tells us that our normalization factor is \frac{1}{\pi} which leads us to the well known Lambertian diffuse BRDF.

 

Leave a comment