# Confused with PBR implementations

I'm discovering the wonderful world of math and I'm hitting a huge wall with PBR and naming so I have a few questions: As far as I understand BRDF describe how a material react to light (incoming direct light and reflections). But in "Cook-Torrance" I don't see anything about reflections I don't understand how I integrate it so I only get diffuse light and reflections.

I've read a lot about different "diffuse term" like "Oren-Nayar" is it a part of Cook-Torrance like a different "D" in the DFG nominator ? does it replace it without specular calculations ?

I've read a lot about "GGX" from my blender artist background I thought it was something that make a blurry reflection but It seems I was wrong and now I find this GGX term in a lot of different situations like in micro-facet normal distribution in this tutorial

So in short the question is: how "Oren-Nayar" and "GGX" and "Cook-Torrance" are related to each other (if they are) and how do I integrate "vec3 reflection" in those algorithm ?

As I said before I'm a newbie in math so If your answer is "math heavy" please write a glsl/hlsl version of your equations it's much easier to understand for me so an equivalence will help me a lot

PS: I understand my question is blurry but it is also as blurry as my understanding of the subject.

• Something that might help you out is that "specular" means "mirror like". So, when talking about specular and diffuse reflections, specular means mirror like reflections, what people normally call reflection. Diffuse is just "things lighting up". They are reflecting light too, but they are reflecting from many different directions, so the result isn't anything that you can recognize an image in. There is a scale between specular and diffuse reflection in real objects, and this is part of what the "roughness" parameter of PBR controls. Jun 2, 2017 at 22:06
• You can try to read the original Cook-Torrance paper: inst.cs.berkeley.edu/~cs294-13/fa09/lectures/cookpaper.pdf - be sure to check the references listed in the end too, when possible (most are available online). It will take some time, but it is a sure way to understand "in depth" what is happening.
– wip
Jun 6, 2017 at 6:00

DFG pops up in the family of microfacet based BRDFs. It is simply the product of three terms:

• D : The microfacet distribution.
• F : The fresnel coefficient.
• G : The geometric attenuation between microfacets.

When someone says Cook-Torrance, they usually mean a microfacet BRDF where the distribution (D) is Beckmann, which I think is what the original Cook-Torrance paper was about.

GGX is really just a different distribution (D term). GTR is another one. The names are often used as a shortcut to mean a BRDF using that distribution.

Now all of these assume specular reflection (or refraction) on the microfacets, hence the fresnel term. If you take a similar idea but use diffuse (lambertian) microfacets, you get the Oren-Nayar BRDF. I think that one is based on a gaussian distribution of the microfacets but I'm not familiar with the details.

• okay, that's a bit more clear but it still doesn't explain what do I do with my "vec3 reflectionColour" that I get from re-launching a ray in raytracing/marching or using SSR/cubemap. It's like the equations only taking into account a pointlight/spotlight but no idea for area lights or reflections. It also seems that the "specular" is only related to the "white dot" instead of reflection because of that which doesn't make sense =/ Jun 5, 2017 at 23:57
• @newin In a PBR model, specular and reflection are different names for the same thing. It's a specular highlight when the ray hits a light, a reflection when it hits another object (or an environment). As for your reflectionColour, it depends how the ray is generated. Are you sampling direct lighting? Area lights? Integrating a BRDF against and environment map? Try reading Progressive Path Tracing with Explicit Light Sampling, there's a long answer which might clear a few things up about the process. Jun 6, 2017 at 1:04
• So if I understand correctly that "vec3 reflectionColour" should be treated as a light and if I want to make mesh emitting light I should just put a value > 1 in the albedo and that's it ? (I'm trying to integrate PBR in to different scenario the first is a raymarcher where I want meshes emitting light, the other is a game engine that use SSR and probably will use cubemaps) Jun 6, 2017 at 12:16
• @newin emitted light is just added on top of everything else. It's unrelated to BRDFs. If your mesh does nothing but emit light, you don't even need to trace any further rays from it. A large albedo will amplify light (physically wrong), not create it. Jun 6, 2017 at 14:57