• Create Account

# Trying to understand the BRDF Equation

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

9 replies to this topic

### #1ZBethel  Members   -  Reputation: 544

Like
0Likes
Like

Posted 27 May 2012 - 10:01 PM

I'm trying to wrap my head around the mathematics behind the BRDF. I think I understand Radiance and Irradiance: irradiance is the flux through a projected area. In the case of the BRDF, irradiance means the flow of energy through the projected area that represents the point on the surface where we are evaluating the lighting equation. Radiance is the flow of energy through the projected area with respect to a solid angle.

The BRDF is defined as fr(wi, wo) = dL(wi) / dE(wo), where wi and wo are the incident and exitant solid angles.

According to wikipedia, this equation expands to fr(wi, wo) = dL(wi) / L(wi) * cos(theta) * dw. From what I can tell, this is the differential outgoing radiance divided by the incoming radiance along the incident solid angle, multiplied by the cosine of the azimuth angle (to account for the projected area term), multiplied by the differential solid angle.

My question is, if L is the energy evaluated along the incident differential solid angle, what does the differential of Radiance mean? To clarify, why do we need dL when L is effectively giving us the light energy along a single ray of light? Also, in the denominator, we have the radiance term, L, multiplied by the cosine of the angle (which I understand to be projecting the incident radiance onto the surface). Why is that L instead of dL?

Thanks.

Edited by ZBethel, 27 May 2012 - 10:56 PM.

### #2MJP  Moderators   -  Reputation: 8773

Like
3Likes
Like

Posted 28 May 2012 - 01:48 AM

Hey Zach,

You actually have those equations wrong. It should be like this:

This is basically saying that your BRDF function describes a ratio between differential output radiance towards the viewer, and differential incident irradiance. It's defined this way because overall what you do with your BRDF is determine the total radiance towards the viewer given the total incident irradiance on the surface. To compute irradiance you integrate incident radiance times cosine theta, which gives you this familiar equation:

In the case of this integral, the differential radiance is just an infinitesimally small portion of the total output radiance in the direction of the viewer. So you can imagine that by integrating you're just making a trip over the hemisphere, and calculating some fraction of the total outgoing radiance by computing the incident radiance from the set of directions given by the differential solid angle.

As for why you use Li and not dLi, you compute incident irradiance by integrating incident radiance * cos(theta) over the hemisphere. From this we can reason that differential irradiance for some infinitesimally small solid angle is equivalent to the incident radiance from that solid angle. You actually have this in the denominator of the first equation I posted:

Does that make sense?

### #3Tsus  Members   -  Reputation: 954

Like
0Likes
Like

Posted 29 May 2012 - 03:25 PM

Does that make sense?

Perfectly!

Though, for consistency I’d say that in the attached thumbnail it should say instead of , too. Anyway, it’s clear what you mean.

Personally, I like to think of the BRDF as the function “converting” the differential incoming irradiance into the differential outgoing radiance toward the viewer . This is just your first equation rearranged to:

Integrating over the hemisphere gives the rendering equation nice and short:

I like this angle more than the “ratio” explanation, though they of course mean the same thing.
Best regards

Acagamics e.V. – IGDA Student Game Development Club (University of Magdeburg, Germany)

### #4MJP  Moderators   -  Reputation: 8773

Like
0Likes
Like

Posted 29 May 2012 - 05:47 PM

Though, for consistency I’d say that in the attached thumbnail it should say instead of , too. Anyway, it’s clear what you mean.

Yeah I screwed it up the first time I generated the image and attached it. The one in the actual post should be correct.

### #5Tsus  Members   -  Reputation: 954

Like
0Likes
Like

Posted 30 May 2012 - 12:18 AM

Though, for consistency I’d say that in the attached thumbnail it should say instead of , too. Anyway, it’s clear what you mean.

Yeah I screwed it up the first time I generated the image and attached it. The one in the actual post should be correct.

Never mind, this was just me being pedantic.
The post is very good and a nice refresher.

Acagamics e.V. – IGDA Student Game Development Club (University of Magdeburg, Germany)

### #6ZBethel  Members   -  Reputation: 544

Like
0Likes
Like

Posted 01 June 2012 - 10:13 PM

Hey Matt,

Yes, thank you very much, your explanation helped a ton. I was trying to write up the post while watching a movie, which is probably why I got the equations backwards.

I think the main part that confused me was the fact that we are summing (or integrating) over all of the differential outgoing radiance values (each of which have their infinitesimal incoming radiance that altogether compose the incoming irradiance). Do I have that right?

