For a while I have been doing some research on the topic of Physically Based Rendering. One reflection model that is mentioned over and over is the Cook-Torrance / Torrance-Sparrow model. It seems like in each mention or explanation of this model a different form of the specular term is used. The versions I have found are:

  1. $${\frac {FDG}{\pi ({\vec N}\cdot {\vec V})({\vec N}\cdot {\vec L})}}$$
  2. $${\frac {FDG}{4 ({\vec N}\cdot {\vec V})({\vec N}\cdot {\vec L})}}$$
  3. $${\frac {FDG}{({\vec N}\cdot {\vec V})({\vec N}\cdot {\vec L})}}$$

Which one is correct, and when? In Physically Based Rendering: From Theory to Implementation by Matt Pharr and Greg Humphreys, the second one is conclusively derived, but in their original paper Cook and Torrance use the first one without any detailed explanation.

I would trust Pharr and Humphreys on this. Equation 2 also agrees with the SIGGRAPH Physically Based Rendering course notes, as well as with equation 20 in the Walter et al paper that introduced the GGX distribution.

I've read somewhere that there is an error in the original Cook-Torrance paper that led them to miss the factor of 4 in the denominator, which was corrected in subsequent papers. I couldn't find a reference to this with a quick search though (if anyone knows one, please feel free to note it in the comments).

As for the factor of π, it might appear or not, depending on conventions. Sometimes it's factored into the normal distribution function D. For instance, if you look in the Walter et all GGX paper section 5.2 where they give the equations for several D functions, you can see they all have a π in the denominator. Note that this implies that the Lambertian BRDF should have a π in the denominator as well.

In real-time graphics, the π is often left out, in which case we can interpret it as having been factored into the light colors. Either way is fine, as long as you're consistent about either putting the π in or leaving it out of all the BRDFs you use.

A more recent paper (2005 at least ;) ), has a more concise notation while comparing multiple BRDFs including the Cook-Torrance BRDF. Their formula does not include the division by 4.

Addy Ngan, Frédo Durand, Wojciech Matusik: Experimental Analysis of BRDF Models, Proceedings of the Eurographics Symposium on Rendering 2005.

Project Page, Supplemental (Take a look at the supplemental!)

Note, however that the Cook-Torrance BRDF is not equal and thus not a synonym for the Torrance-Sparrow BRDF. The latter includes your division by 4. An interesting reference overview can be found in:

Rosana Montes, Carlos Ureña: An Overview of BRDF Models, Technical Report, 2012.

The same Cook-Torrance BRDF formula is also present in:

Philip Dutré, Kavita Bala, Philippe Bekaert: Advanced Global Illumination, 2nd Edition, 2006.

Edit: I looked at some (isotropic) implementations of the F, G (or V depending if you factor the foreshortening in the denominator into G) and D:

  • D: Beckmann, Ward-Duer, Blinn-Phong, Trowbridge-Reitz a.k.a. GGX a.k.a. GTR2, Berry a.k.a. GTR1;
  • G|V: Implicit, Ward, Neumann, Ashikhmin-Premoze, Kelemann, Cook-Torrance, Smith GGX, Smith Schlick-GGX, Smith Beckmann, Smith Schlick-Beckmann;
  • F: Schlick, Cook-Torrance.

They all seem to be used (in the literature, in the animation industry and in the gaming industry) in the format corresponding to your second option. All the D factors in my enumeration contain an explicit $\frac{1}{\pi \alpha^2} $ with $\alpha \equiv \text{roughness}^2$ (See Equations).

Edit 2: A recent presentation deriving and explaining the division by $4$ instead of $\pi$:

Earl Hammon: PBR Diffuse Lighting for GGX+Smith Microsurfaces, GDC 2017.

To make a long story shorter, option 2 is the only correct specular term (of the three options provided).

  • Blinn-Phong does not use $\alpha \equiv roughness^2$. it has an arbitrary "roughness" parameter. Also, the $\alpha$ in Beckmann is not the same as the $\alpha$ in GGX. In Beckmann, $\alpha \in [0, \infty)$ and in GGX $\alpha \in [0, 1]$ (although both describe the RMS Slope). – Tare Oct 13 '17 at 12:46
  • 1
    @Tare For Blinn-Phong you need to use a derived version which derives alpha from the specular exponent. See graphicrants.blogspot.be/2013/08/specular-brdf-reference.html – Matthias Oct 13 '17 at 13:21
  • 1
    Okay, you didn't mention that in your post, so I assumed you were using the original form. – Tare Oct 13 '17 at 14:16

Personally I have used equation 2. Equation 3 seems incorrect to me, the Pi factor is to normalise the light response and for energy conservation. Essentially you do not want more light to be reflected from the surface than what it receives.

Equation 2 is an improvement of equation 1 and is more correct as far as I'm aware. For more information about equation 2, see Microfacet Models for Refraction through Rough Surfaces by Walter et al

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.