Microfacet Theory
There is a well-written paper by Eric Heitz1 explaining every details about the microfacet theory. I highly recommend everyone to read it to get a thorough understanding from beginning to end. The stuff I write here was just my rough understanding of the work, happy to correct this page anytime.
Radiance on Surface
Here is the definition of radiance from wikipedia.
In radiometry, radiance is the radiant flux emitted, reflected, transmitted or received by a given surface, per unit solid angle per unit projected area \([W\cdot sr^{-1}\cdot m^{-2}]\).
It matches the one defined in Veach's thesis, which is written as:
The \(A^\bot_{\omega}\) here means the area projected from the hypothetical surface onto the observed direction \(\omega\). For a real surface, the projected area measure \(dA^\bot_{\omega}\) in a real surface can be written as \(\left|\omega\cdot \mathbf{n}\right|dA(\mathbf{x})\). Even better, the dot product \(\left|\omega\cdot \mathbf{n}\right|\) can be transfered into the solid angle measure \((\sigma_\omega \rightarrow \sigma^\bot_{\omega})\), which can be beneficial sometimes if we want to leverage that property during integration, e.g. Stratified sampling of projected spherical caps, EGSR 2018.
Extending this to a microfacet model, where every micronormals \(\omega_m\) has its own direction, we need to integrate that over a small patch of surface \(\mathcal{M}\).
For every infinitesimal points \(\mathbf{x}\in\mathcal{M}\), its local radiance towards the observing direction is \(A^\bot_{\omega_o}L(\omega_o,\mathbf{x})\). So the integrated result will be the total amount of watts per steradian \([W\cdot sr^{-1}]\) that is radiating off to the observing direction \(\omega_o\). The purpose of the denominator \(A^\bot_{\omega_o}(\mathcal{M})\) which represents the total projected area of \(\mathcal{M},\) is here merely to normalize the entire thing back to per unit area \([W\cdot sr^{-1}\cdot m^{-2}]\).
Fun little fact, for marcosurface \(\mathcal{G}\) which its normal doesn't vary within the domain, it's radiance is no difference than the original definition of radiance.
Normal Distribution Function
Spatial integral isn't ideal to work with because the whole microfacet theory is based on a statistical model, it's not necessarily tied to an actual spatial representation. That being said, we need a way to convert that integral into the solid angle domain. Luckily, the distribution of normals is able to provide just that.
It is expressed in square meters per steradian \([m^2\cdot sr^{-1}]\), representing the density of normals that aligns a given direction \(\omega\) over the surface \(\mathcal{M}\), hence the dirac delta function \(\delta_\omega\). To better understand this magical function, imagine counting the number of micronormals in the patch that are pointing to the direction \(\omega\) within the domain space \(\mathcal{M}\). Its sum will be the area covering the selected population of normals, and this is where the area term \(m^2\) comes from. This adds on top of the fact that dirac delta always has the inverse dimension of its argument, which is in \(sr\) here, so its unit is per steradian \(sr^{-1}\).
Let's talk about an interesting property of the integral of normal distribution. Over any arbitrary solid angle region \(\Omega'\subset\Omega\) on the unit sphere, it always gives the total covered area whose normals lie in \(\Omega'\).
This makes \(\int_\Omega D(\omega_m)\ d\omega_m\) the total area of the microsurface \(\mathcal{M}\). Magical, right? Now any attempts of integrating a function of the microsurface normal \(\omega_m\) spatially over \(\mathcal{M}\) can be converted into a statistial integral:
TODO...
Geometric Attenuation
\(G_1(\omega_o, \omega_m)\) is the statistical masking function of micro-normal \(\omega_m\).
\(G_1(\omega_i, \omega_m)\) is the statistical shadowing function of micro-normal \(\omega_m\)
\(G(\omega_i, \omega_o)\) is the shadowing-masking term
Various Models
Notation
\(\chi^+(a)\) is a special step function, called Heaviside function. It is defined as \(1\) if \(a>0\) and \(0\) if \(a\leq 0\).
\(\omega_m\) is my preferred notation for micro-normal, it's also known as \(\mathbf{h}\) or \(\mathbf{m}\).
\(\omega_g\) is my preferred notation for geometric normal, it is also known as \(\mathbf{n}\) or \(Z=(0,0,1)\) if in local tangent-space.
Trowbridge–Reitz (GGX)
There are way too many forms online, I picked the known ones to show you that they are all equivalent.
Unreal 4 Approximation
Epic Games4 mostly adopts the formulations of \(F\) and \(G\) from the Schlick's model with slight modifications, but picked the \(D\) in the Disney's GGX model. These are obviously an approximation on top of an approximation. Every decisions made here are sacrificing minor visual error for faster computations.
-
Heitz E. (2014). Understanding the masking-shadowing function in microfacet-based BRDFs. Journal of Computer Graphics Techniques, 3(2), 32-91. ↩
-
Walter B., Marschner S. R., Li H., & Torrance K. E. (2007, June). Microfacet models for refraction through rough surfaces. In Proceedings of the 18th Eurographics conference on Rendering Techniques (pp. 195-206). ↩
-
Schlick C. (1994, August). An inexpensive BRDF model for physically‐based rendering. In Computer graphics forum (Vol. 13, No. 3, pp. 233-246). Edinburgh, UK: Blackwell Science Ltd. ↩
-
Karis B, Epic Games. (2013). Real shading in unreal engine 4. Proc. Physically Based Shading Theory Practice, 4(3), 1. ↩