I noticed that in the integral we are solving for the total outgoing radiance along a given direction. It is a function that requires the BRDF to solve. It seems like somewhat of a circular definition that the BRDF includes the (diffferential) outgoing radiance as a variable, which is what we really want! I'm assuming that in practical implementations, the BRDF is a known equation of some kind that specifies the reflection ratios? I'm having a bit of a hard time mapping the theoretical into the practical implementation. I know Blinn Phong shading is a horrible example (because it lacks conservation of energy, and it's not physically accurate in any way), but is the specular component where we take the dot product between the half vector and normal technically the "BRDF" portion of the lighting equation? I hope that makes sense.

Thanks!
Zach.

Edited by ZBethel, 01 June 2012 - 10:14 PM.

### #7Tsus  Members   -  Reputation: 954

Like
2Likes
Like

Posted 02 June 2012 - 02:27 AM

Hi Zach,

I think the main part that confused me was the fact that we are summing (or integrating) over all of the differential outgoing radiance values (each of which have their infinitesimal incoming radiance that altogether compose the incoming irradiance). Do I have that right?

Yes, that’s right. Each differential incoming irradiance contributes a little to the total outgoing radiance. We simply sum up all (differential) contributions.

I noticed that in the integral we are solving for the total outgoing radiance along a given direction. It is a function that requires the BRDF to solve. It seems like somewhat of a circular definition that the BRDF includes the (diffferential) outgoing radiance as a variable, which is what we really want! I'm assuming that in practical implementations, the BRDF is a known equation of some kind that specifies the reflection ratios?

This is exactly why I don’t like much the ratio explanation of what the BRDF is. Formally, the BRDF is defined as the ratio between differential outgoing radiance and differential incoming irradiance (see Matt's post before):

In practice we want to know the outgoing radiance, thus we rearrange to
.
Now, it’s obvious that the BRDF must be something given to us. The BRDF now "converts" the differential incoming irradiance to the differential outgoing radiance.

I know Blinn Phong shading is a horrible example (because it lacks conservation of energy, and it's not physically accurate in any way), but is the specular component where we take the dot product between the half vector and normal technically the "BRDF" portion of the lighting equation?

You can normalize the Blinn-Phong model to make it energy conserving. Then, it's not sooo bad anymore. ;)
And yes, you're right. Let me wrap things up:
First of, the dot product between normal and light is not contained in the BRDF. It is already contained in the incoming irradiance. The differential incoming irradiance is the product of the dot product between light vector and normal and the differential incoming(!) radiance. (See Matt's post.)

The simple Phong BRDF without any normalization is:

Whereas and are the material’s diffuse and specular color (in other words the amount of flux reflected per color channel) and is the angle between eye vector and reflection vector (or in blinn-phong the half vector and the normal).

With the normalization the Blinn-Phong BRDF is:

(The factors are individually obtained by integrating the BRDF weighted by the dot product of normal and light over the hemisphere.)

Well, and for the classic Phong BRDF it is:

Hope this helped a little.

Acagamics e.V. – IGDA Student Game Development Club (University of Magdeburg, Germany)

### #8Tasty Texel  Members   -  Reputation: 1065

Like
0Likes
Like

Posted 02 June 2012 - 10:26 AM

The actual normalization factor for Blinn-Phong seems to be a bit more complicated according to this paper I found some time ago: http://www.farbrausc...stuff/phong.pdf

Edited by Bummel, 02 June 2012 - 10:26 AM.

### #9MJP  Moderators   -  Reputation: 8773

Like
1Likes
Like

Posted 03 June 2012 - 03:00 PM

It's not really a circular definition...it's just rearranging an equation. If you say that y = z * x then you can also say that z = y / x. In practical terms for graphics you're never going to "solve" for the BRDF, you're going to start with one based on some material model you're using for the surface and use that to solve for outgoing radiance.

Here's a really simple Blinn-Phong example for a directional light:
// Compute incident irradiance
float3 Ei = LightColor * saturate(dot(Normal, LightDirection));

// Compute the BRDF for the given normal + light direction + view direction
float3 HalfVector = normalize(LightDirection + ViewDirection);
float3 BRDF = pow(saturate(dot(Normal, HalfVector), SpecularExponent);

// Calculate outgoing radiance by applying the BRDF to incident irradiance
float3 Lo = BRDF * Ei;


### #10ZBethel  Members   -  Reputation: 544

Like
0Likes
Like

Posted 03 June 2012 - 10:34 PM

Sweet, thanks guys. I'm understanding this a lot better now.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS