# Relationship between roughness and BRDF

In a BRDF $f_r$, assume Cook-Torrance model, we have a microfacets distribution $D$. This distribution essentially models the rougheness of the material as far as I've understood. Given a direction $v$ it models the amount of microfacets having that orientation.

Now say we have a material, for each point $p$ in theory we have a 3D function that tell us the orientation in a given direction.

This explantion (not detailed) makes sense to me, however when I read about the roughness map what I see is that it's a kind of texture where each pixel has values between 0 and 1 (from black to white) I do struggle to understand the relationship between this map and the microfacets distribution.

Could anyone clarify?

Most normal distribution functions (NDFs) are parametrized by some variable (tipically $m$ or $\alpha$) that determines the "roughness" or "spikiness" of the NDF (this is often meant to be the rms slope of the surface).

Here is an example of how a roughness parameter effects an NDF: https://www.desmos.com/calculator/kcevxp3wm0

we can think of the NDF as a function of the direction as well as of the roughness value (as in $D(\theta,\phi,m)$. Here, $\phi$ and $\theta$ were used to represent spherical coordinates for the microsurface normal direction).

A roughness map can also be thought of as a function: one that returns a value for $m$ for every point $p$ on a surface. Hence, $m(p)$.

Since $m$ is an argument of the NDF we can write the previous expression like this: $D(\theta,\phi,m(p))$

And, because $m(p)$ may be different for every $p$ but stays fixed when we only vary $\phi$ and $\theta$, we effectively get a whole different NDF on every point on the surface.

• So literally the roughness map is the distribution parameters per point. Is that correct? – user8469759 Feb 13 '18 at 9:35
• That is correct. – Sebastián Mestre Feb 13 '18 at 16:20

for each point $p$ in theory we have a 3D function that tells us the orientation in a given direction

You have missunderstood this. $D$ is a Normal Distribution Function (or short NDF), so it doesn't really give you a single normal, but a distribution. In a (specular) BRDF you are always using the normal that is the half vector between the incoming and outgoing light, since via your theory, every microfacet is a perfect mirror and thus every microfacet reflects light exactly along the (micro) surface and that one only.

You also must not confuse roughness with microfacet normal. The roughness is a more or less arbitrary value (and a scalar, so a single one at that). The roughness is being used differently, depending on the overall BRDF (e.g. roughness in GGX(/Trowbridge-Reitz) is different from the Roughness in Oren-Nayar) and therefore can have different ranges. Still, if you look at one specific NDF, you will see, how the roughness is used.

$D(\omega_m) = \frac{\alpha^2}{\pi((\omega_n \cdot \omega_m)^2 (\alpha^2-1)+1)^2}$

with $\alpha = roughness^2$ (a common remapping), $\omega_m$ is the microfacet normal, $\omega_n$ is the geometry normal.

You can see here, that the roughness is being treated like a single value. The higher the roughness is, the more random your microfacets (or normals thereof) are distributed. The more that happens, the less your surface will reflect light concentrated into the same direction (i.e. the less highlights you will have). Thus, your material is more diffuse.

Since now your roughness is a single value, the map makes sense to have only values in $\left[0, 1\right]$ and therefore is a gray scale image.

• I don't think I've misunderstood the meaning of $D$. According to the original paper written by torrance, the microfacets distribution $D$ quantify the amount of microfacets that would reflect the the light coming from a direction into another. Isn't that what it is? – user8469759 Feb 13 '18 at 9:34
• Not as in total numbers, but essentially, yes. Your wording/question structure made me assume you got it wrong. – Tare Feb 13 '18 at 9:43
• Not as in total, but in percentage yes (it's a distribution function, in sense of probability but built upon the number of microfacets facing the halfway vector between incident light and reflection direction. – user8469759 Feb 13 '18 at 9:48