# How to calculate the radiance of the reflected light ray using the Blin Phong BRDF

to get the radiance of the Lambertian diffuse reflected light, I have to multiply the constant pdf (rho/pi) with the incoming intensity I0*cos(theta_i), where cos(theta_i) is given by the scalar Product <n *I> and n is the normal vector for this problem (correct?). Now, if I add the Phong BRDF I'm confused. In the pdf here, there is an <n * I> in the denominator or not. In the first case the reflected intensity is proportional to <n * I>, but not in the second case. What's right?

Uwe

I believe you have a misunderstanding for the BRDF sampling process: PDF can be almost arbitrary if PDF is non-zero at the correspondig point where the integrand is non-zero. We don't even have to importance sampling BRDF just for simplicity (though uniformly sampling everything can be extremely inefficient). So, "in the pdf here", we don't know whether there should be a cosine term unless we know exactly what kind of sampling method you are using.

Normally, we wish to be more efficient so we will importance-sample the integrand, then we wish to match the sampling PDF with the integrand as closely as possible . So, let's therefore look at the Blinn-Phong (or Phong) BRDF, it has a power cosine term so the best practice is to use power cosine-weighted hemisphere sampling, but the original cosine hemisphere sampling would work, too. For these two sampling methods, you can refer to Sampling the hemisphere, which has thorough explanation and derivation for how you get the sample and its PDF.

So for your question: Lambertian BRDF indeed has a cosine term which means that your are correct, Phong and Blinn-Phong have power cosine term so the throughput is proportional to $$(\cos\theta)^\alpha$$, but it won't hurt to use the same sampling method as Lambertian BRDF and get the same PDF for each sample, though it's suboptimal.

BTW, I think your question should be improved in the following ways:

• Clearly list your question and related subjects. For example, I am not sure whether you are confused about Phong model or Blinn-Phong model since these two differ in what kind of vector they sample. For clearer understanding of sampling Blinn-Phong model, you can refer to another answer of mine sampling-of-the-blinn-phong-brdf-in-pathtracing.

Update for further explanation, and I need to remind you that you can comment below my answer or my comment instead of posting your own answer.

Well let's get this straight. The following figure shows the local light interaction: So, your modified Phong BRDF is actually: $$k_d \frac{1}{\pi} + k_s \frac{n+2}{2\pi}\cos^n\alpha$$ Yes, like I said, there is only one cosine term in the BRDF, which is $$\cos\alpha$$. Note that 'outgoing' direction is $$\pmb{v}$$ since this follows the convention of light tracing.

So are we done? No, the surface rendering equation is: $$I(x, w) = \int_{\Omega}f(x, w, w')dw'$$ and here, $$$$ means normalized dot product (cosine). So it doesn't matter whether you are dealing with diffusive lobe or specular lobe (unless it is mirror-specular), $$\cos\theta$$ always follows. You can find this in the code of PBR-book (from pbrt-v3, src/integrator/path.cpp):

// Account for the indirect subsurface scattering component
Spectrum f = pi.bsdf->Sample_f(pi.wo, &wi, sampler.Get2D(), &pdf,
BSDF_ALL, &flags);
if (f.IsBlack() || pdf == 0) break;
beta *= f * AbsDot(wi, pi.shading.n) / pdf;


You see, pi.bsdf->Sample_f will evaluate BRDF value and assign it to f, but to get the real path through put beta, one must have $$\cos\theta$$ (AbsDot(wi, pi.shading.n)) since this is the geometry term that would convert the solid angle measure to area product measure (see Veach Chapter 8: A Path Integral Formulation of Light Transport for more information on this topic). So the problem falls back to: (1) I need to incorporate all cosine term to get the correct radiance (but for BRDF evaluation, $$\cos\theta$$ is not needed) (2) the PDF in the denominator (as I explained in the upper part of this answer).

thanks a lot for your given informations! Let me summarize what I want to do:

1. I have a sun ray (parallel light) which is reflected at the inner wall of a cylinder,i.e. I have the input vector and direction theta_in.

2. From this I can calculate the reflected vector. Now, I can generate a outgoing vector with the help of importance sampling of the - say modified Phong model. How to do this is given in the Lafortune & Williams paper.

3. If I'm correct, this modified Phong model includes the input direction via the cosine term which gives the cosine between the perfect specular reflective direction and the outgoing direction.

4. The diffusive part of the modified Phong model doesn't include any input direction.

5. Is it correct to multiply these values by I0*cos(theta_in) in order to get the output intensity?

Thanks again,

Uwe

• If I recall correctly, the power cosine term in modified Phong BRDF is the cosine value between reflected light direction and the outgoing direction. There should be yet another cosine term representing the geometry term $n\cdot l$. So there should be two different cosine terms. You should multiply mod-Phong power cosine with $I_0 \cos\theta_{in}$. However, diffusive part does include input direction from the emitter (its own cosine term $n\cdot l$). That is, almost all the surface reflection should carry this cosine attenuation term after being multiplied by its own BRDF throughput. Oct 7 at 14:46

thanks Enigmatisms for your answer. But unfortunately I thought it is just the other way around..... Is there anybody else who can contribute to this problem.

Rereading your first (edited?) answer, I came to the conclusion, that if f is the modified Phong probability function, then both parts have to be multiplied by the cosine of the angle between the incoming light ray and the oütgoing one. Correct?

Uwe

• I edit my answer to give more information on this topic, you can take a look at it. Oct 8 at 2:14
• Yes, but be sure to distinguish between probability function $p(x)$ and evaluation function $f(x)$ (MC estimator is $f(x) / p(x)$). f is, more precisely, modified Phong BRDF evaluation function (which is the nominator). The denominator (PDF) can have any form. Oct 8 at 15:17