Jump to content
  • Advertisement
Sign in to follow this  
Pilpel

Phong model BRDF

This topic is 924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can someone explain the next quote from Real-Time Rendering, section 7.6?

 

2VyeQ.png

 

Why is the outgoing radiance equal to 0 when the angle between n and l is <= 0?

 

The author then explains a few things, getting to the next BRDF which I understand:

Image.png (equation 7.46)

 

But right after that, he says: "The directional-hemispherical reflectance of the specular term can now be calculated. It turns out that when Theta = 0, it reaches a maximum value of 2*Cspec / (m+2)."

 

How did he get that? First, theta isn't present in equation 7.46, and second, I can't see any possible way to get to the term he wrote.

Here's the whole quote from the book

 

Image.png

Edited by Pilpel

Share this post


Link to post
Share on other sites
Advertisement

Why is the outgoing radiance equal to 0 when the angle between n and l is <= 0?

Because the surface is back-facing from the light's point of view. The rendering equation itself -- which the BRDF plugs into -- multiplies the entire BRDF by N?L, so having this condition within the BRDF is actually superfluous. I guess it's just mentioned because most realtime renderers actually don't implement the rendering equation properly, so that condition is required to avoid getting specular highlights on the wrong side of an object.

 

As for the rest, this cosm term seems weird. Phong is based around (L?reflect(V,N))m, which is equivalent to cos(?r)m, where ?r is the angle between the reflection direction and the light direction...

Share this post


Link to post
Share on other sites

I don't get it. When does theta ever become negative? When it's 0, n and l point to the same direction, so how can the surface be backfacing?

 

One more question: in the shader code itself, gl_FragColor will eventually be Lo (outgoing radiance), or the BRDF itself?

Edited by Pilpel

Share this post


Link to post
Share on other sites

I don't get it. When does theta ever become negative? When it's 0, n and l point to the same direction, so how can the surface be backfacing?

 

One more question: in the shader code itself, gl_FragColor will eventually be Lo (outgoing radiance), or the BRDF itself?

Oh, hahah I typed all that and didn't notice the problem...

It should actually be testing whether cos(?) is above or below zero -- i.e. whether ? is below or above 90º!

 

Yeah in a traditional Phong shader, Lo is the result.

Share this post


Link to post
Share on other sites

Damn with this book. It's supposed to be a standard yet it fails sometimes. I spent too much time figuring out why the hell he notes ? <= 0.

Share this post


Link to post
Share on other sites

 

Why is the outgoing radiance equal to 0 when the angle between n and l is <= 0?

Because the surface is back-facing from the light's point of view. The rendering equation itself -- which the BRDF plugs into -- multiplies the entire BRDF by N?L, so having this condition within the BRDF is actually superfluous. I guess it's just mentioned because most realtime renderers actually don't implement the rendering equation properly, so that condition is required to avoid getting specular highlights on the wrong side of an object.
 
As for the rest, this cosm term seems weird. Phong is based around (L?reflect(V,N))m, which is equivalent to cos(?r)m, where ?r is the angle between the reflection direction and the light direction...

 


It's not cosm, it's cosm?r, where ?r is the angle between the light direction and the reflected view direction.

Share this post


Link to post
Share on other sites

Hi again, although I don't like this chapter of the book it does explain mandatory stuff.

A few questions:

 

1. What's a "reflectance value"? As mentioned twice in:

Image.png

 

2. If the "specular term" is the whole right term in the BRDF, then what's Rspec? (mentioned as "Rspec of the specular term")

 

3. Why does the BRDF in equation 7.45 becomes too bright at glancing angles? ?i is the angle between the normal and the light, not the normal and the view direction. Shouldn't it be glancing angles if viewed from the light source then?

 

4. How did the author get to equation 7.47 in here?

Image.png

Edited by Pilpel

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!